Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #redSquare.py
- '''
- Created on Nov 6, 2012
- @author: pipsqueakery
- '''
- class redCubie:
- def __init__(self, xpos, ypos, mass = 1):
- self.x = xpos
- self.y = ypos
- self.dy, self.dx = 0, 0
- self.width, self.height = 10, 10
- self.mass = mass
- def _move(self, dx, dy):
- self.dx = dx
- self.dy = dy
- self.x += dx
- self.y += dy
- def move(self, desx, desy):
- if desx < self.x:
- self.x -= 1
- elif desx > self.x:
- self.x +=1
- elif desx == self.x:
- pass
- if desy < self.y:
- self.y -= 1
- elif desy > self.y:
- self.y += 1
- elif desy == self.y:
- pass
- def returnRect(self):
- return (self.x, self.y, self.width, self.height)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement