Down-Hill Skiing for GWBasic

This is another game I got from a long forgotten Basic book in the school library. It’s pretty simple, you are a skier going down a slope and need to keep from hitting the edges of the ski-run. As per Ghost Guzzler I have re-written this game for better timing as it was CPU dependent for speed, and I have added a feature or two. Interestingly this game uses the text scrolling ability to make it look like a much more advanced scrolling graphical game. I’ve seen another game that uses this technique recently called Space Escape that I found quite fun.

Anyway here is the code.

Update: I now have this available on github which is a better place to get this code. You can find it here along with some other GWBasic code.

4 responses to “Down-Hill Skiing for GWBasic”

  1. evertonmarques Avatar
    evertonmarques

    Hi,

    For fun, I am writing a toy compiler for BASIC.
    I enjoy finding simple BASIC games that I can feed into the compiler in order to see how it handles simple code.

    I am hitting some issues understanding the skiing game:

    1. What operator is supposed to relate playerx to 1 on line 360?

    360 IF C$ = R$ AND PLAYERX 1 THEN TRACK=TRACK-1

    2. How is R variable assigned?

    390 IF R = 1 AND WID>5 THEN WID=WID-1
    400 IF R = 3 AND WID<20 THEN WID=WID+1
    410 IF R = 4 AND TRACK<79-WID THEN TRACK=TRACK+1

    3. In line 470, can the double equal sign be replaced by a single equal?

    470 IF PLAYERX==(TRACK+WID) THEN 490

    Btw, you can find my WIP BASIC compiler here:

    https://github.com/udhos/basgo

    Thanks,
    Everton

    1. sparcie Avatar

      Hi Everton,

      Thanks for taking a look at this old gem. I’ve compared the source file on my machine to this and it appears to be missing this line

      370 R = INT(RND*5)

      Which should answer your second question.

      line 350 and 360 also appears on my disk as
      350 IF C$ = L$ AND PLAYERX>1 THEN PLAYERX=PLAYERX-1
      360 IF C$ = R$ AND PLAYERX<79 THEN PLAYERX=PLAYERX+1

      line 470 also appears to be missing some code…
      470 IF PLAYERX=<TRACK OR PLAYERX>=(TRACK+WID) THEN 490
      is what it should look like.

      So I’ve clearly made some mistake in formatting when I copied the code to the page. I’ll check it against my source and fix this page. In the mean time I actually have the source file for this available for download at the following link.

      http://sparcy.mooo.com/download/basic/SKING.BAS

      Sparcie

    2. sparcie Avatar

      I think I understand where the problem came from! The < and > symbols in the code made wordpress display and store the code incorrectly. instead interpreting some sections as a HTML tag and removing parts it didn’t recognise. I’ve checked the code of this and ghost guzzler and fixed what I spotted was incorrect. Thanks for spotting the mistake, please let me know if you find any others.

      Sparcie

      1. evertonmarques Avatar
        evertonmarques

        Hey,

        Thanks for the original source file!
        I have downloaded it and the compiler handles it perfectly.
        It even spots a limitation in the compiler: it currently does not fully mimics the TAB() primitive.
        So the game can be compiled and runs as binary executable but it’s not playable yet.
        I’m thinkering on how to more closely reproduce the TAB() behavior.

        Thanks again,
        Everton

Leave a reply to evertonmarques Cancel reply

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