Bin Laden Liquors: Game Maker Edition

First off let me say Yes! I’m back to update this blog occasionally. I realize I left it high and dry a while back when I launched Now that Gamerations has more people working on it than just me and I’m just about done with school I figured now would be a good time to get back into the Rosenblog. Basically I plan to post random thoughts and posts, unrelated to gaming as well as information about projects I start.

This time up is Bin Laden Liquors: Game Maker Edition, a game I made as a small way for myself to learn the basics of Game Maker Studio. This isn’t a tutorial but is rather some background information as to why I chose to do the project.

I purchased Game Maker: Studio not too long ago in the Game Maker Humble Bundle. As someone who loves games, and loves game development I’m always tinkering with different engines.I always strayed away from GM:S for a few reasons but primarily it’s reputation for being unable to make anything decent as well as it’s decently high costs. However I’m glad I did give the engine a try because after having played with it a bit I realized it’s actually a pretty great engine for small projects. It’s not without it’s own flaws and some aspects of the engine are pretty horrific but overall I was much more impressed with it than I expected to be.

I love learning. Especially when in regards to designing and building games. Games are so complex and difficult there is always something new to learn, and each engine brings new challenges. With GM:S not supporting any serious programming language and instead opting for their own scripting language mixed with a visual building block style of scripting it was a big change for me to go from languages like C#, Java and C++ for game development to this odd scripting languages. I’m not a great learner from tutorials though so I wanted a small project that I could easily break apart and teach myself how to build. For whatever reason the old flash game Bin Laden Liquors, and it clicked in my head that it was actually a great learning project. For reference the original game can be found at:

So first thing first, was to break the game down. There is a few basic rules the game follows which are outlined below.

– Needs to render a background image
– Needs to render text on top of the image
– Needs to have functioning buttons, one to enable/disable gore and one to begin the game
– Needs to render those buttons
– Needs to have text flashing on top of the
– Create high score file if none already exists
– Needs to render the background
– Needs to have random point generation for spawning enemies and hostages
– Needs to have events for if enemy or hostage is shot
– Needs to have timer so enemy or hostage retreat if not killed within certain time frame
– Needs to have events for if they are not shot in time
– Needs to have the player hand
– Needs ability to fire gun
– Needs events for firing
– Needs to handle amount of ammo
– Needs to store number of kills and misses
– Needs to have player follow cursor
– Needs to spawn blood splats on kill
– Should have slurpie effects
– Needs a HUD which gives up to date information
Game Over:
– Needs to render background
– Needs to render score on top
– Sound Effects need to handled at the proper times

So now with the list of things to handle it was off to google. Now I know how all of this would work and be handled within a standard language based engine but this was different. The main menu was first since, it’s simple and should provide some basic information. So I created my room for the main menu and got to work. Rendering the background and placing objects on it was as simple as selecting the background and it’s render mode followed by selecting the object to spawn and clicking where I wanted it. Of course settings had to be messed with to generate them in the correct scale but it was still next to no work. Text rendering cannot be done visually for some reason so I created an empty object which generated text during it’s draw event. This worked but created a hassle when trying to get text in the correct location. It was just an annoying series of trial and error. It was doubly so when I would render it with a shadow effect for readability, which ended up being accomplished by rendering black text behind the primary text a few pixels off the edge. It works but was an annoying period of time.

Once the menu text was properly created I simply needed buttons. My original plan was to create a simple button object which would then be broken up into how it acted later on. Unfortunately I didn’t know this exact thing was possible with the use Parent / child objects, something I learned post completion. My first system for having buttons working was to create the exact some object duplicated with a different action on its click. I later switched the system to a single button object which just acted alternatively depending on a button id, a variable I assigned the object. It was my own little Parent/Child system. Once the button object was fully functional, it was super simple adding the text and hover color change to the button objects themselves. As far as the functions themselves work, it too was incredibly simple. The Gore mode is a simple global variable which is changed between True or False depending on what it is when the button is clicked. The begin game button simply changes the room from the menu to the game room.

The game itself was the fun part to make and Game Maker: Studio made it fairly easy to get it functioning and testable in a very short amount of time. I began by creating a new room, and filling the background with the background image and then creating an object for the Player. The player object is simply the hand, and it also stores the majority of the important variables like hits, misses, ammo as well as the variables which control spawn rates. Spawn rates are being handled in a randomized manner so we have a number attached to the player object which then has a + or – amount of time built in ensuring that though the spawn rate is randomized it also stays fairly close. This makes it simpler for us to make a scaling difficulty as the player does well, our initial spawn rate value decreases making enemies and hostages spawn much more frequently.

Once the variables were set up it was time to get the player object moving. The object has the sprite for the hand centered which made it simple using GM:S’s built in mouse_x and mouse_y values to have the player object location set to the same location as the mouse on each frame. I gave it a quick test and sure enough the player object follows the cursor perfectly.

The rest of this post is coming soon!

Find the full project binaries and all code at–GameMaker-Studio-Edition

I’ll be updating this blog a bit more frequently now. More projects coming soon!