New games every week!
JSE - Sidetracked Blog
30th June 2021
Hmm.. Got sidetracked from what I was doing..

-=-=-

Over on Twitter, @Retro70sChild posted pictures from one of those 80's Usborne computer books, and within the 3 pages pictured, was one page containing the entire code for a mini BASIC Skiing game.

Mmmmm...



I read through the code and wondered..

// Downhill Racer Game // from Practical Things To Do with a Microcomputer : page 21 // by Usborne Computer Books 10 Graphics 320,240,1;SetFontSize 8;SetCLSColor 255,255,255;SetColor 0,0,0 20 W=SCREENWIDTH()/8 // <<--------^ 30 P=15 40 // This top bit's different 50 // But .. it does the same job! 60 CLS 70 PRINT 80 PRINT (" "*((W/2)-9))+"<<DOWNHILL RACER>>" 90 PRINT 100 PRINT "YOU ARE SKIING DOWN A SLALOM" 110 PRINT "RUN. PRESS < TO GO" 120 PRINT "LEFT AND > TO GO RIGHT." 130 PRINT "IF YOU GO OFF THE RUN, YOU" 140 PRINT "FALL OVER THE PRECIPICE." 150 PRINT "HIT SPACE TO START." 160 WAITGAMEPAD 170 // Don't need this loop. WaitGamepad will suffice. 180 PRINT 190 T=W/2-P/2 200 C=W/2 210 PRINT (" "*T)+"P"+(" "*(P))+"P" 215 PRINT (" "*C)+"!!" 220 R=RND(1) 230 IF R<0.5 AND T>2 THEN T=T-1 240 IF R>0.5 AND T+P<W-2 THEN T=T+1 250 // Input is replaced by GamePad 260 IF GAMEPAD(BUTTONLEFT)>0.5 THEN C=C-1 270 IF GAMEPAD(BUTTONRIGHT)>0.5 THEN C=C+1 280 IF C<T THEN GOTO 310 290 IF C>P+T THEN GOTO 310 300 WAIT 0.05;GOTO 210 // Added a delay, here. 310 FOR T=1 TO 40 320 PRINT "**!! OVER THE PRECIPICE **!!":FRAME 330 NEXT T 340 PRINT "HIT SPACE FOR ANOTHER GO" 350 GOTO 160


There's a couple of tiny tweaks here and there.
The Inkey$ has been switched with GamePad controls, the "wait for a key" loop has been replaced with a WaitGamePad, and there's been delays added to slow it down from an insane speed.

Another fairly substantial change is in the actual Print command for the gameplay.
The original book relied upon the Tab() command to move the text cursor around the screen, but JSE currently doesn't have one of those.
Instead, I've plonked the character onto a second line of text. It does the job..

But.. Yeah, it works a treat!
Super Retro Coding FTW!!
Views 99, Upvotes 8  
Jse , Usborne
New games every week!
Site credits : Site built from the ground up, in php, using Programmer's Notepad 2, and a very bored Jayenkai.
(c) Jayenkai 2023 and onwards, RSS feed

Blog - JSE - Sidetracked - AGameAWeek