Star Generation



Star generation is made up of two star sprites and an Area2D node. Basically we use the Area2D node to get a spawn area, and within that we pick a random spot and then spawn a star there.

For a nicer effect, we give the stars a random scale and opacity. It adds a little depth to the whole thing.

In our game jam version, we were hard coding values in the code and doing a random range within those values to pick a spot, so this way is much cleaner.




We apply the same technique to how we generate our asteroids. In most cases the spawn area is the same size as what we do for our star generation, but on the instructions screen we wanted a smaller area of asteroids for the player to practice on. So we just adjust the size of the spawn area for this particular case and away we go.

Here's a snippet of how getting the spawn point works:


You can see the full project up on Codeberg here.

--

Love open source projects? Here are ways you can support us making them!

https://wanderingdoorgames.obviousgain.ca/supportUs

Get Satellite Bash

Download NowName your own price

Leave a comment

Log in with itch.io to leave a comment.