Example #1
0
 protected void Jump(GameTime gt)
 {
     Velocity.Y = -20;
     ChangeGameObjectState(GameObject_State.Air);
     ChangeAnimationState(Animation_State.jumpSquat);
     StaticSoundPlayer.PlaySound(SoundEffects.PLAYER_JUMP, 1, (float)Math.Sin(gt.TotalGameTime.TotalMilliseconds));
 }
Example #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_LayerLowest = new SpriteBatch(GraphicsDevice);
            SpriteBatch_HUD         = new SpriteBatch(GraphicsDevice);

            lvl = new Level(Content, CurrentLevel);

            ThePlayer = new Player(Content, "Player/", 15, lvl.PlayerSpawnPosition);

            MyCamera = new Camera(GraphicsDevice.Viewport, lvl, ref ThePlayer);

            ThePlayer.SetSpawnPosition(lvl.PlayerSpawnPosition);
            ThePlayer.Respawn();

            TheSoundPlayer = new SoundPlayer(Content);
            StaticSoundPlayer.SetSoundPlayer(ref TheSoundPlayer);

            TheSpawnableEffect_List = new SpawnableEffect_List(Content);
            StaticSpawnableEffect.SetSpawnableEffect_List(ref TheSpawnableEffect_List);

            TheGameHud = new GameHud(Content);
            // TODO: use this.Content to load your game content here
        }
Example #3
0
 public int TriggerCollect(GameTime gt)
 {
     StaticSoundPlayer.PlaySound(SoundEffects.GET_COLLECTIBLE);
     ChangeGameObjectState(GameObject_State.Death);
     DeathDelayTimer = (int)gt.TotalGameTime.TotalMilliseconds + 590;
     ChangeAnimationState(Animation_State.death);
     Collected = true;
     return(CollectibleValue);
 }