solarus-games / solarus

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

Add more methods to customize sprites of hero #793

Open Diarandor opened 8 years ago

Diarandor commented 8 years ago

I think that the hero should be at least as customizable as custom entities (the more, the better), since it is the most important entity in the game. And since there is only one entity of this type that will not affect to the speed of the game.

An important improvement would be to allow adding sprites to the hero (and also some functions to get the buit-in sprites (we would need the name of these to get them), as in this request: https://github.com/christopho/solarus/issues/669). We would need these methods: hero:create_sprite(sprite_name) hero:remove_sprite(sprite_name) hero:get_sprite(sprite_name)

For instance, with hero:get_sprite("shadow") we would be able to change the animation of the shadow (during a jump). With hero:create_sprite(sprite) we could easily create more customizable entities like the built-in shield (and several other sprites at the same time). We could also add an electricity sprite for when the hero is hit by electricity or other state changes of the hero (like poison, etc).

Also, we should be able to choose the order to draw the sprites of the hero (a shadow-like sprite would be drawn under the hero, but a magic hat or cloak should be drawn above the hero). So we will need some methods to get/set the order of drawing.

Maybe we should split this request in several ones, since there are lots of requested functions.

wrightmat commented 8 years ago

For the record, state changes of the hero that you mentioned are possible with the current engine - I do so in my game. Maybe there are aspects of this system that you have in mind, that I haven't considered, and you need these functions for.