Dec-28-2019, 08:51 PM
I think your problem is actually here:
It's just if you push a key the screen moves. But if there is a block in the way then you don't want that to happen.
def moveLeft(self): self.xVel = 6 <-------- Check for collision then move if there is none. If there is, self.xVel = 0 def moveRight(self): self.xVel = -6
It's just if you push a key the screen moves. But if there is a block in the way then you don't want that to happen.