void makeMove() { oldPos = new Pos2D(); newPos = new Pos2D(); oldPos = Game.player.position; switch (Input.mod) { case "u": case "up": newPos = new Pos2D(oldPos.x, oldPos.y - 1); break; case "d": case "down": newPos = new Pos2D(oldPos.x, oldPos.y + 1); break; case "l": case "left": newPos = new Pos2D(oldPos.x - 1, oldPos.y); break; case "r": case "right": newPos = new Pos2D(oldPos.x + 1, oldPos.y); break; default: newPos = oldPos; break; } Game.player.position = newPos; }
public static float Distens(Pos2D point1, Pos2D point2) { return(MathF.Sqrt(MathF.Pow((point2.x - point1.x), 2) + MathF.Pow((point2.y - point1.x), 2))); }
public static void Dis(Pos2D var) { Console.WriteLine("Debug: x:" + var.x + " y:" + var.y); }
public Wall(Pos2D pos) { symbole = "#"; isDrawn = true; position = pos; }