solarus-games / solarus

This repository was moved to GitLab: https://gitlab.com/solarus-games/solarus
http://www.solarus-games.org
Other
712 stars 134 forks source link

Request: allow to add/remove sprites to the hero #852

Open Diarandor opened 8 years ago

Diarandor commented 8 years ago

Allow to add/remove sprites to the hero (or even for any entity if you agree). We could keep the syntax used for custom entities, that is:

hero:create_sprite(animation_set_id, [sprite_name])
hero:remove_sprite([sprite])

Curiosity: In some games (like the original megaman of the NES) the hero consisted of several sprites (because there was a limitation of max number of colors per sprite, which is not our case).

Important remarks: In our case, we could use these functions to split the tunic in different pieces, one for each clothing (shirt, trousers, cloak, hat, etc), which allow to make a lot of combinations with just a few sprites without need to combine each clothing with the rest of clothes (which would be less of drawing work for the artists sine each clothing would be in a different sprite). We could also add extra sprites to the hero for other uses: poison/electrifity effects (for poisoned/paralyzed states), etc.

However, it will be convenient to have functions to interchange the drawing order of the sprites (something like this https://github.com/christopho/solarus/issues/809), and also functions to set the drawing order of the sprite immediately before/after a given sprite of the same context (the context would be the entity containing the sprites, or the map otherwise).

What do you think?

ghost commented 8 years ago

The default "engine awareness" should remain for a single tunic, in my opinion. Having several is too complicated, and I don't think it is very common with the NES/SNES/GBA-era ARPGs. So if someone wants to do something so sophisticated as this, I think they should probably be prepared to do the relevant coding themselves.

We should however make it easier to use several sprites. One idea I have is that maybe we can use tunics kind of like tilesets, so that we can select patterns on the tunic -- "this is the bottom part (trousers), this is the top part (jacket)", etc.

And it should in general be simpler to override built-in assumptions -- but this is true for all of Solarus.