예제 #1
0
 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();
     }
 }
예제 #2
0
 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();
 }