コード例 #1
0
        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);
                }
            }
        }
コード例 #2
0
ファイル: Constants.cs プロジェクト: GodLesZ/svn-dump
		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();
			}
		}
コード例 #3
0
ファイル: Constants.cs プロジェクト: GodLesZ/svn-dump
		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();

			}
		}
コード例 #4
0
 /// <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);
 }
コード例 #5
0
        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();
            }
        }
コード例 #6
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();
            }
        }
コード例 #7
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();
            }
        }
コード例 #8
0
ファイル: Constants.cs プロジェクト: GodLesZ/svn-dump
		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;
				}
			}
		}
コード例 #9
0
ファイル: Constants.cs プロジェクト: GodLesZ/svn-dump
		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();
			}
		}