using System;
using System.Windows.Forms;
using DxVBLib;
namespace MERCWars
{
///
/// Summary description for Paddle.
///
public class Ship : BitmapObject
{
Random random = new Random ((int) DateTime.Now.Ticks);
private int defense;
private int offense;
private bool status = false;
private int m_intShipMove = -1;
public int R_Move = 0;
public int L_Move = 1;
public int U_Move = 2;
public int D_Move = 3;
///
///
///
///
///
///
///
public Ship(int intSpriteWidth, int intSpriteHeight, int intStartXPosition, int intStartYPosition)
{
//set the start position of paddle
this.XPosition = intStartXPosition;
this.YPosition = intStartYPosition;
this.Offense = random.Next (2,20);
this.Defense = random.Next (2,20);
//initialise surface description with values from constructor
InitialiseSurfaceDescription(intSpriteWidth, intSpriteHeight);
}
public void Move()
{
/// need to check every move step to see if there is a combat
if (m_intShipMove == R_Move)
{
if (XPosition < 450)
{
XPosition += 50;
}
}
if (m_intShipMove == L_Move)
{
if (XPosition > 100)
{
XPosition -= 50;
}
}
if (m_intShipMove == U_Move)
{
if (YPosition > 100)
{
YPosition -= 50;
}
}
if (m_intShipMove == D_Move)
{
if (YPosition < 450)
{
YPosition += 50;
}
}
}
public int ShipMove
{
get
{
return m_intShipMove;
}
set
{
m_intShipMove = value;
}
}
public int Offense
{
get
{ return offense;}
set
{ offense = value;}
}
public int Defense
{
get
{ return defense;}
set
{ defense = value;}
}
public bool Status
{
get
{ return status;}
set
{ status = value;}
}
public void Dead ()
{
status = false;
}
///
/// move paddle
///
}
}