I'm Coding a Game – Part 4
I'm back with adventures in game coding! Did you miss me? It was so fun to dive back into coding and making art for this project. I can't wait until I get to create the music for this game. I am thinking that will be more towards the end of this project. Let's go over what I've accomplished since my last blog post about gaming. But first: the changes I've noticed from the previous version of GameMaker compared to the new one!
Differences between GameMaker v1.4 and GameMaker v2
I decided to purchase the most recent version of the program GameMaker v2 as I continue forward coding my game. Definitely a huge upgrade! Right off the bat, I noticed that the interface is so much easier to navigate. Many elements such as sprites, objects, and events are streamlined. They are also visually linked to each other. For example, if I click on a certain object, it then connects visually to the events tab, then to the actual code of the event. This makes it so much easier to mentally picture how one connects to the other.
Another new feature is that coding is checked in real time, and the program will let the coder know if a line is faulty. If a variable is created and not used, the coding screen will have an alert by it.
The new program will also let you know if there are syntax errors in real time, such as this one.
The last new feature I noticed was the background and layers window. This new feature allows the coder to place objects at different levels so all the objects appear in the correct order. In the past version, it was rather difficult and time consuming to achieve this task, but in CMS2 layers are arranged in a window:
Now the coder can visually see how it all lays out on the screen and can make adjustments quickly.
That covers all the differences I noticed. I didn't spend oodles of time trying to spot every single change. I just wanted to get to coding!
Guns, Bullets, and Recoil!
Creating Gun and Bullets
The next step in this game was to give a weapon to our hero and make that weapon able to fire. The first step of the process was to create the artwork. There were three pieces of art I needed to make:
...and the bullet flash. This isn't the actual artwork. The actual one is just a white circle with a transparent background. When I posted the original, I couldn't understand why I couldn't see it. I spent 10 minutes cussing about how stupid the computer was until I realized I was trying to upload a solid piece of white onto a complete white background. Not one of my better moments.
Once they were all drawn up and loaded into the program it was off to write code for these objects and to give them properties.
Continue reading with a Coil membership.