Is there a Xonix or Qix clone?

I was wondering if there’s a Xonix or Qix clone out there for the Arduboy. I am in the process of making several Homemade Arduboys, and have a few wich don’t have flashcarts, and were ment to be given away for some local children… And while thinking about what kind of games i should upload for them, thought about what simple mobile games enjoyed on the go. Snake, Tetris, are obvoius choices, and I found several versions of them for the Arduboy, but none titled Xonix or Qix…

I don’t think I have seen one for the Arduboy … and it would make a great game. I am thinking that you could have the screen scroll to accomodate larger puzzles to overcome the screen size limitations.

I’m not a coder, but have some really basic knowledge from my youth regarding BASIC, and Pascal… I started to read up on some tutorials online, so I could hopefully make a clone. Found a few projects, and source codes… and am in the process of coming up with my version. I’m trying to keep it simple. Single screen… But with some basic but nice graphics for the score, and backgrounds, wich could be revealed while capturing the playing field. Difficulty wise I’m thinking increasing the speed and number of enemy types, wich would basically be bouncing balls within the uncaptured and captured parts of the field.

3 Likes

I see what you did there :stuck_out_tongue_closed_eyes:

Give it a go and you will surprise yourself how your knowledge will come back. If you break the code down into functions as much as possible you can always revisit them to add complexity or refine the logic.

There are plenty of people on the site who can answer questions or give advice / tips. It doesn’t matter if version 1.0 is simple as you can always improve it and release updates.

2 Likes

Weird puncuation aside, Pascal is a nice, underrated language.

To start with you might want to just do plain white rectangles and draw the sprites inverted if necessary.

Drawing patterned backgrounds like Qix does will be tricky. I can think of three ways to go about it and all three are a bit awkward.

The easiest of the three is to draw a full tile and then draw a filled black rectangle over some of it to ‘erase’ the parts you don’t need. You’d need to make sure that’s done before you paint the ‘entities’ though (i.e. the player’s cursor, the balls, the qix), otherwise you might ‘erase’ part of them.

One of the other approaches would have been easier (though not necessarily faster or more efficient) if the Arduboy2 library had a function that could draw only part of a sprite (without needing a mask), e.g. something like drawSprite(sprite, source, destination), but unfortunately it doesn’t, and implementing one would be a bit tricky.


The other thing I’d say is be wary of memory.

The original Qix seems to store every single rectangle that the player draws, but that would be potentially risky on Arduboy because the player could potentially exhaust all the memory by drawing lots of tiny rectangles. Though that does depend on how much memory you set aside for other things (entities, the score, et cetera), and how big your playing field is.

For example, if you set aside 512 bytes for the rectangles and each rectangle were 4 bytes (x, y, width, and height, all uint8_t) then you could have up to 128 rectangles.

It may be worth ‘fusing’ rectangles that connect at corners and have the same dimensions as a way to conserve memory.


If you need help or advice at any point, feel free to ask for assistance in a new thread.

2 Likes