private void frmAdvancedProgrammingExtras2_MouseClick(object sender, MouseEventArgs e) { if (bullet.image.Visible == false) { tmrHeroBullet.Enabled = true; bullet.image.Visible = true; bullet.centerOn(hero); bullet.redraw(); axWindowsMediaPlayer1.URL = directory + SOUND_HERO_BULLET; axWindowsMediaPlayer1.Ctlcontrols.play(); } }
private void tmrHero_Tick(object sender, EventArgs e) { hero.move(); for (int i = 0; i < walls.Length; i++) { if (hero.isColliding(walls[i])) { hero.stickTo(walls[i]); } } hero.redraw(); }