Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2014
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using Engine;
  7. using System.Windows.Forms;
  8.  
  9. namespace Colision
  10. {
  11. class Class1 : GameObject
  12. {
  13. //Initialize function
  14. public SmallBall()
  15. : base("Rect1", 128, 64, "RectHorizontal.png")
  16. {
  17.  
  18. }
  19.  
  20. public override void Update()
  21. {
  22. //Call base update
  23. base.Update();
  24. //press up arrow, move object up
  25. if (InputManager.IsPressed(Keys.Up))
  26. {
  27. Position.Y += 3;
  28. }
  29. if (InputManager.IsPressed(Keys.Down))
  30. {
  31. Position.Y -=3;
  32. }
  33. if (InputManager.IsPressed(Keys.Left))
  34. {
  35. Position.X += 3;
  36. }
  37. if (InputManager.IsPressed(Keys.Right))
  38. {
  39. Position.X -= 3;
  40. }
  41.  
  42. }
  43.  
  44. }
  45.  
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement