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

More customization for enemy:immobilize() #1079

Open Diarandor opened 7 years ago

Diarandor commented 7 years ago

More customization for enemy:immobilize(). The best option is to use a table parameter: enemy:immobilize(properties_table)

1) Add "time" parameter to enemy:immobilize(), like this: enemy:immobilize({time = ...}), where "time" is the time duration in milliseconds.

2) Add an optional callback that will be called when the enemy stops being immobilized: enemy:immobilize({callback = function() ... end}) If that callback exists, the enemy will not be restarted, and the callback function will be called instead.

3) Do not play immobilized sound automatically. We may need different sounds, for instance, if the enemy is being pushed by the custom shield (if the hero shield collides with a sword of the enemy, etc).