class World:
pass
class Camera:
def __init__(self,x,y):
self.x = x
self.y = y
def follow(self,player):
self.player = player
def update(self,direction):
if direction == LEFT:
if self.x >0:
print "left here"
print self.x,self.player.x
if self.player.x > WINDOWWIDTH/2:
self.player.x -= min(self.player.x-WINDOWWIDTH/2,CAMERASPEED)
else:
self.x -= min(self.x,CAMERASPEED)
elif self.x == 0:
print "right here"
print self.x,self.player.x
if self.player.x >= 0:
self.player.x -= min(self.player.x,CAMERASPEED)