/// <summary> /// Creates a BattleTank with the passed information /// Setting the colour with GetColour() /// Durability with GetTankArmour(); /// TankModel with GetTank(); /// Author Greyden Scott & Sean O'Connell October 2017 /// Written, edited and tested by both team members /// </summary> /// <param name="player">The player associated with the Battle Tanks</param> /// <param name="tankX">The X Position</param> /// <param name="tankY">The Y position</param> /// <param name="game">Current games</param> /// <returns>explanation of return value</returns> public BattleTank(Opponent player, int tankX, int tankY, Gameplay game) { this.player = player; this.tankX = tankX; this.tankY = tankY; tankModel = player.GetTank(); currDurability = tankModel.GetTankArmour(); angle = 0; power = 25; curr_weapon = 0; plColour = player.GetColour(); tankBmp = tankModel.CreateBMP(plColour, angle); this.game = game; }
public BattleTank(GenericPlayer player, int tankX, int tankY, Game game) { //setting up the values we recieve to the variables in this class this.tPlayer = player; this.xCoord = tankX; this.yCoord = tankY; this.tGame = game; this.tPower = 25; this.tAngle = 0; this.tWeapon = 0; //creating a tank, getting color, setting angle and getting armour //seems like the order of things is very important //was failing tests coz of the null excpetion, took me couple of hours //to understand that it needs to be re-ordered. this.tTank = tPlayer.CreateTank(); this.tankBMP = tTank.CreateBMP(tPlayer.GetTankColour(), this.tAngle); this.health = tTank.GetArmour(); }
/// <summary> /// Modifies the sprite bitmap with teh angle /// Author Greyden Scott & Sean O'Connell October 2017 /// Written, edited and tested by both team members /// </summary> /// <param name="angle">The angle to passed</param> public void SetAngle(float angle) { this.angle = angle; tankBmp = tankModel.CreateBMP(plColour, angle); }