//====== override: GameObject protected override void UpdateImpl() { Direction?direction = moveQueue.Peek(); if (direction is null) { movementController.Move(movementController.CurrentDirection); } else { if (movementController.Move(direction.Value)) { moveQueue.Dequeue(); } } }
public bool Move(Direction direction) { if (direction.IsOpposite(CurrentDirection)) { direction = CurrentDirection; } snakeMover.Move(direction); return(true); }
public bool Move(Direction direction) { if (moveDelay.IsDone == false) { return(false); } snakeMover.Move(direction); moveDelay = gameTime.CreateDelay(snakeSpeed.CurrentDelay); return(true); }