Spaceship Game
- 11 Devlogs
- 26 Total hours
I changed how the asteroids spawn on the screen. It used to be they just spawn in a random place with a random angle and random speed (all with relevant parameters). Now they spawn at a set x but still the same random y, speed and angle and they spawn one at a time with intervals that change depending on the level. This did make the levels easier so I will be adding harder ones in the future
Well something happened with my last devlog and it just didn’t post it seems so this one covers me fixing the UI in garage and adding a new upgrade; fireRate. I change the way you shoot lasers. It is no longer click to shoot, you have to hold space and there is an interval between laser shots that gets reduced when you shoot. I was right though with the garage, I made zero changes to garage to make the new upgrade. Also finally added a way to get infinite money to make it easier for me to test.
Ok I was wrong the rest has not been “more relaxing”. I knew I would have to optimise the code in garage but I didn’t know it would take so much effort. I combined the three upgrade states into one function that uses the screen name as the key to each section of the library to get the needed information. I also spent ages on a for loop to make blocks for each upgrade so adding them should be easier. The event handle function also works for every upgrade no more piles of if statements. Now I will be focusing on fixing the UI and adding upgrades.
Upgrades finally work now so the rest should be more relaxing. I had to change all my vars into dictionaries so I could use them in the garage file without any circles. I then just added them into the handle events in a load of if statements which may not be the most optimal but I am lazy. Finally beat level 3 with max upgrades. Getting harder to test now so I might have to do something about that.
Spent absolutely forever making the garage look better and made it capable to be updated with more upgrades. As of now I have the code sorted in garage and I like the design but it needs a lot of work still.
Made buttons look cooler by fixing the colouring and making them slightly smaller when mouse is hovering over. Added a coins system that adds either 100, 200 or 500 for beating level 1, 2 or 3 and a fifth for losing. Still need to add some upgrades and make the game just look better
Ok I did what I said I was too lazy to do, I put each screen into its own file in a different folder inside the main one. Basically just copied the new functions I made over and I changed the way a new state is called slightly. now main looks very clean I got rid of a lot of functions just to write them again because I got confused. Turns out I didn’t need a whole function. Game finally works again now and hopefully I can just start adding features now.
I have finally fixed all the functions and the layout of the code, game more or less works, need to finalise levels, update screens, and add more to the garage(upgrades). But I am now thinking cause the game is getting much bigger I could have different files for each screen, I probably should do that but I am too lazy.
Fixed collision with the laser and asteroid so it detects the full laser polygon. I then realised I need to completely change the layout of my game again. So I deleted the whole running loop and put in what the layout should be. Now I am in the process of getting all the functions right which will take a while.
the asteroids movement is better now I think, they move left to right with an allowance of 40 degrees up or down. Asteroids can now be shot by laser but only if the back coordinates intersect with the circles of the asteroids. Text displays the level, health and number of asteroids left now.
Ok so I have been very busy with stardance problems so I was just coding when I could. I didn’t want to make a devlog till I had the general game started. I will be working on this game for quite some time and will keep improving the game. So far I have made a spaceship class and a spaceship that can fly and speeds up to a maximum speed and bounces of the walls. I have another asteroid class, there is an x amount of asteroids that fly around the screen from left to right and take 10 health away from the players 100 until they die. I am working on the asteroids getting destroyed now. I made the ship shoot lasers when you press space yesterday, this part probably took the longest cause I’m stupid.