So, there's at least one confirmed bug in Pantzer. Unless you have the right font available to our X server, you get a horrible error, telling you so.
There is a patched version, on my disk, not yet released. It needs a little bit of testing, but until then, push an existing font onto PANTZER:*FONT-PREFERENCE* (the fix is, essentially, instead of using the CAR of that list, traverse it until an openable font is found).
Thanks to Athas of #lisp for notifying me of the bug's existence. Once it was pointed out, the fix was, as they say, trivial.
There's a couple of screen-shots up here. Unfortunately, the game is MUCH more appealing in motion.
Of course, crhodes pointed out that there were some FATAL flaws in my macros. Firstly, I managed to faff decf-if-not-negative (I used > instead of >=). secondly, it suffers from Multiple Evaluation.
(defun decrease-if-positive (base n) (if (> base 0) (- base n) base))
(defun decrease-if-not-negative (base n) (if (>= base 0) (- base n) base))
(define-modify-macro decf-if-positive (&optional (delta 1)) decrease-if-positive) (define-modify-macro decf-if-not-negative (&optional (delta 1)) decrease-if-not-negative)
This morning was definitely lacking in the planned book database recovery (sigh). However, there is now "lives", the UI loop terminates as the number of lives spare hit -1, there's a compass rose that seems to behave as it should and there is a visible warning when an enemy tank fires a missile. Still no REAL handling of enemy tank collision (this should I feel, cause s loss-of-life). There is also a handy utility macro or two (hiding in globals.lisp):
(defmacro decf-if-positive (form &optional (step 1)) (let ((cur (gensym "CUR"))) `(let ((,cur ,form)) (if (> ,cur 0) (setf ,form (- ,cur ,step)) ,cur))))
(defmacro decf-if-not-negative (form &optional (step 1)) (let ((cur (gensym "CUR"))) `(let ((,cur ,form)) (if (> ,cur 0) (setf ,form (- ,cur ,step)) ,cur))))
Handling of lives is under way.
Tank AI no longer computes FOV as if it was at (0.0; 0.0) but at the actual tank position (this, no messing, improved the aiming and stuff a LOT).
We now handle collisions between missiles and the camera (read "player") by simply deducting a life. Drawing of small tanks in the infobar is in progress (build a list of points off-set from X and Y fed in as parameters, feed to XLIB:DRAW-LINES, with filling).
There might, just might, be a 0.3 ready tomorrow.
So, the AI is somewhat les sstupid, things no longer shoot themselves, annoying "why are enemy tanks not displayed?" bug has been fixed, there is now automatic replenishment of tanks and landscape as it gets shot up.
I think that means "time to link!". So, without further ado, I give you Pantzer, a cheesy wire-frame "shoot tanks" game. NB, at the moment, you can't be killed. That's, admittedly, a bug. But it's a cool bug. It'll be fixed when I've decided on such pesky things as "how many lives".
Oh, to start, load the system, then run (net.hexapodia.pantzer:ui-loop) (if you want an inter-frame delay that's longer than the default 0.1 seconds, give the delay as an optional argument). Oh, yes, make sure to have CLX around, otherwise the display won't work.
Smarts improved, I think. Alas, the tanks are now amusingly-stupid enough to shoot themselves (this is, as they say, a BUG; the missile materialises within the tank instead of in front of the tank). Tanks no longer share a missile-firing barrel with the player (that was another bug, as they say).
Alas, last re-compile finished just about in time for me to kiss my wife good-morning and amble in the general direction of work.
The enemy tanks now have some smarts (or should I say "stupids"?). They turn and twist and occasionally shoot. Unfortunately, they are displaying a preference for driving away from the player. This is, as they say, suboptimal.
Back to doodling on Pantzer (a "drive a tank through wire-frame landscape" game). I now have enemy tanks. They're apallingly stupid (they know how to move forward in a straight line). Hopefully, I shall be alert enough tomorrow morning to make them a wee bit smarter (essentially, "if you can see player, turn slightly to get a better angle and move quickly; otherwise, turn randomly, preferring to stick with the last used angle and move slower"). This should be slightly fair, even though the player moves at a fixed speed.
New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.
Keep up with the latest Advogato features by reading the Advogato status blog.
If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!