public void Respawn() { state = new RightIdleSmallMS(this); physState = new VVVVVVGroundState(this, 1); gravityDirection = 1; position = Game1.GetInstance().level.checkpoint; }
public Mario(Vector2 position) { state = new RightIdleSmallMS(this); physState = new GroundState(this); this.position = position; jumpFX = SoundManager.jump.CreateInstance(); factory = new SpriteFactory(); }
public void Jump() { if (velocity.Y > minVelocity.Y && !isFalling) { physState = new JumpingState(this); velocity.Y -= ValueHolder.jumpingVelocity; if (jumpFX.State == SoundState.Stopped) { jumpFX.Play(); } } state.Up(); }