QB64.org Forum

Active Forums => Programs => Topic started by: _vince on December 13, 2021, 12:21:44 pm

Title: Driving Game
Post by: _vince on December 13, 2021, 12:21:44 pm
Use "," key to go left and "." key to go right

Code: [Select]
CLS
s = 0
cr = 0
c = 7
l = 1
w = 15
1 r = l + w
IF l = 1 THEN n = 1
IF l = 25 THEN n = 0
IF n = 1 THEN l = l + 1
IF n = 0 THEN l = l - 1
'FOR k = 0 TO 4000
'NEXT k
_DELAY 0.5
a$ = INKEY$
IF a$ = "." THEN c = c + 1
IF a$ = "," THEN c = c - 1
PRINT TAB(l); "!"; TAB(c); "*"; TAB(r); "!"
IF c = l OR c = r THEN 2
IF a$ = "." OR a$ = "," THEN s = s + 1
GOTO 1
2 PRINT "***crash***"
cr = cr + 1
IF cr < 5 THEN 1
PRINT "score:"; s
PRINT "game over"
END
Title: Re: Driving Game
Post by: johnno56 on December 13, 2021, 02:35:36 pm
Oh, it has been a 'long' time sine I have seen this type of game. I think it was an old TRS80 program (Roadrace) except the 'car' was at the bottom of the screen. Cool...

Are you planning on developing the game any further?

J