public MarioFireBallEntity(MarioFactory factory, Vector2 position)
        {
            FireBall = (Mario1)factory.getSprite((int)MarioTypes.FIREBALL);
            Vector2 vel = new Vector2(20f, 0f);

            FireBall.Velocity = vel;
            FireBall.Position = position;
        }
Ejemplo n.º 2
0
 public MarioEntity(MarioFactory factory, Vector2 position) : base()
 {
     spriteFactory = factory;
     HUD.MarioLifeTracker.Subscribe(this);
     Mario           = (Mario1)spriteFactory.getSprite((int)MarioTypes.NORMAL);
     Mario.Position  = position;
     Sprite.Position = position;
     Mario.Velocity  = new Vector2(0f, 0f);
 }
Ejemplo n.º 3
0
        public override void ChangeSprite()
        {
            MarioTypes type = CurrentPowerState.TypeEnum;

            if (type == MarioTypes.DEAD)
            {
                PlayBGM("death");
                DeathActionTransition();
            }
            else
            {
                // Get current sprite info
                Vector2    position  = Position;
                Vector2    speed     = Velocity;
                IAnimation animation = Animation;
                Vector2    accel     = Acceleration;

                this.Mario = (Mario1)spriteFactory.getSprite((int)type);

                Mario.Position  = position;
                Mario.Velocity  = speed;
                Mario.Animation = animation;
            }
        }