public Mario(Game1 game, Scene scene) { MarioFactory = new MarioFactory(game); currentSprite = (MarioSprite)MarioFactory.MakeProduct(1); powerupStateFactor = 0; actionStateFactor = 1; direction = 1; idle = new MarioIdleState(this); jump = new MarioJumpingState(this); walk = new MarioWalkingState(this); crouch = new MarioCrouchingState(this); fall = new MarioFallingState(this); standard = new MarioStandard(this); super = new MarioSuper(this); fire = new MarioFire(this); dead = new MarioDead(this); powerupState = standard; currentState = idle; previousState = currentState; previousSprite = currentSprite; this.game = game; this.scene = scene; gravity = scene.Gravity; isGrounded = false; points = 0; coins = 10; lives = 3; sounds = new SoundMachine(game); }
public Mario(Game1 game, int posX, int posY) { MarioFactory = new MarioFactory(game); currentSprite = (MarioSprite)MarioFactory.MakeProduct(1); powerupStateFactor = 0; actionStateFactor = 1; direction = 1; idle = new MarioIdleState(this); jump = new MarioJumpingState(this); walk = new MarioWalkingState(this); crouch = new MarioCrouchingState(this); fall = new MarioFallingState(this); standard = new MarioStandard(this); super = new MarioSuper(this); fire = new MarioFire(this); dead = new MarioDead(this); powerupState = standard; currentState = idle; previousState = currentState; previousSprite = currentSprite; marioVec.X = posX; marioVec.Y = posY; }
public void SuperCommand() { powerupState = super; }
public void StandardCommand() { powerupState = standard; }
public void FireCommand() { powerupState = fire; }
public void DeadCommand() { powerupState = standard; this.toDead(); }