# Demarcatix. my qix like game I will probably never finish.

Demarcatix <-.blend
use the standalone player. use the arrow keys to move and the “1” key to start moving away from walls.

I started working on this game months ago just to see what I was capable of. I was able to complete most of the mechanics of the game. I started working on the start menu and options menu, and quickly got bored. I will probably never complete this game. I thought I would post it here so people that are trying to create something similar can get some inspiration from my code and whatever else I created.

The game is based on Qix, an old arcade game. This was my first real attempt at making a game in blender. It was also my first time using python. I used online guides to teach myself python, so as a result, my code is probably difficult to decipher. many parts of the code have been rewritten dozens of times.

critique is welcome. just understand that I might never do any more work on this.

-Garrett

Wow, this Qix sure is an interesting concept I’ve completely missed.

I tried the game and the basics seemed to work alright. Sure I did some playtesting and got it to crash. The monster got trapped in flood fill, player death resulted in errors (line drawing continued from the spot I died but the start of the line was erased) etc.

I was particularly interested in how you handled 2D stuff, line drawing and flood fill algorithm because it’s not something that’s made easy in BGE and I wondered if you’d taken the math approach or approximation. Your code is not easy to read nor did I expect it to be. Your game is very advanced considering it’s your first with python and BGE. I’d just want to understand some parts better.

How does the flood check actually work? I’m seeing so many functions it’s kind of hard to put it together. You build your own grid system that you snap to and approximate the area based on drawing lines?

You should definitely keep up with making BGE projects and flesh out new ideas

both the line drawing and “flood-fill” use information from a grid of numbers with dimensions of 323X243.the grid is a list of lists. here is the code I used to create the grid (taken from “start.py”):

``````###############
# Create Grid #
###############

row = 243         #there are two extra points for the border
collum = 323      #there are two extra points for the border

g.grid = []
for i in range(row):
g.grid.append([0] * collum)

#0 = outside
#1 = line/edge
#2 = inside/occupied
#3 = enemy location
#4-7 = flood fill check

# To set point [y][x]
``````

I created a modified “flood-fill” algorithm. instead of spawning a plane at every point that is filled, creating a possible 78489 planes, the algorithm scales up each plane as much as possible, greatly reducing the amount of planes required to fill each space.

The line system I created writes to the grid to allow the “flood-fill” algorithm to work properly. I also keep the player snapped to the grid instead of moving it only on the grid points. This allows for greater flexibility when it comes to movement speed.

if you have any more questions or need any more clarification, feel free to ask.