Do I need a "Why" ? :-)
- I love graphics and game programming but I never take the time
- I remember playing Xonix on an Olivetti M24 circa 1985, I always thought it was a neat idea for a game. I have been playing Xonix emulated in DOS for years.
- I like D. Very much. However, I had never went much beyond simple programs of less than 100 lines.
- I found Raylib, which is an amazing graphics/game dev lib.
If you don't know what Xonix is, or have never heard about it, here is a short description (thanks to ChatGPT)
Xonix is a classic arcade-style game first released in the early 1980s, inspired by the earlier arcade game Qix from Taito. The player controls a small cursor or vehicle that moves along the border of a rectangular playfield and can venture into the interior to draw lines, effectively "claiming" sections of the playfield. The objective is to enclose and convert a certain percentage of the screen into claimed territory by drawing lines without being hit by enemies.
The game’s primary challenge comes from the enemies — typically bouncing balls or similar hazards — that roam the unclaimed area. If the player is hit while drawing a line, or before closing a section, they lose a life. Strategy involves carving out small sections quickly and safely, or taking riskier moves to claim larger chunks of territory in one go. As levels progress, enemies multiply and become more aggressive, increasing the difficulty. Xonix was notable for its simple but addictive gameplay, and it spawned many clones and adaptations across various computer platforms in the 1980s and 1990s.
It has been tested and found to build and work properly on macOS 15+ (ARM, my primary environment) and Windows 11. I have not tried it under Linux but I see no reason why it shouldn't work.
- It is my first venture into D proper.
- Most of it was written on board a very long flight (GRU-CDG-BKK if you are interested) without access to the Internet, just having manuals and the "Programming D" book to consult.
- English is not my mother tongue, so you will find some comments and git commit messages in Spanish.
All comments and constructive criticism are welcome
The code is licensed under the 2-Clause simplified BSD License. I guess this means that you can do whatever you want with it as long as you give proper credit.
