Yesterday, after a few days of just fucking around, I finally got to work on making my game. The very first thing I wanted to do what to make something the original game didn't have; a background. After all, flying around in space can be pretty dull when you're apparently flying in a huge void emptiness with nothing going on. So I decided that I would give the background a few moving stars, at least for the splash and menu screens.
Of course the first thing I needed to do was actually make the stars appear on screen. First, I made 3 tiny squares and clumped them together into a single image that the game would extract the individual stars from. To make sure everything worked as I wanted it to, I started off by just making the 3 stars appear in set positions.
The star sheet.
The stars appearing on the screen. Note that the largest star was later removed and replaced with a tiny 2x2 one.
Next, I made the stars move across the screen, first at the same speed, then with each given a different speed. There was an issue where the stars would appear to "stretch" because I forgot to fill the screen each time the game updated, but that was quickly resolved.
The stars moving across the screen, with and without the "stretching"
Finally, the fun part. I made a List of Sprites and filled it with 10 stars, each with 1 of the 3 given sizes and a random position on the screen. Then, I made the stars move across the screen with speeds depending on the size(or in this case how far away the star appears to be). Finally, when a star moves off of the screen, the star is removed from the List, and replaced with a brand new one of varying size on the other side.
Final result. It looks a lot cooler when it's moving.
Now the game has a neat little moving star background! As of yet, that's all the game has, but it's still really nice to look at. If you want to try out the game yourself, you can get it here. Just unzip the folder and double-click the .jar file. If you do try it out, let me know what you think. I'd really appreciate it.
Until next time~
Of course the first thing I needed to do was actually make the stars appear on screen. First, I made 3 tiny squares and clumped them together into a single image that the game would extract the individual stars from. To make sure everything worked as I wanted it to, I started off by just making the 3 stars appear in set positions.
The star sheet.
The stars appearing on the screen. Note that the largest star was later removed and replaced with a tiny 2x2 one.
Next, I made the stars move across the screen, first at the same speed, then with each given a different speed. There was an issue where the stars would appear to "stretch" because I forgot to fill the screen each time the game updated, but that was quickly resolved.
The stars moving across the screen, with and without the "stretching"
Finally, the fun part. I made a List of Sprites and filled it with 10 stars, each with 1 of the 3 given sizes and a random position on the screen. Then, I made the stars move across the screen with speeds depending on the size(or in this case how far away the star appears to be). Finally, when a star moves off of the screen, the star is removed from the List, and replaced with a brand new one of varying size on the other side.
Final result. It looks a lot cooler when it's moving.
Now the game has a neat little moving star background! As of yet, that's all the game has, but it's still really nice to look at. If you want to try out the game yourself, you can get it here. Just unzip the folder and double-click the .jar file. If you do try it out, let me know what you think. I'd really appreciate it.
Until next time~