private bool EatApples(Apples app) { if (app.Dots[this.Y, this.X]) { app.Dots[this.Y, this.X] = false; Game.Scores += 1; return(true); } return(false); }
private Direction CheckApplesDown(Apples app) { return(app.IfExistApple(this.X, this.Y + 1) ? Direction.Down : Direction.None); }
private Direction CheckApplesUp(Apples app) { return(app.IfExistApple(this.X, this.Y - 1) ? Direction.Up : Direction.None); }
private Direction CheckApplesRight(Apples app) { return(app.IfExistApple(this.X + 1, this.Y) ? Direction.Right : Direction.None); }
private Direction CheckApplesLeft(Apples app) { return(app.IfExistApple(this.X - 1, this.Y) ? Direction.Left : Direction.None); }
public Map(int[,] array, int pacmanX, int pacmanY) { this.MyMap = array; this._apples = new Apples(array, pacmanX, pacmanY); }