for my mobile project i want my ship to always fly forward of a constant value,that then will be modified by events during gameplay.
the movements are driven by the mouse,simply offsetting the frontal part of the ship you can go anywhere.
what i’m looking for is the most elegant,cheaper way to implement this.
trying to avoid tick,but i need precision and the system must be versatile
any suggestion?
thanks!
Tick’s your best bet, but if it’s not a focal point you could move it on a timer instead. Move it every 0.033 seconds to move it at 30fps instead of every Tick (assuming you’re running your game at 60). This will free up some performance for other things if you really need it. Simple translation really isn’t performance intensive though so Tick is almost assuredly fine.
If it’s really a “2d arcade” style movement, I would absolutely use Tick for this.
Tick has a delta-time value, so you offset the position with delta-time times your current velocity. That way, movement will be smooth.