Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2014
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 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.Drawing;
  8. using System.Windows.Forms;
  9.  
  10. namespace Nolan_s_Pong_Game
  11. {
  12. class Pad1
  13. {
  14. //Initialize function
  15. public Pad1() : base("Pad1", 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.Right))
  34. {
  35. Rotation.X += 3;
  36. }
  37. if (InputManager.IsPressed(Keys.Left))
  38. {
  39. Rotation.X -= 3;
  40. }
  41.  
  42. }
  43. }
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement