Homing Rocket in 2 lines [Game Maker | Basics] @1upIndie
Homing Rocket in 2 lines [Game Maker | Basics]  @1upIndie
Uploaded August 2023 | Updated September 2026, 7 hours ago
This basics video tutorial shows you how homing can work in GameMaker Studio with 2 lines of code. There will be a follow up video on a homing rocket barrage like you see in games like Armored Core, but the cheap man's 2D version.

I got the inspiration from Ellaris who is a discord member, so thanks for the idea buddy! The 2 lines are very easy to do and work more or less but are a building block to advance this concept.

First we need to create the rocket and give it an inital speed, direction and angle to start of with and gradually change the flying direction.

So what are those 2 lines? Well, we add constantly in the step event of each rocket to it a value that gradually ("delayed") turns towards it's target position. For that we need the current direction of the rocket and the perfect direction from the rocket to the target (which we get by the rocket's x,y and the targets x,y and get it by point direction). Then we get the resulting angle difference and use sign to clamp the result to 0,1,-1. That added to the current direction turns the rocket towards the the target, but we can use a fixed value to increase/decrease the turning around speed to our liking. Then we set the new direction to the image angle so that visuall it looks sound aswell. That's it!

The code if found as usual in the comment section.


🚧 For the future: There will be follow up video that shows how to visually advance this core setup to an homing missile barrage

πŸ‘‘ Support me and get fresh game art and game maker projects every month:
patreon.com/1upindie

Follow me on:
πŸ“Έ Instangram: instagram.com/1upindie
🐦 Twitter: twitter.com/1upIndie
πŸ’¬ Discord: discord.gg/gvr98nb
πŸ“œ Udemy: udemy.com/course/become-a-video-game-developer-with-gms-23 (See youtube about page for discount)

CHAPTERS
-------------------------------------------------------------------------------------------------------
0:00 What we will do
0:59 Specific hit animation (elemental, weapon etc.)
1:11 The 2 lines that steer the rocket
2:28 When the rocket hits an enemy
2:45 Player setup, input and spawning a rocket
5:13 What the 2 lines mean in detail
Homing Rocket in 2 lines [Game Maker | Basics]Xp and popUp system [#11 Vampire Survivors Remake in GameMaker ]Bitmap/Sprite fonts - How to use [Game Maker | Basics]Wall bouncer -  [Game Maker Studio 2 | Enemy Ai]Steam capsule art, what is there to know? [Marketing for Indie developers]Access data structures + arrays [Game Maker | Basics]Dead Cells style fog - The easy way [GameMaker | Vfx]GamerMaker 2023 [explained]  - quick and dirtyDraw things on top each other - Depth sorting [Game Maker | Basics]Gradient water/sea background - The easy way [GameMaker | Vfx]Gravity Storm under the hood [game design, make in GameMaker]Weapon damage [#7 Vampire Survivors Remake in GameMaker ]
1up Indie |

Homing Rocket in 2 lines [Game Maker | Basics]

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER