A couple of games in BASIC I worked on recently.

new games to be launched and discussed here
Post Reply
Phantasm
Posts: 20
Joined: Thu Jan 19, 2017 9:56 pm
Contact:

A couple of games in BASIC I worked on recently.

Post by Phantasm » Wed May 29, 2019 1:18 pm

Some people on a discord channel I am on decided to have a go at writing some very small retro games in BASIC.

First off we decided to go with seeing what we could do in 1K. After I attempted that we agreed that 1K was probably a bit too limiting so we decided to go with 2K.

I decided BBC basic was a good bet since I know it pretty well. I have attached the two games as plain text in .bas files (including a fully commented, unoptimised version of the 1k one) and a disc image containing the games.

Obviously don't expect too much given the limitations but I was very pleased with the result of the 2K one.
Attachments
basic_games.zip
(5.58 KiB) Downloaded 17 times

User avatar
lurkio
Posts: 2148
Joined: Tue Apr 09, 2013 11:30 pm
Location: Doomawangara
Contact:

Re: A couple of games in BASIC I worked on recently.

Post by lurkio » Wed May 29, 2019 2:33 pm

Both games are great, and they're impressively small programs!

=D> =D> =D>

Btw, after running the 2K listing through the Pack routine in the PRES Advanced BASIC Editor ROMs, it appears that you might still have a few bytes to spare!:

Code: Select all

1MODE7:VDU23;8202;0;0;0;:PRINTTAB(13,4);"SPACE PIRATES";TAB(10,7);"Keys: Z - Move Left";TAB(15,9);"X - Move Right";TAB(15,11);"Space - Thrust";TAB(3,15);"Bring the diamonds back to base";TAB(10,20);"PRESS SPACE TO PLAY"
2REPEATUNTILGET=32:L%=3:A%=1:DIMS%(20,24):READB%:VDU23,224,8,28,62,127,62,28,8,0,23,225,0,0,255,255,129,129,255,255,23,226,24,60,60,126,60,102,102,195,23,227,255,129,129,129,129,129,129,255
3REPEAT:MODE5:VDU23;8202;0;0;0;:PRINTTAB(5,12);"LEVEL: ";A%;TAB(5,14);"GET READY":GOSUB26:PRINTTAB(0,0);"LEVEL: ";A%;TAB(10,0);"LIVES: ";L%
7VDU31,3,11,227,31,X%,Y%,224:O%=X%:P%=Y%:X%=224:Y%=656:GOSUB24:V%=0:H%=0:REPEAT:GOSUB24:T%=0:IFINKEY(-98)ANDX%>32ANDFNc(X%-40,Y%)=0X%=X%-8
10IFINKEY(-67)ANDX%<1248ANDFNc(X%+40,Y%)=0X%=X%+8
11IFINKEY(-99)T%=3
12V%=V%+1-T%:IFV%>=0W%=Y%-V%-16ELSEW%=Y%-V%+16
14IFFNc(X%,W%)=0Y%=Y%-V%ELSEX%=224:Y%=656:V%=0:L%=L%-1:PRINTTAB(10,0)"LIVES: ";L%:H%=0:VDU31,O%,P%,224
15IFL%=0PRINTTAB(5,12);" GAME OVER ";TAB(3,10);" PRESS RETURN ":REPEATUNTILGET=13:RUN
16IFABS(X%-F%)<32ANDABS(Y%-G%)<16ANDH%=0H%=1:VDU31,O%,P%,32
17IFY%<0Y%=0
18IFY%>1000Y%=1000
19GOSUB24:TIME=0:REPEATUNTILTIME=2:UNTIL(ABS(X%-224)<32ANDABS(Y%-656)<16ANDH%)ORINKEY(-82):A%=A%+1:READB%:UNTILB%=0:PRINTTAB(3,10);" YOU MADE IT ";TAB(1,12);" CONGRATULATIONS ";TAB(3,14);" PRESS RETURN ":REPEATUNTILGET=13:RUN
23DEFFNc(x%,y%)=S%(x%DIV64,31-y%DIV32)
24GCOL3,1:MOVEX%-32,Y%+16:VDU5,226,4:RETURN
25FORC%=Y%-2TOY%+2:FORE%=X%-2TOX%+2:S%(E%,C%)=0:NEXT:NEXT:RETURN
26FORC%=0TO19:FORE%=0TO23:S%(C%,E%)=1:NEXT:NEXT:X%=3:Y%=12:D%=0:GOSUB25:REPEAT:GOSUB35:IFB%MOD3=0ORN%=0GOSUB35:D%=B%MOD5:N%=3
29IFD%<3X%=X%+1
30IFD%=3Y%=Y%+1:N%=N%-1
31IFD%=4Y%=Y%-1:N%=N%-1
32GOSUB25:UNTILX%>=16:F%=(X%*64)+32:Y%=Y%+3:G%=(1024-Y%*32)-16:S%(X%,Y%)=0:CLS:COLOUR2:COLOUR129:FORC%=0TO19:FORE%=0TO23:IFS%(C%,E%)=1VDU31,C%,E%,225
34NEXT:NEXT:COLOUR128:COLOUR3:RETURN
35B%=(8121*B%+28411)MOD134456:RETURN
36DATA11,23,24,1,18,30,22,21,25,17,26,6,12,2,16,15,8,4,3,14,0

:?:

Phantasm
Posts: 20
Joined: Thu Jan 19, 2017 9:56 pm
Contact:

Re: A couple of games in BASIC I worked on recently.

Post by Phantasm » Wed May 29, 2019 3:34 pm

Nice. I did not go too crazy on the optimising of the 2k one.. just enough to keep it within the 2k. Ideally I didn't want it to become a complete unreadable mess.

sgb27
Posts: 26
Joined: Sat Jul 29, 2017 1:01 pm
Contact:

Re: A couple of games in BASIC I worked on recently.

Post by sgb27 » Fri Jun 14, 2019 2:09 pm

I assume you've all seen this one?

https://survex.com/~olly/rheolism/dsm_rheolism/

It still blows me away every time I see it (and then read through the explanation).

User avatar
lurkio
Posts: 2148
Joined: Tue Apr 09, 2013 11:30 pm
Location: Doomawangara
Contact:

Re: A couple of games in BASIC I worked on recently.

Post by lurkio » Fri Jun 14, 2019 5:50 pm

sgb27 wrote:
Fri Jun 14, 2019 2:09 pm
I assume you've all seen this one?

https://survex.com/~olly/rheolism/dsm_rheolism/

It still blows me away every time I see it (and then read through the explanation).
Very interesting, but how do you get it to run? I'm trying to use Arculator to do so, but the line's too long to be *EXEC'd in from a text file. I've tried this tokeniser, but I don't have the skills or knowledge to get it to work -- I just get the error "No run action specified for this file type".

:?:
Last edited by lurkio on Fri Jun 14, 2019 7:11 pm, edited 1 time in total.

Post Reply