[Solved] Maybe I need use TimeDelta for my enemy movement?

Hello,

I’m trying to make a movement for my Enemy. It just fly doing a circle:

The problem is: when the game freezes my enemy starts to get into the wrong positions. Even when I start a phase they are not in the correct positions.
My guess is that I need to put TimeDelta somewhere, but I don’t know how to use it. And I’m not sure that’s the solution either… :thinking:

Thanks!

Hello!

I ask to me a question: why your game should freeze, as you say?

Xierra

Hello, Amigo54,

Sometimes it freezes when I change the size of the preview window or when I have a lot of things openned on the computer (my computer is very weak). And now knowing that by giving these freezes it can alter my enemy’s movement in the game I would like to try to avoid this, as it could completely spoil the player’s experience with completely altered phases.

Have you tried using the ellipse movement extension?
https://wiki.gdevelop.io/gdevelop5/extensions/ellipse-movement/

Thanks, davy, but I tested and I have some problem with this extension.

If I use the action “turn left” or “turn the other way” my enemy is repositioned about +1000 x I don’t know why. Look the events:

The curious thing is that this doesn’t happen if I change directly in the behavior within the object.

And if I want the another instances of my enemy to rotate in a different radius but at the same speed, I’ll need to manually calculate the difference, correct?

Anyway, I would be very grateful if someone explained to me about TimeDelta() using my example (if it really need the implementation of timedelta). That way I would be able to know when to use it in my game another times.

If you want to move backward, you should set a negative speed. Turning left or right will change the rotation center.

Thanks, davy

I think I was able to solve my code by inserting TimeDelta(). I will still do more tests, but in principle everything is correct.