formatting fixes
This commit is contained in:
parent
35e3a813f2
commit
1cc71b113b
2 changed files with 24 additions and 23 deletions
|
@ -145,7 +145,8 @@ static class Arts
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
// false tail
|
// false tail
|
||||||
if (tailmove.state && snake_t < 1.0f) {
|
if (tailmove.state && snake_t < 1.0f)
|
||||||
|
{
|
||||||
int i_tail = Maths.min(Mono.snake_len, Mono.snake.Length - 1);
|
int i_tail = Maths.min(Mono.snake_len, Mono.snake.Length - 1);
|
||||||
Vec3 tail_dir = Vec3.Direction(Mono.snake[i_tail - 1].ToVec3, Mono.snake[i_tail].ToVec3);
|
Vec3 tail_dir = Vec3.Direction(Mono.snake[i_tail - 1].ToVec3, Mono.snake[i_tail].ToVec3);
|
||||||
meshes["Segment"].Draw(
|
meshes["Segment"].Draw(
|
||||||
|
|
38
src/Mono.cs
38
src/Mono.cs
|
@ -190,7 +190,9 @@ static class Mono
|
||||||
|
|
||||||
SFX.crisp_nom.PlayBox(snake[0]);
|
SFX.crisp_nom.PlayBox(snake[0]);
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
(bool viable, XYZi cell) = Feed();
|
(bool viable, XYZi cell) = Feed();
|
||||||
eaten_latch.Step(!viable);
|
eaten_latch.Step(!viable);
|
||||||
if (eaten_latch.delta == -1)
|
if (eaten_latch.delta == -1)
|
||||||
|
@ -250,7 +252,7 @@ static class Mono
|
||||||
XYZi _sv = queue.Dequeue();
|
XYZi _sv = queue.Dequeue();
|
||||||
int currentDistance = fill_array[_sv];
|
int currentDistance = fill_array[_sv];
|
||||||
|
|
||||||
// check all 4 directions
|
// check all 6 directions
|
||||||
foreach (XYZi dir in directions)
|
foreach (XYZi dir in directions)
|
||||||
{
|
{
|
||||||
XYZi newV = _sv + dir;
|
XYZi newV = _sv + dir;
|
||||||
|
@ -274,9 +276,7 @@ static class Mono
|
||||||
for (int i = indices.Length - 1; i > 0; i--)
|
for (int i = indices.Length - 1; i > 0; i--)
|
||||||
{
|
{
|
||||||
int j = System.Random.Shared.Next(i + 1);
|
int j = System.Random.Shared.Next(i + 1);
|
||||||
int temp = indices[i];
|
(indices[j], indices[i]) = (indices[i], indices[j]);
|
||||||
indices[i] = indices[j];
|
|
||||||
indices[j] = temp;
|
|
||||||
}
|
}
|
||||||
return indices;
|
return indices;
|
||||||
}
|
}
|
||||||
|
@ -284,23 +284,23 @@ static class Mono
|
||||||
// directions for moving in the grid
|
// directions for moving in the grid
|
||||||
static readonly XYZi[] directions = new XYZi[]
|
static readonly XYZi[] directions = new XYZi[]
|
||||||
{
|
{
|
||||||
new XYZi(-1, 0, 0), // lft
|
new(-1, 0, 0), // lft
|
||||||
new XYZi(+1, 0, 0), // rht
|
new(+1, 0, 0), // rht
|
||||||
new XYZi(0, -1, 0), // dwn
|
new(0, -1, 0), // dwn
|
||||||
new XYZi(0, +1, 0), // up
|
new(0, +1, 0), // up
|
||||||
new XYZi(0, 0, -1), // fwd
|
new(0, 0, -1), // fwd
|
||||||
new XYZi(0, 0, +1), // back
|
new(0, 0, +1), // back
|
||||||
};
|
};
|
||||||
static readonly XYZi[] corners = new XYZi[]
|
static readonly XYZi[] corners = new XYZi[]
|
||||||
{
|
{
|
||||||
new XYZi(-1, -1, -1),
|
new(-1, -1, -1),
|
||||||
new XYZi(-1, -1, +1),
|
new(-1, -1, +1),
|
||||||
new XYZi(-1, +1, -1),
|
new(-1, +1, -1),
|
||||||
new XYZi(-1, +1, +1),
|
new(-1, +1, +1),
|
||||||
new XYZi(+1, -1, -1),
|
new(+1, -1, -1),
|
||||||
new XYZi(+1, -1, +1),
|
new(+1, -1, +1),
|
||||||
new XYZi(+1, +1, -1),
|
new(+1, +1, -1),
|
||||||
new XYZi(+1, +1, +1)
|
new(+1, +1, +1)
|
||||||
};
|
};
|
||||||
|
|
||||||
static XYZi InsetCell(XYZi cell)
|
static XYZi InsetCell(XYZi cell)
|
||||||
|
|
Loading…
Add table
Reference in a new issue