Exemplo n.º 1
0
        public DKKongTileCollectedState(DKKongTile item)
        {
            this.item = item;
            switch (item.KongTileLetter)
            {
            case DKKongTileType.K:
                SoundPool.PlaySound(Sound.CollectibleLetterK);
                break;

            case DKKongTileType.O:
                SoundPool.PlaySound(Sound.CollectibleLetterO);
                break;

            case DKKongTileType.N:
                SoundPool.PlaySound(Sound.CollectibleLetterN);
                break;

            case DKKongTileType.G:
                SoundPool.PlaySound(Sound.CollectibleLetterG);
                break;
            }
            ScoreSystem.addKongTiles(item.KongTileLetter);
            PhysicsWorld.Instance.DestroyBody(this.item.Body);
            WorldManager.Instance.RemoveObject(this.item);
        }
Exemplo n.º 2
0
 public void Kill()
 {
     state = new EnemyDeadState();
     PhysicsWorld.Instance.DestroyBody(this.Body);
     WorldManager.Instance.RemoveObject(this);
     SoundPool.PlaySound(Sound.EnemyKritterDie);
     //body.UpdateVelocity(body.Velocity.X, body.Velocity.Y + 1);
 }
Exemplo n.º 3
0
 public DKBalloonCollectedState(DKBalloon item)
 {
     this.item = item;
     ScoreSystem.addLives(1);
     SoundPool.PlaySound(Sound.CollectibleLifeGained);
     PhysicsWorld.Instance.DestroyBody(this.item.Body);
     WorldManager.Instance.RemoveObject(this.item);
 }
 public void ProcessCollected()
 {
     this.item.Sprite = ItemSpriteFactory.Instance.CreateDKCheckpointBarrelSpriteOpened();
     //not removed from wm list to keep on screen
     PhysicsWorld.Instance.DestroyBody(this.item.Body);
     CheckpointManager.Instance.UpdateCheckpointLocation(this.item.Body.BottomCenter);
     SoundPool.PlaySound(Sound.CollectibleBarrelSave);
 }
Exemplo n.º 5
0
 public void Kill()
 {
     state = new EnemyDeadState();
     PhysicsWorld.Instance.DestroyBody(this.Body);
     WorldManager.Instance.RemoveObject(this);
     SoundPool.PlaySound(Sound.EnemyGnawtyDie);
     //Sprint 3 would've move the enemy off the screen
     //body.UpdateVelocity(body.Velocity.X, body.Velocity.Y + 1);
 }
 public DKBananaGroupCollectedState(DKBananaGroup item)
 {
     this.item          = item;
     item.Body.Velocity = new Vector2(X_COLLECTED_SPEED, Y_COLLECTED_SPEED);
     ScoreSystem.addBananas(10);
     SoundPool.PlaySound(Sound.CollectibleBananaGroup);
     //Should probably have some form of garbage collection for collectibles off the screen to pull them from WM & PW
     //PhysicsWorld.Instance.DestroyBody(this.item.Body);
     //WorldManager.RemoveObject(this.item);
 }
        public DKTrophyCollectedState(DKTrophy item)
        {
            this.item = item;
            if (counter++ == 1)
            {
                SoundPool.PlaySound(Sound.CollectibleTrophy1);
            }
            else if (counter++ == 2)
            {
                SoundPool.PlaySound(Sound.CollectibleTrophy2);
            }
            else if (counter++ == 3)
            {
                SoundPool.PlaySound(Sound.CollectibleTrophy3);
            }
            else if (counter++ > 3)
            {
                SoundPool.PlaySound(Sound.CollectibleTrophyAll);
            }

            PhysicsWorld.Instance.DestroyBody(this.item.Body);
            WorldManager.Instance.RemoveObject(this.item);
        }
Exemplo n.º 8
0
 protected override void Setup(Player player, IPlayerStateTransitionSet transitionSet, ISprite sprite)
 {
     base.Setup(player, transitionSet, sprite);
     player.Body.ApplyScaledImpulse(new Vector2(0, JUMP_IMPULSE_MAG));
     SoundPool.PlaySound(Sound.RambiJump);
 }
 public DKStandardBarrelBrokenState(DKStandardBarrel item)
 {
     this.item   = item;
     item.Sprite = ItemSpriteFactory.Instance.CreateDKStandardBarrelBrokenSprite();
     SoundPool.PlaySound(Sound.CollectibleBarrelBreak);
 }
Exemplo n.º 10
0
 public void Win()
 {
     SoundPool.PlaySound(Sound.PlayerDKVictory);
     ScoreSystem.Reset();
     player.Win();
 }
Exemplo n.º 11
0
 public DKThrownBarrelRollState(DKThrownBarrel item)
 {
     this.item   = item;
     item.Sprite = ItemSpriteFactory.Instance.CreateDKBarrelRollSprite();
     SoundPool.PlaySound(Sound.CollectibleBarrelRoll);
 }