Day 2: Refactoring & Resisting (Some) Temptation
Another pin is on the corkboard. Day two of the Asteroids bootcamp was a fantastic mix of creative problem-solving and disciplined coding.
Today's work focused on three major goals: improving the ship's particle thrusters, adding the first weapon, and refactoring the code for better organization.
The Creative Work
As you can see in the GIF shared below, the duck-piloted spaceship is now flying and firing! I spent more time than I'd planned on the art today, but I couldn't resist. I had a specific vision for the particle flames coming from the ship's engine, and it took some time to get them looking right without being hidden by the ship during turns. It's not perfect yet, but it's close enough for now, and a great lesson in balancing polish with progress.
I also got the first laser weapon working. It currently spawns from the middle of the ship, which looks a bit odd when firing while turning. I was very tempted to dive in and fix this myself as soon as I noticed this, but this is where the value of a good tutorial comes in. I decided to hold off on trying to fix it myself. At the end of the refactoring video, Justin Zendt explained he will be covering the math for correct spawn placement in a future video. I'm sure I could have figured it out myself, but having the patience to resist that initial urge is going to pay off. Having full control of spawn a laser from any point on the ship is something that will be invaluable in the future for all kinds of games. I'll be shown how to do it the proper way in the next video. That's something I wouldn't have gotten from one of the shorter tutorials out there for making an Asteroids clone.
The Technical Work
The biggest accomplishment today was refactoring the code. The main STEP event was becoming a catch-all for player movement, particles, and attacks. Following the tutorial, I abstracted that logic into clean, separate scripts. The Step
event is now much cleaner and easier to read, as you can see in the snippet. This process was very similar to how I teach Python functions to my students, and it's a critical skill for keeping a large project organized.
What's Next?
I'm also working on a short intro video to officially announce Corkboard Studio on social media. I was originally going to wait until this first project was complete, but I've decided to share the journey from the very beginning.
Thanks for following along. Feel free to leave a comment or question if there is something I can answer.
Bootcamp #1: Asteroids Clone
My first real project in GameMaker! A deep-dive clone of Asteroids, built to master the engine's fundamentals.
Status | In development |
Author | corkboardstudio |
Genre | Action, Shooter |
Tags | Asteroids, Space, Top down shooter |
More posts
- Day 5: Collisions and SFX1 hour ago
- Day 4: UI & Colorful Asteroids1 day ago
- Day 3: Multiple Weapons & The Revenge of Linear Algebra2 days ago
- Day 1: The First Pin is Placed4 days ago
Leave a comment
Log in with itch.io to leave a comment.