示例#1
0
        public void LandOnKoopa()
        {
            SoundFactory.PlaySoundEffect(SoundFactory.Kick());

            if (this.SpriteState == SpriteStates.Sprites.JUMPING)
            {
                this.SetSheetState(SpriteStates.Sheets.NORMAL);
                this.SetSpriteState(SpriteStates.Sprites.WALKING);
                this.Move();
            }
            else if (this.SpriteState == SpriteStates.Sprites.WALKING)
            {
                int walkingSpriteHeight = this.Info.spriteHeight;
                this.SetSpriteState(SpriteStates.Sprites.SHELLED);
                this.SetSheetState(SpriteStates.Sheets.SHELL);
                this.Info.velocity.X = 0;
            }
            else
            {
                if (this.Info.velocity.X < 3)
                {
                    this.Info.velocity.X = 3;
                }
                else
                {
                    this.Info.velocity.X = 0;
                }
            }
        }
示例#2
0
        //Gets killed by fireball or shell
        public void Die()
        {
            SoundFactory.PlaySoundEffect(SoundFactory.Kick());

            this.Info.spriteEffects = SpriteEffects.FlipVertically;
            this.Info.bounce        = false;
            this.Info.manual        = true;
            Thread t = new Thread(new ThreadStart(delegate()
            {
                this.Info.velocity.Y = -30;
                Thread.Sleep(200);
                this.Info.velocity.Y = -10;
                Thread.Sleep(50);
                this.Info.velocity.Y = 10;
                Thread.Sleep(50);
                this.Info.velocity.Y = 30;
                Thread.Sleep(200);
                this.Info.velocity.Y = 50;
                Thread.Sleep(1000);
                SpriteLayer.CollisionLayer.RemoveSprite(this);
            }));

            t.IsBackground = true;
            t.Start();
        }
示例#3
0
        public void Die()
        {
            SoundFactory.PlaySoundEffect(SoundFactory.Kick());

            Thread t = new Thread(new ThreadStart(delegate()
            {
                this.Info.velocity.Y = -6;
                Thread.Sleep(1000);
                SpriteLayer.CollisionLayer.RemoveSprite(this);
            }));

            t.IsBackground = true;
            t.Start();
        }
示例#4
0
        //Jumped on by Mario.
        public void GetStomped()
        {
            SoundFactory.PlaySoundEffect(SoundFactory.Kick());

            Console.WriteLine("Killing Goomba");
            this.SetSheetState(SpriteStates.Sheets.NORMAL);
            this.SetSpriteState(SpriteStates.Sprites.DEAD);
            this.Info.velocity.X = 0;
            Thread t = new Thread(new ThreadStart(delegate()
            {
                Thread.Sleep(1000);
                SpriteLayer.CollisionLayer.RemoveSprite(this);
            }));

            t.IsBackground = true;
            t.Start();
        }