Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Devlog 12, 8/3

Today was spent working on the systems for defining the ability for a homing missile. Since I have an understanding of movement on Enemy scripts to the player, I should have most of the script already done. Only one problem with that though - the enemy always knows where the player is! This is because I defined player movement in the Globals script as a Vector2. Its trivial to create movement to the player, and even enemy homing shots, because the players direction is so precisely known.

It is significantly harder to do this for the enemies.

Enemies aren't defined in the global variable and... wait, why can't I do that? Why not just import the enemy TSCN into the globals script as a variable and reference it as enemy_pos.vector2? Well, it doesn't work. A globals script cannot call itself, it seems. I'm instancing the enemies in the first level script but this script has no way to be referenced outside of its script. I have a master level scene and script set up to transfer the most basic stuff to each level - this includes the player itself, the UI, and some basic nodes for enemy and projectile cleanup. I just realized though, since all my enemies always spawn in the Enemies blank node, I could use a signal to check when things enter the tree/node ...

Devlog out!