How Gyro Boss DX Works

HowGyroBossWorksA

In March, over at Chequered Ink, we released Gyro Boss DX on Steam. The game is an orbital avoid ’em up where players must dodge a crazy arsenal of weapons for as long as they can! But how did we make it?

The Software

Gyro Boss DX is made in GameMaker: Studio from YoYo Games. Allie and I both used to work there, and we both have over 10 years’ worth of experience with the software, so it makes sense for us to continue to use it to make games!

GameMaker is perfect for a game like Gyro Boss, where you want to bring to life a simple 2D mechanic in as few steps as possible. It’s a huge bonus that once you’ve developed the PC version you can output to Mac, Android, iOS and even consoles with very little extra work.

The Movement

In Gyro Boss DX players can only move in a fixed circle around the boss. How we can do this is simple. The ship has variables for orbital speed and direction, then we use those with the lengthdir_x and lengthdir_y functions to calculate the ship’s position on screen:

Create Event:

orbitSpeed = 0;
orbitDirection = 90;

Step Event:

if (keyboard_check(vk_left)) {
  orbitSpeed = 3;
} else if (keyboard_check(vk_right)) {
  orbitSpeed = -3;
} else {
  orbitSpeed = 0;
}

orbitDirection += orbitSpeed;

x = (room_width/2) + lengthdir_x( 640, orbitDirection );
y = (room_height/2) + lengthdir_y( 640, orbitDirection );
Gyro Boss

In the final game our code is a little more complicated than that. We added a little “friction” to the orbital speed so that the ship appears to accelerate and decelerate smoothly. We also check the controls a lot more carefully, especially as we need to support gamepads as well as keyboards.

Also, we make sure to keep the orbit direction variable between 0 and 360, which makes it easier to work with later on, like so:

orbitDirection = orbitDirection mod 360;

The Weapons

Gyro Boss is known for having unique and crazy weapons, from squids to boxing gloves. Most of the weapons work as you’d expect them to. They fire towards the player (using the point_direction function) or they simply fire in random directions all over the screen. Each one has its own unique movement code (for example the Squid, which slows down to a speed of 0 before shooting forward again).

But how does Gyro Boss select and fire his weapon of choice? Well, he uses a random number generator and a big, messy switch statement!

Each weapon has its own “Ammo” and “Delay between shots” values, which are set when the weapon is selected. During the step event, Gyro Boss spits out these weapons at intervals which match the delay value until the ammo value reaches zero.

Of course, the weapon picking script isn’t completely random. We had to make a few adjustments to make sure the game was fun to play:

  • The first weapon of each round is always one of the easiest ones.
  • Every 10 waves the game picks an extra hard “Rage” weapon. These don’t appear at any other time.
  • No weapon can be picked twice in a row (except in some of the multiplayer modes).

Multiplayer

When we started work on Gyro Boss DX we knew we wanted to add multiplayer. It was kind of the whole point of building the game from scratch. Initially we simply made it so that the multiplayer was the same as the single player mode but with… well… more players!

We showed the game to a few publishers and the feedback we got was this: we like the multiplayer, but what if each round had some sort of twist? To be fair we should have thought of that ourselves, chalk that up to inexperience! But we took the advice on board and set about building the “Party Mode” you see in Gyro Boss DX today.

Since we built the game from the ground up with multiplayer in mind, it was easy to add the necessary code to add extra players to the game. When players join in the lobby, an array is created which stores the ID of the gamepad connected to each player. Then, when the game starts, the controller object creates the correct number of players and assigns them all a unique ID. Each player object is using exactly the same code as in single player – but they use the array of gamepad IDs to detect which controller they should respond to. Something like this:

if (gamepad_is_connected(global.playerList[myID])) {
  if (gamepad_button_check(global.playerList[myID], gp_padl)) {
    // MOVE LEFT, ETC...
  }
}

If ever you’re planning to create a game with a multiplayer mode, be sure to keep it in mind every step of the way when you code the single player mode of the game. You’ll save yourself a lot of headaches later on!

Summary

Gyro Boss DX is an incredibly simple idea, and can be executed pretty easily in its most basic form. However it took a lot of tweaking and polishing to create the finished experience you see today. Getting the balance right between weapons was probably the hardest part of development. Most weapons should be the same difficulty – but some should give your thumbs a rest and others should make you sit up and concentrate. I think we achieved the right balance, and hopefully our experiences can help you with your own projects!

All the best,

Dan.

Gyro Boss DX on Steam: https://store.steampowered.com/app/971610/Gyro_Boss_DX/

Comments are closed.