GAM456-SpaceInvaders / SpaceInvaders / 4_GameObject / Ship / MoveState / ShipMoveRight.cs
ShipMoveRight.cs
Raw
using System;
using System.Diagnostics;


namespace SpaceInvaders
{
    public class ShipMoveRight : ShipMoveState
    {
        public override void Handle(Ship pShip)
        {
            pShip.SetMoveState(ShipMan.MoveState.BothDirections);
        }

        public override void MoveLeft(Ship pShip)
        {
            //do nothing
        }

        public override void MoveRight(Ship pShip)
        {
            pShip.x += pShip.speed;
            this.Handle(pShip);
        }
    }
}