Skip to content

Commit

Permalink
store/unit_astar: Changed the path to calculate to be bigger
Browse files Browse the repository at this point in the history
So visually the units pass cleancly in between the towers and don't gitchi inside of them
  • Loading branch information
xescugc committed Jan 20, 2024
1 parent 0a9ac1d commit a9bcb90
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
Binary file modified server/assets/wasm/maze-wars.wasm
Binary file not shown.
3 changes: 1 addition & 2 deletions store/unit_astar.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ func (us *Units) Astar(m *Map, lid int, u utils.MovingObject, tws []utils.Object
Object: utils.Object{
Y: u.Y,
X: u.X,
// W and H need to be 1 or it can pass in between the towers
W: 1, H: 1,
W: 16, H: 16,
},
Facing: u.Facing,
}
Expand Down
8 changes: 4 additions & 4 deletions utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func (o Object) NeighborSteps() []Step {
Object: Object{
Y: o.Y - 1,
X: o.X,
W: 1, H: 1,
W: 16, H: 16,
},
Facing: Up,
},
Expand All @@ -82,7 +82,7 @@ func (o Object) NeighborSteps() []Step {
Object: Object{
Y: o.Y + 1,
X: o.X,
W: 1, H: 1,
W: 16, H: 16,
},
Facing: Down,
},
Expand All @@ -91,7 +91,7 @@ func (o Object) NeighborSteps() []Step {
Object: Object{
X: o.X - 1,
Y: o.Y,
W: 1, H: 1,
W: 16, H: 16,
},
Facing: Left,
},
Expand All @@ -100,7 +100,7 @@ func (o Object) NeighborSteps() []Step {
Object: Object{
X: o.X + 1,
Y: o.Y,
W: 1, H: 1,
W: 16, H: 16,
},
Facing: Right,
},
Expand Down

0 comments on commit a9bcb90

Please sign in to comment.