public void enemygun() { re[gunkey].bullet[0] = null; guner = new gun(re[gunkey].x, re[gunkey].y, 10); Paint += enemygundraw; re[gunkey].setbullet(guner); re[gunkey].bullet[0].gunmove(re[gunkey]); timer2.Dispose(); timer2.Start(); }
private void Form1_KeyDown(object sender, KeyEventArgs e) { if (e.KeyValue == (int)Keys.Space) { if (Cansqueeze) { re[0].bullet[0] = null; guner = new gun(re[0].x, re[0].y, 10); Paint += guncrative; re[0].setbullet(guner); re[0].bullet[0].gunmove(re[0]); timer.Dispose(); timer.Start(); Cansqueeze = false; } } re[0].movekeylistener(e); Refresh(); Application.DoEvents(); }