Advertisement
DashWaLLker

Animations

Mar 29th, 2016
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.62 KB | None | 0 0
  1. //----------IN THE FORM----------
  2.  
  3. timer animations = new timer();
  4. t.Interval = 100; //TO BE ADJUSTED
  5. int animCount; //universal?
  6.  
  7. animCount = 0;
  8.  
  9. animations_tick()
  10. {
  11.     animCount++;
  12. }
  13.  
  14.  
  15.  
  16. //----------IN THE OBJECT----------
  17.  
  18. public void Draw(g, animnimCount)
  19. {
  20.     switch (animCount % anims)
  21.     {
  22.         default: g.DrawImage(Properties.Resources.playerShip_anim0); break;
  23.         case 1: g.DrawImage(Properties.Resources.playerShip_anim1); break;
  24.         case 2: g.DrawImage(Properties.Resources.playerShip_anim2); break;
  25.         case 3: g.DrawImage(Properties.Resources.playerShip_anim3); break;
  26.     }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement