I am on windows 8, I use python 3.7 and I have a problem with pygame.
First of all, sorry for my poor english. I try to follow the essentials games v1 from magpi and I am trying to use the drop.py to test it, but when I run, it return me an error --> integer argument expected, got float
I am stuck on this line
if surface.get_at((player["x"], player["y"] + player["height"])) == (0, 0, 0, 255):
and this is the variable source
player = {
"x": int(windowWidth / 2),
"y": 0,
"height": 25,
"width": 10,
"vy": 5
}
I converted the player["x"] because i know pygame.surface.get_at expect an integer and not a float. But even if i convert the float value with the int() function, i still get this error.
Can you help me please, I tried to print the value to be sure it return an integer, and it does but I don't understand why i still get an error.
I searched on stackoverflow and none of the topic helped me on this problem. This is why I am asking for the first time on stackoverflow.
Thank you in advance for any answer.
update: I converted all my variable to integer inside my functions and the game work, but it seems hard coded for me. Did i do something wrong ?
if surface.get_at((int(player["x"]), int(player["y"]) + int(player["height"]))) == (0, 0, 0, 255):