public static int InitialJumps(EGhostType ghost, bool newLevel) { if (newLevel) { switch (ghost) { case EGhostType.Inky: return((int)MathHelper.Clamp((20 - Level) / 2, 0, 10)); case EGhostType.Clyde: return(InitialJumps(EGhostType.Inky, true) + 2); default: return(0); } } else { switch (ghost) { case EGhostType.Inky: return(1); case EGhostType.Clyde: return(2); default: return(0); } } }
public static List<Point> scatterTiles(EGhostType identity) { switch (identity) { case EGhostType.Blinky: return scatterTilesBlinky; case EGhostType.Clyde: return scatterTilesClyde; case EGhostType.Inky: return scatterTilesInky; case EGhostType.Pinky: return scatterTilesPinky; default: throw new ArgumentException(); } }
public static EntityPosition startPosition(EGhostType identity) { switch (identity) { case EGhostType.Blinky: return startPositionBlinky; case EGhostType.Pinky: return startPositionPinky; case EGhostType.Clyde: return startPositionClyde; case EGhostType.Inky: return startPositionInky; default: throw new ArgumentException(); } }
/// <summary> /// Instantiates a ghost. /// </summary> /// <param name="game">A reference to the Game object, needed for access to services.</param> /// <param name="player">A reference to the Pac Man, needed for AI.</param> /// <param name="identity">Which ghost, needed for appearance and behavior.</param> public Ghost(Game game, Player player, EGhostType identity) { spriteBatch_ = (SpriteBatch)game.Services.GetService(typeof(SpriteBatch)); ghostBase1_ = game.Content.Load <Texture2D>("sprites/GhostBase"); ghostBase2_ = game.Content.Load <Texture2D>("sprites/GhostBase2"); ghostChased_ = game.Content.Load <Texture2D>("sprites/GhostChased"); eyesBase_ = game.Content.Load <Texture2D>("sprites/GhostEyes"); eyesCenter_ = game.Content.Load <Texture2D>("sprites/GhostEyesCenter"); colorBase_ = Constants.colors(identity); GhostType = identity; previousNumCrumps_ = 0; Reset(true, player); wiggle_ = true; direction_ = new EDirection(); lastJunction_ = new Point(); scatterTiles_ = Constants.scatterTiles(identity); }
public static EntityPosition startPosition(EGhostType identity) { switch (identity) { case EGhostType.Blinky: return(startPositionBlinky); case EGhostType.Pinky: return(startPositionPinky); case EGhostType.Clyde: return(startPositionClyde); case EGhostType.Inky: return(startPositionInky); default: throw new ArgumentException(); } }
public static List <Point> scatterTiles(EGhostType identity) { switch (identity) { case EGhostType.Blinky: return(scatterTilesBlinky); case EGhostType.Clyde: return(scatterTilesClyde); case EGhostType.Inky: return(scatterTilesInky); case EGhostType.Pinky: return(scatterTilesPinky); default: throw new ArgumentException(); } }
public static Color colors(EGhostType identity) { switch (identity) { case EGhostType.Blinky: return(Color.Red); case EGhostType.Clyde: return(Color.Orange); case EGhostType.Inky: return(Color.LightSkyBlue); case EGhostType.Pinky: return(Color.LightPink); default: throw new ArgumentException(); } }
public static int InitialJumps(EGhostType ghost, bool newLevel) { if (newLevel) { switch (ghost) { case EGhostType.Inky: return (int)MathHelper.Clamp((20 - Level) / 2, 0, 10); case EGhostType.Clyde: return InitialJumps(EGhostType.Inky, true) + 2; default: return 0; } } else { switch (ghost) { case EGhostType.Inky: return 1; case EGhostType.Clyde: return 2; default: return 0; } } }
public static Color colors(EGhostType identity) { switch (identity) { case EGhostType.Blinky: return Color.Red; case EGhostType.Clyde: return Color.Orange; case EGhostType.Inky: return Color.LightSkyBlue; case EGhostType.Pinky: return Color.LightPink; default: throw new ArgumentException(); } }