GOBLINS.BAS
A downloadable game
This is the first version.
For the Commodore 64.
The premise of the game is to get past the doors with keys, and get past the goblins by paying them off with loot.
Press A to go left, and D to go right.
0 rem goblins
10 red = 28
20 yellow = 158
30 blue = 154
40 green = 30
50 brown = 129
60 purple = 156
70 lightred = 150
80 white = 5
90 dark = 151
100 print chr$(147);chr$(white);:rem clear screen
110 poke 53281,0
120 poke 53280,5
130 p=int(rnd(1)*100):rem player position
140 dim w(100):rem world array
150 for i=0 to 99:w(i)=0:next
160 rem generate some items
170 for i=1 to 10:w(int(rnd(1)*100))=int(rnd(1)*4)+2:next
180 w(p)=1
rem 1 = player
rem 2 = loot
rem 3 = key
rem 4 = door
rem 5 = goblin
300 rem draw viewport
305 print chr$(147)
310 for x=-10 to 10
320 c=p+x
330 if c<0 or c>99 then print chr$(red);"X";:goto 400
340 if w(c)=0 then print chr$(dark);".";:goto 400
350 if w(c)=1 then print chr$(blue);"@";:goto 400
360 if w(c)=2 then print chr$(yellow);"l";:goto 400
370 if w(c)=3 then print chr$(red);"k";:goto 400
380 if w(c)=4 then print chr$(brown);"d";:goto 400
390 if w(c)=5 then print chr$(green);"g";:goto 400
400 next x
410 print
420 print chr$(yellow);"loot:"l" keys:"k
430 print chr$(green);"player position:"p
500 rem input
510 get a$:if a$="" then 510
520 if a$="a" and p>0 then op=p:w(p)=0:p=p-1:gosub 1000:goto 300
530 if a$="d" and p<99 then op=p:w(p)=0:p=p+1:gosub 1000: goto 300
540 if a$="q" then print chr$(green): end
550 goto 500
1000 rem collisions
1010 if w(p)=0 then w(p)=1:return
1020 if w(p)=2 then l=l+1:w(p)=1:return
1030 if w(p)=3 then k=k+1:w(p)=1:return
1040 if w(p)=4 and k>0 then k=k-1:w(p)=1:goto 1080
1050 if w(p)=4 then p=op:w(p)=1:print "no key!":gosub 2000:goto 1080
1060 if w(p)=5 and l>0 then l=l-1:w(p)=1:print "goblin!"::gosub 2000:goto 1080
1070 if w(p)=5 then print "goblins made you broke!":p=op:w(p)=1:gosub 2000
1080 return
2000 for i=1 to 1000:next i:return
| Published | 2 days ago |
| Status | Released |
| Author | ~vidak |
| Genre | Adventure, Educational |
| Tags | Commodore 64, Open Source, Retro, Roguelike, sourcecode, Text based |
Install instructions
Attach the disk image to VICE emulator as drive 8.
Then:
LOAD "GOBLINS",8
RUN

Comments
Log in with itch.io to leave a comment.
Nice, please add "Commodore 64" in tag section