
QBasic game programming - StylifyYourBlog
https://balau82.wordpress.com/2015/01/18/nostalgia-trip-qbasic-game-programming/
======
petercooper
It basically has zero value now, but perhaps my only claim to "fame" in the
90s was writing the first (at least popularly known) raycaster in QBasic which
then spawned a ton of clones (the comp.lang.basic.misc community was strong
then). It was absolutely hideous and naive but getting credited in far smarter
people's larger creations as their inspiration was an eye opener for me :-)
(And a feat I have not repeated, alas!)

[http://home.kpn.nl/nebula/articfls%5Carticle1.html](http://home.kpn.nl/nebula/articfls%5Carticle1.html)
[http://www.o-bizz.de/qbdown/qbcom/files/txtreng.bas](http://www.o-bizz.de/qbdown/qbcom/files/txtreng.bas)

~~~
evincarofautumn
I do believe you are (indirectly) the reason that I got into graphics
programming, which led to the low-level skills I now use at my job every day.
Thank you.

------
dhotson
I managed to dig up one of my old 3d demo projects:

Source:
[https://gist.github.com/dhotson/686036fb771fbbca8c48](https://gist.github.com/dhotson/686036fb771fbbca8c48)

Screenshot: [http://i.imgur.com/4fpaYtO.png](http://i.imgur.com/4fpaYtO.png)

.. it's not as embarrassing as I expected. :)

~~~
Toenex
Actually that's a cool screenshot. It looks retro-cool rather than old. Nice
work.

------
klibertp
IIRC the version bundled with DOS6.22 was severly limited: it couldn't
generate executables and the built-in help was only for IDE, without help on
the language at all. That's because MS was also selling QBasic "pro" version.
It was basically impossible to buy any software then in my country, so I was
stuck with normal QBasic for a few years, until I got Internet connection and
pirated a full version (it was still impossible to buy software here - no one
bothered selling it at all here until a bit later).

Still, bundling a quite capable IDE with an OS was a very nice practice, but
it basically ended then, probably because MS also sold Visual Basic. Without
QBasic I wouldn't have started programming at all - I wonder how it would be
if I was starting right now. Is there any ubiquitous, simple language
available basically everywhere and with a nice IDE by default? JavaScript
almost fits the bill, but as a beginner who doesn't know any better you're
likely to use Notepad, while with QBasic you had a real IDE from the
beginning.

~~~
Narishma
The version that came with MS-DOS definitely had extensive help on the
language as well as the editor. It was an interpreter though, and couldn't
generate executables like the commercial version which was called QuickBasic
IIRC.

~~~
klibertp
> The version that came with MS-DOS definitely had extensive help on the
> language as well as the editor.

Are you sure about that? I may be wrong of course, but I remember pressing
"F3" (which I think was meant to invoke help?) and getting nothing. That's
actually why I bought a book, I think this one: [http://www.amazon.com/Crash-
Course-Qbasic-Greg-Perry/dp/1565...](http://www.amazon.com/Crash-Course-
Qbasic-Greg-Perry/dp/1565299396) (quite a nice one! I remember reading it
cover-to-cover during summer break on a beach, without any computer in at
least 20km radius...)

But it's absolutely possible that I either had some ripped version or just
couldn't find the right options. I mean, I was 8 at the time, knowing very
little English, so that wouldn't surprise me at all :)

~~~
Narishma
Yes, I'm pretty sure. That's the way I learned, from the included
documentation. I just checked in a Windows 3.11 VM I have laying around and
it's definitely there, though it's shift+F1 to access the help, or just F1 if
the cursor is on a keyword.

------
neandrake
In the late 90's there were several great QBasic communities (NeoZones was one
I would frequent the most). I think these more than the fondness of the
language/IDE were what kept me interested in learning software. Most of the
communities seemed to die along with popularity of the language in the early
2000's.

~~~
dhotson
Oh wow.. the community is still going:
[http://www.neobasic.net/](http://www.neobasic.net/)

Marcade, Alias, Chaoticmass, Sciolizer.. any of you guys hang out here? :)

------
kyriakos
I'm wondering what impact to future programmers the current state of
programming will have. Back when i was using qbasic there were very few
distractions, as a self taught programmer if you wanted to build something you
had to figure out how to do it yourself. No frameworks, no google, no
stackoverflow noise just a couple of libraries and infromation from a couple
of books I had access to as a kid. I remember for my first PC I knew the
purpose of every single file on its 21mb of hard disk, try doing that today..

------
DSMan195276
Shout-out to QB64 - An attempt at a modern version/compiler for QBasic code,
as well as updated features. I used to do a fair amount of programming in
QB64, and the design of the language hampers it as a general-purpose language,
it's a fun language for learning and writing in.

~~~
jarcane
There's also FreeBASIC, which is largely compatible but with some shiny new
features on top (even macros and tail-call optimization O_O).

~~~
DSMan195276
The QB64 community is aware of FreeBASIC, but a big feature of QB64 is that
you can literally drop QBasic code into QB64 and it will work without _any_
modifications. This won't work at all for FreeBASIC, it's much to far away
from QBasic. FreeBASIC is still a nice language, but it does have different
goals then QB64.

~~~
jarcane
They've moved away then, since I last used it, earlier versions were pretty
compatible. QB64's aims are good, but it's still incomplete itself, and I had
stability issues with it (and to be honest, wasn't particularly keen on still
using the old QB IDE anymore either).

~~~
DSMan195276
FreeBASIC definitely has moved away from QBasic compatibility, I don't think
it's considered a focus at this point. The last SDL versions of QB64 are
fairly impressively compatible IMO, a large chunk of QBasic programs work
without too many modifications. You can also now use the compiler via the
command-line if you're interested. Back when I was doing some more "serious"
QB64 development, I use a regular IDE and shell'd out to QB64 to compile,
rather then typing in the QB64 IDE itself. It has it's share of rough edges
though, so it is what it is.

------
husted
I remember using basic during my demo coding days to find the optimum
algorithms. When everything is running at 0.5fps it's easy to sport which
implementation is the fastest. So after trying a few methods I would determine
the fastest and implement it in asm1.

I miss those days, that was fun.

------
aabajian
This is fantastic. My first game was in GW-BASIC, but I quickly upgraded once
I discovered QBasic on DOS 6.22. I also loved the MS-DOS Shell
([http://en.wikipedia.org/wiki/DOS_Shell](http://en.wikipedia.org/wiki/DOS_Shell))
found on the supplemental disk of v6.22. It felt like multitasking...but
wasn't.

~~~
reacweb
I started with the basic of Oric-1, then the fabulous locomotive basic of
Amstrad. When I got a PC (1986), I ditched quickly GW-basic in favor of turbo
pascal, turbo prolog and later turbo C. QBASIC was not bad, but really too
late for me.

------
helmsb
My whole fascination with computers and ultimately my career in programming
started with QBasic. When I was 7 years old we had a 286 with DOS and running
Norton Commander. I knew all the games I played, ran by selecting the ".EXE"
file so I started looking for other "EXEs" when I ran across "QBasic.exe", I
thought it might be a game so I ran it and started digging around. I came
across some sample applications and more importantly the Help menu (QBasic had
the one of the most incredible help systems ever). I started copying the
samples for each command, then chaining them together to see what I could do.
I can still remember the thrill I felt the first time I typed code and had the
computer do what I wanted, it was life altering! My dad later bought me a book
called "101 BASIC Computer Games", that's when I discovered that all flavors
of BASIC are not equal and I then taught myself debugging.

------
FrankenPC
Great memories. It inspires me to locate an old DOS version of Turbo Pascal.
TP was my absolute favorite IDE in the DOS days.

------
pjmlp
Having started with ZX Spectrum BASIC (Timex 2068), followed by hexdumps, and
moving into GW-Basic/Turbo Basic and Assembly after getting my first PC, I
never coding anything meaningful in QBasic.

For me, those were the days to start learning Turbo Pascal, and QBasic was
used mainly to run nibbles and gorillas, when I got bored of a coding session.

~~~
reidrac
I can relate to this. I started with ZX Spectrum 128K's Basic and then moved
to GWBasic on a Nec V40 (80186 compatible), my first PC.

When I got a computer good enough to run QBasic (or anything newer than DOS
3.3), it could compile C as well (with DJGPP) so I completely skipped QBasic.

~~~
Zardoz84
In my case, would be : ZX Spectrum +3 -> TurboBasic/QBasic -> Visual Basic &
Delphi -> PHP -> C, C++, Java, Javascript, Python, D, Assembly

I really miss the simplicity that have old computers of 80's and early 90's.

------
z3t4
QBasic was also how I started programming. When I found out you can edit the
code ...

I printed programs on the school printer. Then typed it in when I got home, as
we did not have any Internet. Sometimes I got banned for printing non-school-
work.

I've heard similar stories from people printing machine code, so I guess it
wasn't that bad writing QBasic.

------
andrewguenther
I learned QBasic from a Boy Scout magazine when I was in 4th grade. It was a
letter jumble game and my dad helped me on our old Windows 3.1 machine. Never
looked back.

------
Narishma
Is it me or is he doing the input and rendering in the wrong order?

~~~
balau
Not necessarily wrong. Let's say it's inverted with respect to what you would
normally expect. Since PUT writes pixels with XOR, it doesn't make a
difference after the two PUT are executed. But since the graphic mode doesn't
have double buffering, the screen could refresh while the PUT are executing.
If the sprite is erased and then the next sprite is drawn, it might happen
that you see no sprite or a partial sprite for a split second. If the next
sprite is drawn first, and then the previous sprite is erased, you might see
something like two slightly different sprites at the same time, and this gives
a better (still ugly but better) movement effect in my opinion. That's why I
inverted those lines.

~~~
Narishma
I was talking about input and rendering. If you do rendering before handling
input, you add at least an extra frame of latency.

~~~
balau
I'm sorry I don't know why I understood the other thing. You are right, the
input effect is delayed in this way.

