/// <summary> /// updates the cannon /// </summary> /// <seealso cref="Cannon.Update"/> private void CannonUpdate() { //attempts to shoot cannon if player has bullets is pressing left click and can cantrolle shooting Cannon.Active = Mouse.GetState().LeftButton == ButtonState.Pressed && canControlShooting && GameScene.AreAnyBulletsLeft(); //updates cannon with mouse position Cannon.Update(BasePosition, BaseRotation, Tools.TrueMousePos); }
/// <summary> /// assigns new cannon to player cannon /// </summary> /// <param name="newCannon">The new cannon.</param> public void TakeCannon(Cannon newCannon) { //assigns given cannon to player cannon (updates it right away so it doesnt draw in the worng spot) Cannon = newCannon; Cannon.Update(BasePosition, BaseRotation, Tools.TrueMousePos); }
/// <summary> /// moves the tank towards teh target /// </summary> /// <param name="target">what the tank moves towards</param> /// <returns>true if this tank is dead and done exploding, false otherwise</returns> public virtual bool Update(Vector2 target) { //call cannon update Cannon.Update(BasePosition, BaseRotation, target); return(UpdateBaseAndHealthBar(target)); }