XC=BASIC 3 – An Adventure Game!

By | 30 July 2022

This is a quick introduction, and the first of what I hope will be many posts/tutorials (call them what you will) on XC BASIC and game creation that I hope anybody who happens to come across them will find useful.

I should confess from the off that I am not a coder, and I will undoubtedly do things wrong, learn from mistakes, and improve over time. I am more than happy for comments, in fact, I positively encourage them, on how to improve the code and make it more efficient, point out what I am doing wrong, or generally mock me for missing something obvious.

My goal is to get better, and these posts are a way for me to record what I have done so far and build up a library of articles that will, hopefully, help others but more specifically act as an aide-mémoire for my aging brain.

My tool of choice is XC=BASIC 3, and so these posts and code within will be 100% based on the language, syntax and libraries of that compiler.

I’m not going to go into the installation and setup of XC BASIC, but follow the link above and it’s all very obvious. It runs on multiple systems – mine is running very happily on a MacBook Pro. I’m also using Visual Studio Code as my editor, and VICE to emulate and quickly debug, as well as, obviously, my real Commodore 64.

I’m going to be using XC BASIC to code a text adventure game – something I have been meaning to do for ages and I have started, and got quite far in some cases, with The Quill, The Graphic Adventure Creator, TinyInform (an Inform 7 library) and numerous books and magazine articles, typing in endless lines of code. The latter was particularly time consuming and unfruitful – somebody else’s bad code starts you off on the worst possible footing. Whilst I could definitely come up with a workable game using The Quill et al, and I did, it still didn’t leave me with any real sense of achievement.

I stumbled upon XC BASIC just searching around for languages and standard BASIC alternatives, and immediately thought it suited me just right. Compatible enough with CBM BASIC to make it feel old school, but modern enough to do away with line numbers, have subroutines and functions properly defined, inline assembly and, more importantly, compile down to what is so far blisteringly quick machine language.

My goal – to release an adventure game as a companion for a book I am writing – seems that much closer now.

These posts will not detail that game as such, but more of a template or a framework – I am focussing from the start on reusable code and the creation of, if not quite a fully-fledged creation system or engine, a way to easily create new stories using the same framework.

Follow me on my preferred network, mastodon @jonnypencils@jellis.co.uk, or Twitter @jonny_pencils and look out for the #xcbasicadventures tag for updates.

The first post will be about something I found I very quickly needed and deals with strings, within strings, within strings…..

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.