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).
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).