Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(+1)

Devlog 2. 7/23


A busy day. I tried to familiarize myself with Godot 4 as much as I could, but as stated previously my skill level isn't quite high enough to do much with it. Yet.

For now, I have downloaded assets largely from opengameart.org - their collection of assets is quite high and will serve my needs until I can make some more bespoke solutions. I set about importing my assets into Godot and I began properly. Setting up the player wasn't too hard, and some information from my very limited time working with Unity actually came in handy - how the sprite is a combination of a hitbox, a 2d node, and a character node. Very quickly I was able to produce the most rudimentary beginnings of a game. 


Not terribly riveting stuff yet.

 The asteroid has a rudimentary collission and while the main tutorial did not go into the mouse look yet, I simply googled answers and slapped some code in that seems to have worked. I did work about 50% through GDQuest a while ago, and I remembered some stuff from that and pulled out my notes. Linear extrapolations being called lerps still makes me chuckle a little. 

Now that I had a ship that moved, the next step was firing a weapon. Once again, the main tutorial is more inclined to teach me things like best practices and a more step-by-step basis to creating a game, but since I was eager I simply used some of the tutorials in my saved playlist. 

I am not moving the ship while I fire. Kind of amusing actually, you could probably make a game about a terrible ship that can only move by firing its gun.

I had an inkling of a reason why it was doing this - the bullets were colliding with the ships hit box, and there was no delay on bullets coming out so it was like a fire hose.

Here's some of the code I used, mostly cannibalized from many other online places. I created a Cooldown node and assigned it a value, and imported it in the main scene. I then created a variable version of it called cooldownTimer, and added an And statement to check when its done - it will only fire while it is available to start. 

Some fun I had here as well - a lot of older Godot tutorials for 3.0 reference instances. In 4.0, instance was renamed to instantiate. Food for thought. Some parts of the code are still going over my head, but I know it works. I created another 2d node on the ship and moved it towards the front of the ship where the main gun is, and saved it as a tscn file. Then, I could reference it in this document as the source of bullets, avoiding my hitbox entirely. The next few lines I'm still not entirely sure about, but this is probably in case the projectile being fired isn't a sphere and would thus keep it at the same rotation as the players ship, so they're not firing sideways lasers. I'm still not 100% sure about get_tree. I believe what its doing is that, since the bullet doesn't exist in the instance off to the side, it has to add it to the list of nodes? Finally, the code block ends with a call to re-start the timer. 


Thats more like it, though the bullets kind of plink off the asteroid and look weird. Continuining with my diving, I realized I'd have to set up a few statements and groups, that if the bullets collide with a hitbox, they are to be destroyed via queue_free(). I also wanted a quick animation for when they collide and are destroyed.

I can work out quirks like speeding up frames later, but for now? This is working. Although, its kind of boring that the ship doesn't have a camera following it, and that its floating in a grey void, no? I thought so at least, so I set about to fix that. What I honestly thought was going to be a difficult challenge rife with dozens of lines of code was actually one of the easiest things I've done. Just add a camera node to the parent of the ship and voila, thats it. The backdrop wasn't difficult either, but its not quite tiling to a degree I want. I'll have to figure that out later, as its a very minor concern for now.


Side note - Gifs are really hard to work with. This 15 FPS gif had to be reduced in size significantly just to fit under 3mb, and I could still only capture a few seconds worth!

With a backdrop and working camera, I can safely say I feel productive today (though I am sure there are people out there who are already steaming ahead with a lot more!). 

With a functioning ship, camera, and obstacles, my MVP list now has the following remaining:

  • Creating of an enemy ship, with a very basic AI that is designed to follow the player and shoot.
  • HP values for both the player and enemy, and a destroy function for both if they take too much damage.
  • A victory or lose condition that then applies a screen for game over. 

I have some faint ideas about the enemy ship - I know I can easily replicate the player ship, swap over some of the nodes for the gun, and swap out the bullet color for enemy bullet colors. Making it follow the player but not get too close might be trickier. Dumber enemies would fire slowly and not update the players position as often as stronger enemies, who would fire faster and track more aggressively. 

I've set some goals for the upcoming week - as I am entering a work week, I will not have as much time to devote as I do the weekends. I'd like to ideally have enemies figure out by the weekend, with a bonus towards a game over screen for either a loss or a win. With those elements, I could then work on additionals that go above the MVP list : Multiple levels, more complex behaviors like enemies warping in, longer levels, the whole nine yards. I could even add in particle effects and lighting effects to really take things to 110%!

Signing off for the night.