public void onStageChange(IStage stage) { if (stgBomberStage is WrapBombStage) { this.VelocityX *= (1f / Shared.Constants.BOMBER_VELOCITY_REDUCING); this.VelocityY *= (1f / Shared.Constants.BOMBER_VELOCITY_REDUCING); } stgBomberStage = stage; stgBomberStage.ApplyStageEffect(this); }
public override void onInit() { base.onInit(); // Get bomber resources sprMoveLeft = (Sprite)resourceManagement.GetResource<ISprite>(Shared.Resources.BomberMoveLeft); sprMoveRight = (Sprite)resourceManagement.GetResource<ISprite>(Shared.Resources.BomberMoveRight); sprMoveUp = (Sprite)resourceManagement.GetResource<ISprite>(Shared.Resources.BomberMoveUp); sprMoveDown = (Sprite)resourceManagement.GetResource<ISprite>(Shared.Resources.BomberMoveDown); sprWrapBomb = (Sprite)resourceManagement.GetResource<ISprite>(Shared.Resources.BomberWrapBomb); // Begin with move down sprCurrent = sprMoveDown; // Begin with idle stage stgBomberStage = IdleStage.getInstance(); stgBomberStage.ApplyStageEffect(this); velocity = new Vector2(5f, 5f); Range = 2; Shared.Global.Counter_BombCanLocated = 1; }