Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2014
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 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, "Pad1.png")
  16. {
  17.  
  18. }
  19.  
  20. //Place the paddle
  21. Pad1.Position.X = 971;
  22. Pad1.Position.Y = 384;
  23.  
  24. public override void Update()
  25. {
  26. //Call base update
  27. base.Update();
  28. //press up arrow, move object up
  29. if (InputManager.IsPressed(Keys.Up))
  30. {
  31. Position.Y += 3;
  32. }
  33. if (InputManager.IsPressed(Keys.Down))
  34. {
  35. Position.Y -=3;
  36. }
  37. if (InputManager.IsPressed(Keys.Right))
  38. {
  39. Rotation.X += 3;
  40. }
  41. if (InputManager.IsPressed(Keys.Left))
  42. {
  43. Rotation.X -= 3;
  44. }
  45.  
  46. }
  47. }
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement