I am trying to make a game where I need to change an Sprite with 6 frames with another one using a function.
In the beginning of the game the user needs to select which set of image he/she wants to use in the game.
Basically that's the idea:
function change image
if "animals" selected
change Sprite to animals
else if "blocks" selected
change Sprite to blocks
change Sprite to default.
The problem relies on the fact that I need to click on the Sprite image inside the function.
However, when I do what I show above it doesn't work because I don't want to duplicate the Code.
I just want to have the same code with different Sprite object.
Is it possible?