reflection goes out of the window
This commit is contained in:
@ -83,12 +83,12 @@ func (ts *GameScreen) Render() {
|
||||
|
||||
func (ts *GameScreen) walk(state *gamestate.GameState, dx, dy int) {
|
||||
controller := state.Controller
|
||||
coords := controller.GetComponent(state.Player, types.Coords{}.TypeOf()).(types.Coords)
|
||||
coords := controller.GetComponent(state.Player, ecs.CoordsComponent).(types.Coords)
|
||||
newCoords := types.Coords{coords.X + dx, coords.Y + dy}
|
||||
movable := controller.GetComponent(state.Player, movement.Moveable{}.TypeOf()).(movement.Moveable)
|
||||
movable := controller.GetComponent(state.Player, ecs.MoveableComponent).(movement.Moveable)
|
||||
|
||||
if !movable.IsBlocked(newCoords) {
|
||||
controller.UpdateComponent(state.Player, types.Coords{}.TypeOf(), newCoords)
|
||||
controller.UpdateComponent(state.Player, ecs.CoordsComponent, newCoords)
|
||||
}
|
||||
|
||||
state.Redraw <- struct{}{}
|
||||
|
Reference in New Issue
Block a user