Pythonistapro777
Aug 06, 2015 - 04:07
I'm making a gravity guy game. Will be completed tomorrow, I hope. :)
Please help with the error that pops up when the code is run.
Thanks in advance!
Here's the code:
from scene import *
from random import random
class MyScene (Scene):
def setup(self):
self.x=70
self.y=224
self.g = 0.5 #gravity
self.acel = 0
self.grav = True
def draw(self):
background(0, 0.5, 1.0)
self.player=rect(self.x,self.y,32,32)
fill(0,0,0)
self.roof=rect(self.x-70,self.y+75,700,32)
self.floor=rect(self.x-70,self.y-75,700,32)
self.player.background=Color(1,1,1)
if not self.grav:
self.acel += 1
def touch_began(self, touch):
self.grav = not self.grav
def touch_moved(self, touch):
pass
def touch_ended(self, touch):
pass
run(MyScene())