Example #1
0
        private void Gm_PlayerPlayed(object sender, PlayerPlayedEventArgs e)
        {
            AnimatedTank at = Tanks.GetTank(e.Tank);

            if (at != null)
            {
                at.SetAction(e.PlayerAction);
            }
        }
Example #2
0
 private void DrawRotatedTank(AnimatedTank aTank, Color color)
 {
     if (!aTank.IsAlive)
     {
         return;
     }
     GL.LoadIdentity();
     Spritebatch.Begin(this.Width, this.Height);
     GL.Rotate(aTank.Angle, Vector3d.UnitZ);
     Spritebatch.Draw(tank, (aTank.PhisicalPosition - new Vector2(Width / 2, Height / 2) + new Vector2(25, 25)).Rotate(-aTank.Angle) + new Vector2(-25, -25), new Vector2(1f, 1f), color, new Vector2(0, 0));
 }
Example #3
0
 public MyGame(int width, int height, IPlayer player1, IPlayer player2) : base(width, height)
 {
     GL.Enable(EnableCap.Texture2D);
     MyInput.Initialise(this);
     gm = new GameManager.GameManager(player1, player2, 24, 9);
     gm.PlayerPlayed += Gm_PlayerPlayed;
     redTank1         = new AnimatedTank(gm.redTank1, gm.map, 0, TankColor.Red);
     Tanks.Add(redTank1);
     redTank2 = new AnimatedTank(gm.redTank2, gm.map, 0, TankColor.Red);
     Tanks.Add(redTank2);
     blueTank1 = new AnimatedTank(gm.blueTank1, gm.map, 180, TankColor.Blue);
     Tanks.Add(blueTank1);
     blueTank2 = new AnimatedTank(gm.blueTank2, gm.map, 180, TankColor.Blue);
     Tanks.Add(blueTank2);
     //gm.Play();
 }
Example #4
0
 public static void Add(AnimatedTank aTank)
 {
     tanks.Add(aTank);
 }