Exemplo n.º 1
0
 internal PacmanObject(GraphicsHandler handler, IReadOnlyCollection <RectangleF> walls)
     : base(GraphicsConstants.SpriteSize)
 {
     sprite = new PacmanSprite
     {
         Orientation = Direction.Right
     };
     handler.Register(this, sprite);
     State      = new PacmanMovingState(this);
     this.walls = walls;
 }
Exemplo n.º 2
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            pacmanSprite = PacmanSprite.create(this, graphics);
            ghostSprites = new GhostSprite[] {
                GhostSprite.create(this, graphics, Color.Thistle),
                GhostSprite.create(this, graphics, Color.SteelBlue),
                GhostSprite.create(this, graphics, Color.Blue),
                GhostSprite.create(this, graphics, Color.Violet),
                GhostSprite.create(this, graphics, Color.Turquoise)
            };
            level = Level.create(this, graphics);

            scoreFont = Content.Load<SpriteFont>("Fonts/Score");
            gameOverFont = Content.Load<SpriteFont>("Fonts/GameOver");
            am = Content.Load<SoundEffect>("Audio/am");
            bum = Content.Load<SoundEffect>("Audio/bum");
        }