Live data from Hacker News

QBasic game programming

balau82.wordpress.com

21–30 of 35 posts

Re: QBasic game programming

#21
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.

Re: QBasic game programming

#22

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 im…

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.

> 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... (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 :)

Re: QBasic game programming

#23

Earlier quoted context omitted.

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.

> 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... (quite a nice one! I remember reading it cover-to-cov…

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.

Re: QBasic game programming

#24

Earlier quoted context omitted.

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.

> 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... (quite a nice one! I remember reading it cover-to-cov…

yep, the screenshots in the linked article are QBasic, not QuickBasic - check them out

Re: QBasic game programming

#25

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, a…

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.

Re: QBasic game programming

#26

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 im…

> Is there any ubiquitous, simple language available basically everywhere and with a nice IDE by default?

Python comes close. It runs on just about anything, has a very basic GUI toolkit in the standard library (Tkinter) and comes with a syntax highlighting code editor with built-in command shell as standard (IDLE).

Tkinter is ok for simple apps like a calculator. IDLE was written in it so it's fine for basic apps. For anything more complex there are wrappers available for native UI libraries, or you can use PyQt or PySide that both wrap the very capable Qt framework (a personal favourite). There are more feature complete IDEs, but honestly IDLE is a fine learning environment.

There is a commercial version of Python available for the iPad called Pythonista. It has a serviceable code editor and a bunch of external libraries baked in, but doesn't have TkInter as the desktop GUI paradigm doesn't work on iOS. Instead it has wrappers for the native iOS GUI frameworks, and even comes with a visual UI designer.

Re: QBasic game programming

#27
post #14
post #11

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.

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.

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.

Re: QBasic game programming

#28
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.

Re: QBasic game programming

#29

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

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.

Re: QBasic game programming

#30
post #12

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.

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

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.
Post reply on HN