i am trying to make a Python "Sokoban" game using Pygame, i am having some trouble when it actually comes down to moving my player with Key_UP/Key_Down etc functions, i think i have the idea down but my code is not working because i am not too familiar with Pygame itself.
Any help would be much appreciated! :)
def moveSobRight():
x = maze.getCharAtPos(sob.getRow(), sob.getCol() + 1)
y = maze.getCharAtPos(sob.getRow(), sob.getCol() + 2)
print "x/y init works"
if x == "#":
print "You have hit a wall, you cannot move!"
elif x == " ":
print "This is a space!"
sob.moveRight()
maze.placeSob(sob.getChar(), sob.getRow(), sob.getCol())
maze.clearAtPos(sob.getRow(), sob.getCol()-1)
elif (x == "@" and y == " "):
print "You have collided with a sprout, the sprout will move away now"
crate.pushboxright()
maze.placeCrate(crate.getRow(), crate.getcol())
sob.moveRight()
maze.placeSob(sob.getChar(), sob.getRow(), sob.getCol())
maze.clearAtPos(sob.getRow(), sob.getCol()-1)
else:
pass