Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ypos=100
- xpos=200
- down=1
- right=1
- go=0
- y_speed = 0
- gravity = 0.98
- minusgravity = -0.98
- def setup():
- size(1500,500)
- noFill()
- strokeWeight(1)
- background('#000000')
- stroke(250,250,250)
- rect(175,75,1150,350)
- def draw():
- global ypos
- global xpos
- global down
- global right
- global go
- global gravity
- global minusgravity
- global y_speed
- if mousePressed == True:
- xpos=mouseX
- ypos=mouseY
- go= go + 1
- else:
- if down==1:
- ypos +=1
- else:
- ypos=ypos-1
- if right==1:
- xpos +=1
- else:
- xpos=xpos-1
- if ypos >=425:
- ypos += 1
- xpos = 200
- ypos = 100
- down = 1
- right = 1
- xspeed = random(-6, 10)
- yspeed = random(-6, 10)
- def setup():
- size(1500,500)
- xpos = width/2
- ypos = height/2
- noFill()
- stroke( random(255), random(255), random(255), random(255))
- strokeWeight(1)
- background('#000000')
- def draw():
- global xpos
- global ypos
- global down
- global right
- global xspeed
- global yspeed
- xpos = xpos + xspeed
- ypos = ypos + yspeed
- if xpos > 1325 or xpos < 175:
- xspeed = xspeed * -1
- if ypos > 425 or ypos < 75:
- yspeed = yspeed * -1
- if down==1:
- ypos +=3
- else:
- ypos = ypos - 4
- if right==1:
- xpos +=3
- else:
- xpos = xpos-4
- if ypos>=400:
- down=0
- elif ypos<=100:
- down=1
- if xpos>=1300:
- right=0
- elif xpos<=200:
- right=1
- rect(175,75,1150,350)
- if mousePressed == True:
- ellipse(xpos,ypos,50,50)
- else:
- rect(175,75,1150,350)
- background('#000000')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement