4 ms·
Is there an online gorilla.bas :-) ?
by simplehuman 10y ago
Is there an online gorilla.bas :-) ?
- makmanalp 10y agoAsk and ye shall receive, thanks to the archive.org retro gaming folks (seriously, that whole archive is amazing): https://archive.org/details/GorillasQbasic https://archive.org/details/GorillasQbasic
- kmill 10y agoFunny you should ask. I translated it to Javascript a few months ago, fixing a couple of bugs in the original game in the process[1]: http://www.kylem.net/stuff/gorilla/gorilla.html http://www.kylem.net/stuff/gorilla/gorilla.html [1] and surely introducing a couple bugs of my own. I almost got it pixel-perfect, but I couldn't figure out QBasic's arc-drawing algorithm! (And the "slow rendering" is artificial delays. Because whole frames are drawn at a time with HTML5, you have to do something on purpose to get the slow city drawing effect.)
- speeder 10y agoI think I found a bug the original game didn't had (or my dad fixed on my version...), but suiciding results in you getting the score. (example: I suicided as "player 2", the "player 1" made his victory dance, but the score counted 1 point for player 2)
- kmill 10y agoThanks! Scorekeeping was always a part of the code I was unsure about, and I thought I saw some scoring inaccuracies while playing the game, but somehow never identified what they were. If you're curious, the HITSELF constant in the original game is 1, but I was testing a boolean against HITSELF using strict equality (===). Thus, you were just scored based on how many gorillas you hit with a banana. (fixed)
- kmill 10y agoActually, it turned out I just reversed who received each point! The bug was more subtle and came down to the fact that arguments are passed by reference in QBasic, so the DoShot function modifies the caller's PlayerNum variable when a gorilla is hit. This means there's just dead code in the scoring function.
- mod 10y agoThat's pretty sweet. Brings back fond memories of 8th grade algebra class.
- simplehuman 10y agoWow, that's a faithful reproduction. Did you use a translator or are you doing this totally by hand? The reason I ask is that even the effects like the Sun showing a reaction when hit by a banana is nicely reproduced. Edit: If you have the source online, link please. I would love to make it networked :-)
- kmill 10y agoI did it by hand by reading the original QBasic source code. One reason I did it was to reacquaint myself with QBasic, the first programming language I learned. Another was the challenge of converting a program which relied on blocking behavior to HTML5, which shuns anything of the sort; the solution I used was generators to simulate my own "IO monad." The IBM EGA font came from an image someone kindly had of the complete character set, which I converted to JS: http://www.kylem.net/stuff/gorilla/ega8x14.js http://www.kylem.net/stuff/gorilla/ega8x14.js The source code is http://www.kylem.net/stuff/gorilla/gorilla.js http://www.kylem.net/stuff/gorilla/gorilla.js Feel free to do whatever you want with it!
- mysterydip 10y agoCould you apply what you learned to improve this qb js interpreter? http://stevehanov.ca/blog/index.php?id=92 http://stevehanov.ca/blog/index.php?id=92 Fairly useless but would be a nice nostalgia trip to be able to run some of the 90s qbasic code that's still lying around in unswept corners of the internet :)
- kmill 10y agoIf the point is running old QBasic code in a browser, it's probably better to compile DosBox to HTML5 and run the original QBasic interpreter in that, as is done on archive.org: https://archive.org/search.php?query=subject%3A%22qbasic%22 https://archive.org/search.php?query=subject%3A%22qbasic%22 Nibbles: https://archive.org/details/NibblesQbasic https://archive.org/details/NibblesQbasic