I am currently working on creating a function for my side scroller game in pyhton 3.2.3 and pygame that allows the main character to collect coins. What I am trying to do is when my character's postion is equal to the money's postition, the money disappears. Here is my code:
def drawMoney(x,y):
offset = 0 - guy[X]
guyPos = guy[X]+640
moneyPos = x
print(guyPos,moneyPos)
if lvlNum == level1:
money1 = screen.blit(money,(offset+x, y))
if guyPos == moneyPos or guy[Y] == y:
y = 10000
I am trying to make the money disappear by re-blitting the level picture but for some reason, this does not happen. I am not sure why but for some reason it is not working. Everything seems to be correct but am assuming that the guyPos never equals the moneyPos. Any help is appreciated.