예제 #1
0
 public CExplosion(int x, int y)
 {
     m_x      = x;
     m_y      = y;
     duration = CConstants.explodeTime;
     FBattleScreen.PlaySound("explode");
 }
예제 #2
0
 public CShell(int x, int y, int direction, int range, CTank owner)
 {
     m_x         = x;
     m_y         = y;
     m_direction = direction;
     m_range     = range;
     m_owner     = owner;
     FBattleScreen.PlaySound("shot");
 }
예제 #3
0
 public void SetDamage(short damage)
 {
     if (m_health < 0)
     {
         return;
     }
     m_health -= damage;
     if (m_health < 0)
     {
         m_health = 0;
         FBattleScreen.PlaySound("player_death");
     }
 }
예제 #4
0
 public void Draw(Graphics graph)
 {
     if (m_destroyed)
     {
         return;
     }
     if (!IsDead())
     {
         graph.DrawImage(m_base, FBattleScreen.GetRotatedRectangle(m_baseDirection, CConstants.tankSize, m_x, m_y));
         graph.DrawImage(m_turret, FBattleScreen.GetRotatedRectangle(m_turretDirection, CConstants.turretSize, m_x, m_y));
     }
     else
     {
         graph.DrawImage(CConstants.wrecked, FBattleScreen.GetRotatedRectangle(m_baseDirection, CConstants.tankSize, m_x, m_y));
     }
 }
예제 #5
0
        private void bNext_Click(object sender, EventArgs e)
        {
            if (tanks.Count < 2)
            {
                MessageBox.Show("Not enough players (minimum 2)");
                return;
            }
            FBattleScreen frm2 = new FBattleScreen();

            Directory.CreateDirectory("tmp");
            for (int i = 0; i < tanks.Count; i++)
            {
                File.Copy(tanks[i].GetDLL(), "tmp/tempDLL" + Convert.ToString(i) + ".dll", true);
                frm2.NewTank("tmp/tempDLL" + Convert.ToString(i) + ".dll", tanks[i].GetImage());
            }
            this.Hide();
            frm2.ShowDialog(this);
            Directory.Delete("tmp", true);
        }
예제 #6
0
 public void Draw(Graphics graph)
 {
     graph.DrawImage(CConstants.shell, FBattleScreen.GetRotatedRectangle(m_direction, CConstants.shellSize, m_x, m_y));
 }