Advertisement
Guest User

Untitled

a guest
Oct 31st, 2014
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. Hero myHero;
  2.  
  3. void setup() {
  4. size(400,600);
  5.  
  6. myHero = new Hero();
  7. }
  8.  
  9. void draw() {
  10. background(255);
  11.  
  12. myHero.run();
  13. }
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20. class Hero {
  21. //GLOBAL VARIABLES
  22. int x = 75;
  23. int y = 50;
  24.  
  25. //CONSTRUCTOR
  26. /* hero(int _x, int _y) {
  27. x = _x;
  28. y = _y;
  29. }
  30. */
  31.  
  32.  
  33.  
  34.  
  35. //FUNCTIONS
  36. void run() {
  37. display();
  38. }
  39.  
  40. void display() {
  41. fill(0, 0, 255, 200);
  42. rectMode(CENTER);
  43. rect(mouseX, 570, x, y);
  44. }
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement