Advertisement
Krystman

AIB2017 - First Ball Example

Feb 7th, 2017
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.86 KB | None | 0 0
  1. int myVar;
  2. int myVar2;
  3.  
  4. int pee;
  5. int poo;
  6.  
  7. void setup() {
  8.   // I am inside the setup function
  9.  
  10.   // This changes the size of the Screen
  11.   size(800,600);
  12.  
  13.   // This changes the... framerate
  14.   frameRate(60);
  15.  
  16.   // This changes the background
  17.   background(255,0,255);
  18.  
  19.   pee = 10;
  20.   poo = 10;
  21. }
  22.  
  23. void draw() {
  24.   background(191,54,193);
  25.   // I am inside the draw function
  26.  
  27.   myVar = myVar + pee;
  28.   myVar2 = myVar2 + poo;
  29.  
  30.   // if circle reaches the right side of the screen
  31.   // make it go left
  32.   if (myVar > 800) {
  33.     pee = -10;
  34.   }
  35.  
  36.   // if circle reaches the left side of the screen
  37.   // make it go right
  38.   if (myVar < 0) {
  39.     pee = 10;
  40.   }
  41.   if (myVar2 < 0) {
  42.     poo = 10;
  43.   }
  44.   if (myVar2 > 600) {
  45.     poo = -10;
  46.   }
  47.  
  48.   ellipse(myVar,myVar2,100,100);
  49. }
  50.  
  51. void potatoes() {
  52.   // I am inside the draw function
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement