Best practice for player states

Hello!

I am rather new to Corona, so please excuse if this is a silly question. I searched the forum already, but didn´t find an answer.

I would like to know, what is the best practive to change the player states after certain events, like player normal, player jumping, player flying, player died, etc.

I found no way to change the image of an object i created with display.newImage.

So in case of an event, where i need a different player image, should i:

a. delete the object and create a new one at the same place, or
b. load all state images at the beginning with display.newimage, put them all into a group, and set them all to isVisible=false, except actual state, or
c. use sprites and change the index of the sprite in case of a status change?

i hope i could explain what i mean.

Thank you,

Peter [import]uid: 50619 topic_id: 9120 reply_id: 309120[/import]

The best way to handle this is by using spritesheets.
Have a look at the documentation regarding spritesheets. [import]uid: 51516 topic_id: 9120 reply_id: 33239[/import]

HI seth.dev.ios,

Ah ok, thanks a lot for you answer.

Greets, Peter [import]uid: 50619 topic_id: 9120 reply_id: 33241[/import]