SHARE
TWEET

Untitled

a guest May 20th, 2019 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var x = 30;
  2. var y=0.5
  3. var wys =2
  4. var speed = 5;
  5. var gravity= 0.1
  6. var iks=5
  7.  
  8. function setup() {
  9.   createCanvas(800, 600);
  10. }
  11.  
  12.  
  13. function draw() {
  14.   background(220);
  15.   fill(255,0,0);
  16.   ellipse(x,y,50,50)
  17.  
  18.  
  19.   if (x>width-5)
  20.   {
  21.     console.log('s')
  22.     iks= -3
  23.   }
  24.  
  25.  
  26.  x=x+iks
  27.  
  28.     y = y + speed;
  29.  
  30.   speed = speed + gravity;
  31.  
  32.   if (y+200 > width) {
  33.    console.log ('wifth')
  34.     speed = speed * -0.70;
  35.     y = height;
  36.   }
  37. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top