I have a game and I need to know what colour is under the player's feet but when I use surf.get_at_(x, y)
, it gives me white instead of blue or green.
Any help would be appreciated, Thanks!
I have a game and I need to know what colour is under the player's feet but when I use surf.get_at_(x, y)
, it gives me white instead of blue or green.
Any help would be appreciated, Thanks!
The argument for get_at()
must be a tuple with the coordinate pair. See to documentation of pygame.Surface.get_at
:
get the color value at a single pixel
get_at((x, y)) -> Color
Use a tuple with the coordinates instead of two separate arguments:
surf.get_at_(x, y)
surf.get_at_((x, y))