Astraeus Player's Guide

My First Unit

CUSTOM UNITS

The Basics



You may also want to explore the Units, Weapons, and Upgrades reference pages.

EXAMPLE: THE TANK CLASS

Getting Started


Customizing the Tank


public class Tank extends MyTeamUnit

{

public Tank (MyTeamPlayer p)  

{

super(p);

}

public void design()

{

setFrame(Frame.MEDIUM);

setStyle(Style.WEDGE);

addWeapon(new MachineGun(this));

addWeapon(new SmallLaser(this));   // remove this line

addUpgrade(new Plating(this));

addUpgrade(new Plating(this));

addUpgrade(new Shield(this));

}


public void action() 

{

// You can modify this method to have different behavior

}

}

 Player Class - Building the Tank


public void strategy() 

{

if(getFleetValuePercentage(Worker.class) < .5f)

{

buildUnit(new Gatherer(this));

}

else if(getFleetValuePercentage(Tank.class) < .2f)

{

buildUnit(new Tank(this));

}

else

{

buildUnit(new Fighter(this));

}

}

Run your code.  How does this unit work with the other fighters? 

SPECIALIZING UNITS

Some Unit Ideas