コード例 #1
0
ファイル: PlayerPhysics.cs プロジェクト: Ernesto01/applesgame
 public PlayerPhysics(UserControlledSprite player)
 {
     this.player = player;
     isJumping = false;
     wasJumping = false;
     jumpTime = 0;
     OnGround = true;
 }
コード例 #2
0
ファイル: SpriteManager.cs プロジェクト: roguebyte/cs473
        protected override void LoadContent()
        {
            spriteBatch = new SpriteBatch(Game.GraphicsDevice);

            player = new UserControlledSprite(Game.Content.Load<Texture2D>(@"Images/char01"),
                        Vector2.Zero, new Point(57, 95), 10, new Point(0, 0), new Point(2, 4),
                        new Vector2(6, 6));

            base.LoadContent();
        }
コード例 #3
0
ファイル: SpriteManager.cs プロジェクト: benallyc/applesgame
        protected override void LoadContent()
        {
            spriteBatch = new SpriteBatch(Game.GraphicsDevice);

            // Load player controlled character
            player = new UserControlledSprite(Game.Content.Load<Texture2D>(@"Images/char01"),
                        new Vector2(0,GROUND_LEVEL), new Point(57, 95), 10, new Point(0, 0), new Point(1, 1),
                        new Vector2(6, 6));

            // Load game controlled sprites
            for(int i = 0; i < 10; ++i)
                spriteList.Add(new AppleSprite(Game.Content.Load<Texture2D>(@"Images\apple"),
                    new Point(28, 32), 5, new Vector2(0, 2), Game.Window.ClientBounds));

            base.LoadContent();
        }
コード例 #4
0
ファイル: SpriteManager.cs プロジェクト: solisa7/applesgame
        protected override void LoadContent()
        {
            // Initialize spriteBatch object to correct GPU
            spriteBatch = new SpriteBatch(Game.GraphicsDevice);

            // Load Life sprite - Player always starts with 3 lives
            lives.Add(new HudSprite(Game.Content.Load<Texture2D>(@"Images/Heart"),
                        new Vector2(20, 30), new Point(101, 171), 0.19f));
            lives.Add(new HudSprite(Game.Content.Load<Texture2D>(@"Images/Heart"),
                        new Vector2(40, 30), new Point(101, 171), 0.19f));
            lives.Add(new HudSprite(Game.Content.Load<Texture2D>(@"Images/Heart"),
                        new Vector2(60, 30), new Point(101, 171), 0.19f));

            // Load bees sprites
            bee1 = new BeeSprite(Game.Content.Load<Texture2D>(@"Images/Bee1"),
                        new Vector2(600, GROUND_LEVEL+5), new Point(24,24), 5, new Point(0,0),
                        new Point(3,1), new Vector2(-3,0), 1f);
            bee2 = new BeeSprite(Game.Content.Load<Texture2D>(@"Images/Bee2"),
                        new Vector2(900, GROUND_LEVEL + 35), new Point(24, 24), 5, new Point(0, 0),
                        new Point(3, 1), new Vector2(-2, 0), 1f);

            // Load bird sprite
            bird = new BirdSprite(Game.Content.Load<Texture2D>(@"Images/Bird5"),
                        new Vector2(500, 530), new Point(47, 44), 5, new Point(0, 0),
                        new Point(9, 1), new Vector2(0, 0), 1.17f);

            // Load player controlled character
            player = new UserControlledSprite(Game.Content.Load<Texture2D>(@"Images/Idle"),
                        new Vector2(0,GROUND_LEVEL), new Point(64, 64), 10, new Point(0, 0), new Point(1, 1),
                        new Vector2(6, 6), 1f);
            player.Initialize(Game.Services);

            // Load Apples
            loadApples();

            // Load Sound Effects
            beeHit = Game.Content.Load<SoundEffect>(@"Sounds\Hit3");
            appleCollected = Game.Content.Load<SoundEffect>(@"Sounds\AppleCollected");
            deadBird = Game.Content.Load<SoundEffect>(@"Sounds\Bird03");

            base.LoadContent();
        }