Solarus-Games English Forum

Solarus => Development => Topic started by: MetalZelda on January 15, 2016, 08:02:12 PM

Title: Pause an entity movement ?
Post by: MetalZelda on January 15, 2016, 08:02:12 PM
Hi.

Is there any way to pause every entities on the map that have movement ?

For example, if I interact with a custom entity, all entities in the map still moves while I want them to be suspended.
It could be useful if there is a entity:set_paused() function, or is there any way to do it ?
Title: Re: Pause an entity movement ?
Post by: Christopho on January 15, 2016, 09:00:41 PM
Not directly. You would have to start a dialog or to pause the game. Maybe you can change your pause menu so that it does not always open when the game gets paused.
We should probably open a feature request for a game:set_suspended() function.
Title: Re: Pause an entity movement ?
Post by: MetalZelda on January 15, 2016, 09:14:13 PM
Hmmm, my question wasn't really precise, my question was about freezing all entities movement without pausing the whole map / game (example : hero can still move)
Title: Re: Pause an entity movement ?
Post by: Diarandor on January 15, 2016, 09:24:02 PM
I think that requesting a new function with the syntax enemy:freeze/unfreeze(), or enemy:set_frozen(boolean) would be the best, if Christopho agrees. This is perfect to paralize enemies with electricity or ice. (Stopping all timers and changing animations with some custom function and later calling enemy:restart() might be necessary for that event, but this is off-topic.)