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


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

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

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