Reflex – Dev Diary 27

This week I have continued implementing the laser turret that is required for World 4. My initial thoughts were to use a series of lerps (smooth motions using the built in lerp command), the problem with the lerp command is that it only applies ease control for the destination. So, you get the movement slow to a stop when it reaches it’s destination, but not when it starts moving.

So instead I turned to an extension for GMS (TweenGMS), this has all the usual tween settings such as EaseInOut, etc. To add these into the game I had to add in a series of flags that would allow me to trigger a tween motion, wait for it to finish and then trigger another. Likewise, when a missile enters the vision cone for the turret the tween would be stopped and a new one would be used to track the angle to the missile. Once that had completed and the missile had been told to explode a final tween was set up to guide the turret back to the start position so the whole process could start again.

It certainly took some doing but it is working nicely. At the moment, however, there is no real feedback other than the missile exploding. My next step is to display laser lines to the missile so the player can tell it was destroyed by the turret.