i am making a game and i need to be able to sense if a character is touching a tree or not and i can't because the tree is part of the background.
i've already tried using x and y co-ordinates but the trees aren't in a specific clump so this doesn't work. i also tried using a piece of code - look below - that detects if something is touching something else, however, the thing has to be defined and i can't define the tree.
def tree():
tree = #brown
if sprite_x < 0 + sprite_width and sprite_x + tree_width > 0 and sprite_y < 0 + sprite_height and sprite_height + sprite_y > tree_height :
#do stuff
i expect the code to sense if the character is touching a brown colour (the tree) and to allow me to use that output.