Advertisement
Guest User

Untitled

a guest
Apr 25th, 2018
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. float nz = 93.99;
  2. float ire = 89.11;
  3. float eng = 86.11;
  4. float aus = 85.49;
  5. float sco = 83.83;
  6. float sa = 83.81;
  7. float wa = 83.41;
  8. float fra = 79.10;
  9.  
  10. float x = 20;
  11. float y = 20;
  12. float xDelta = 1;
  13.  
  14.  
  15. //create picture shere
  16. PImage nzImage;
  17. PImage ireImage;
  18. PImage engImage;
  19.  
  20. int offset = 50;
  21.  
  22.  
  23. void setup()
  24. {
  25. size(800,800);
  26.  
  27. //load all pictures here
  28. nzImage = loadImage("nzImage.jpg");
  29. ireImage = loadImage("ireImage.jpg");
  30.  
  31.  
  32. }
  33.  
  34. void draw()
  35. {
  36. background(0);
  37.  
  38.  
  39. //create objects here
  40. createObject(x,y, nz,nz, nzImage); //new zealand
  41. x = x + xDelta;
  42.  
  43. if((x > width -60) || (x< 10)) {
  44. xDelta = -xDelta;
  45. }
  46. createObject(100,100,ire, ire, ireImage); //ireland
  47.  
  48.  
  49.  
  50. }
  51.  
  52.  
  53. void createObject(int x, int y, float a_width, float a_height, PImage img)
  54. {
  55.  
  56. rect(x + offset, y + offset, a_width, a_height);
  57. image(img,x + offset, y + offset, a_width, a_height);
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement