public CExplosion(int x, int y) { m_x = x; m_y = y; duration = CConstants.explodeTime; FBattleScreen.PlaySound("explode"); }
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"); }
public void SetDamage(short damage) { if (m_health < 0) { return; } m_health -= damage; if (m_health < 0) { m_health = 0; FBattleScreen.PlaySound("player_death"); } }
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)); } }
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); }
public void Draw(Graphics graph) { graph.DrawImage(CConstants.shell, FBattleScreen.GetRotatedRectangle(m_direction, CConstants.shellSize, m_x, m_y)); }