profile-image
blog-image

Dark Basic Pro: Capture The Ball Game


Designing the Game

This game is actually really fun to design. I started by making a maze which actually took a lot longer then I thought. I had to design 4 colored sections and two green sections for the bases. The bases are just like a base of the game "capture the flag".

Ball Capture Create

I made the maze just hard enough to take a while to go through it to find the balls scattered in the maze. There are many twists and turns in the level and places to hide the balls. I added a floor to the maze as well.

Game Mechanics

The game is based on the game mechanics from capture the flag. You run to grab a flag somewhere in the level and return it to your base. The only change to the idea is that you capture balls that are placed around the level. You can throw a ball in order to pass it to another player. You also can throw the balls outside of the level to reset it back to the place it spawned. The goal of the game is to capture as many balls as you can returning them to your bases "can" like receptacle. It kind of is like multi-flag capture the flag where you can capture more then one ball. Did I mention you also can steal balls from other players "can" like receptacle?

It's a for player game where anyone can gather balls for their team or steal balls from the opposing team.

I first designed a simple function that would store the position of my player #1 ever time I pressed the space key. It would write that position to a text file. This made positioning the player's and the balls around the level very easy.

I used a simple array to store all of the positions of the balls. It would read through the array and use one of the "spawn" points to position the balls. The same would be for positioning the player.

I saved the position of the ball that is spawned to the ball item so when it is out of the arena it can re-spawn to that point. This made it easy to re-spawn a ball in the original spawn point when the player throws the ball out of the level.

I needed a way of scoring so I positioned two points for the goals in the center of each can on each base. I figured the can was 150 units for a diameter so I was able to write a simple algorithm that went like this: If ball 1 through 14 is 150 units from the goal point then player's score is increased by 1.

It worked great! A player could even take away a ball and the score would decrease.

The final thing I did was add a timer and report who won at the end of the game based on the players scores.

Ball Capture -02 Ball Capture