GAM456-SpaceInvaders / SpaceInvaders / 4_GameObject / Ship / MissileState / ShipMissileReady.cs
ShipMissileReady.cs
Raw
using System;
using System.Diagnostics;


namespace SpaceInvaders
{
    public class ShipMissileReady : ShipMissileState
    {
        public override void Handle(Ship pShip)
        {
            pShip.SetMissileState(ShipMan.MissileState.Flying);
        }

        public override void ShootMissile(Ship pShip)
        {
            Missile pMissile = ShipMan.ActivateMissile();
            pMissile.SetPosition(pShip.x, pShip.y + 20);

            SoundManager.Play("shoot.wav");

            this.Handle(pShip);
        }
    }
}