Text Only
|
Text with Attachments
QB64.org Forum
Active Forums => Programs => Topic started by: pforpond on June 18, 2020, 01:33:10 pm
Title:
Attack of the Killer Dandelions
Post by:
pforpond
on
June 18, 2020, 01:33:10 pm
Code: QB64:
[Select]
REM
attack of the killer dandelions
REM
dp
2020
REM
roomtypes
REM
0
-
TUTORIAL ROOM
REM
1
-
LOOT ROOM
REM
2
-
ENEMY ROOM
REM
3
-
LOOT
AND
ENEMY ROOM
REM
4
-
STORE ROOM
setup:
REM
sets up game
REM
error
handler
ON
ERROR
GOTO
errorhandler
SCREEN
_NEWIMAGE
(
255
,
302
,
32
)
$RESIZE
:
ON
_RESIZE
ON
,
_STRETCH
_TITLE
"Attack of the Killer Dandelions"
'_MOUSEHIDE
REM
launches developer console
$CONSOLE
_CONSOLE
ON
REM
launches
timer
RANDOMIZE
TIMER
LET
itime
=
TIMER
LET
ctime
=
0
REM
checks
data
folder exists
IF
_DIREXISTS
(
"dandedata\"
)
THEN
REM
nothing :
)
ELSE
ERROR
666
END
IF
REM
loads
and
applies font
LET
fontsize
=
12
LET
gamefont
=
_LOADFONT
(
"dandedata\gamefont.ttf"
,
fontsize
)
_FONT
gamefont
REM
loads sfx
LET
bombhit
=
_SNDOPEN
(
"dandedata\bomb.ogg"
)
LET
swordhit
=
_SNDOPEN
(
"dandedata\sword.ogg"
)
LET
magichit
=
_SNDOPEN
(
"dandedata\magic.ogg"
)
LET
gameover
=
_SNDOPEN
(
"dandedata\gameover.ogg"
)
LET
highscore
=
_SNDOPEN
(
"dandedata\highscore.ogg"
)
LET
pickup
=
_SNDOPEN
(
"dandedata\pickup.ogg"
)
LET
store
=
_SNDOPEN
(
"dandedata\store.ogg"
)
LET
opendoor
=
_SNDOPEN
(
"dandedata\door.ogg"
)
REM
loads sprites
LET
dandelion1$
=
"TA30 L40 R20 E10 G10 U10 D10 H10 F10 TA0"
LET
dandelion2$
=
"L40 R20 E10 G10 U10 D10 H10 F10 TA0"
LET
dandelion3$
=
"TA330 L40 R20 E10 G10 U10 D10 H10 F10 TA0"
LET
door$
=
"U50 R40 D50 U25 H3 G3 L3 R3 F3 E3 TA0"
LET
decal1$
=
"U5 R10 D5 L10 R10 D5 R10 U5 L10 TA0"
LET
decal2$
=
"U5 R10 D5 L10 U5 R20 D5 L10 TA0"
LET
decal3$
=
"U5 R10 D5 L10 U5 R20 D5 L10 U5 L5 U5 R10 D5 TA0"
LET
decal4$
=
"TA180 U5 R10 D5 L10 R10 D5 R10 U5 L10 TA0"
LET
decal5$
=
"TA180 U5 R10 D5 L10 U5 R20 D5 L10 U5 L5 U5 R10 D5 TA0"
LET
decal6$
=
"U5 R10 D5 L10 TA0"
LET
decal7$
=
"U5 R10 D5 L10 U5 R5 U5 R10 D5 L10 TA0"
LET
decal8$
=
"TA180 U5 R10 D5 L10 U5 R5 U5 R10 D5 L10 TA0"
LET
decal9$
=
"E6 F6 H3 G3 D3 U3 H3 E3 U302 TA0"
LET
decal10$
=
"U5 R10 D5 L10 U5 R5 U5 R10 D5 L20 U5 R5 L2 U5 R10 D5 L10 TA0"
LET
decal11$
=
"TA180 U5 R10 D5 L10 U5 R5 U5 R10 D5 L20 U5 R5 L2 U5 R10 D5 L10 TA0"
LET
decal12$
=
"U5 R10 D5 L10 U5 R5 U5 R10 D5 L20 U5 R5 U5 R10 D5 L10 TA0"
LET
decal13$
=
"U40 R40 D40 L40 U20 R40 U20 L20 D40 TA0"
LET
decal14$
=
"U5 R10 D5 L10 U5 R10 U5 R10 D5 L10 R10 D5 R10 U5 L10 TA0"
LET
decal15$
=
"TA180 U5 R10 D5 L10 U5 R10 U5 R10 D5 L10 R10 D5 R10 U5 L10 TA0"
LET
chestclosed$
=
"U20 E10 R10 F10 D20 L30 U20 R30 L15 F2 G2 H2 E2 E2 H2 G2 F2 TA0"
LET
chestopen$
=
"U20 U5 R30 D25 L30 U20 R30 L15 F2 G2 H2 E2 TA0"
LET
stem$
=
"U40 D40 H10 F10 E10 TA0"
LET
shopbody1$
=
"G20 D40 TA0"
LET
shopbody2$
=
"F20 D40 TA0"
LET
titledisplay
=
_LOADIMAGE
(
"dandedata\title.png"
)
REM
displays loading visuals
DO
LET
temp
=
INT
(
RND
*
302
)
LINE
(
0
,
temp
)
-
(
302
,
temp
)
,
&HFF5454FC
_DELAY
0.05
LET
temp2
=
temp2
+
1
CLS
LOOP
UNTIL
temp2
>=
20
COLOR
&HFF5454FC
_PRINTSTRING
(
(
225
/
2
)
,
(
302
/
2
)
)
,
"ROM OK"
_DELAY
1
CLS
GOSUB
titlescreen
GOTO
playgame
errorhandler:
REM
handles errors
COLOR
&HFFFC5454
PRINT
"ERROR: "
;
ERR
PRINT
"LINE: "
;
_ERRORLINE
IF
ERR
=
666
THEN
PRINT
"DATA FOLDER NOT FOUND"
PRINT
"ATTACK OF THE KILLER DANDELIONS WILL NOW CLOSE"
END
drawhud:
REM
draws the game hud
(
score
and
health
)
COLOR
&HFF5454FC
_PRINTSTRING
(
1
,
1
)
,
"HEALTH: "
+
STR$
(
health
)
_PRINTSTRING
(
180
,
1
)
,
"SCORE: "
+
STR$
(
score
)
REM
draws seperator lines
LINE
(
0
,
13
)
-
(
302
,
13
)
,
&HFF5454FC
LINE
(
0
,
15
)
-
(
302
,
15
)
,
&HFF5454FC
RETURN
titlescreen:
REM
titlescreen
_PUTIMAGE
(
0
,
0
)
-
(
255
,
302
)
,
titledisplay
DO
:
LOOP
UNTIL
INKEY$
=
" "
RETURN
inputter:
REM
game
input
IF
a$
=
"Q"
THEN
GOTO
endgame
IF
a$
=
" "
THEN
GOSUB
menuprocess
IF
monsterhealth
>
0
THEN
GOSUB
monsterattacks
END
IF
IF
z
=
18432
THEN
LET
menuloc
=
menuloc
-
1
:
REM
up
IF
z
=
20480
THEN
LET
menuloc
=
menuloc
+
1
:
REM
down
IF
z
=
19712
THEN
REM
right
IF
menuloc
=
1
THEN
LET
menuloc
=
4
IF
menuloc
=
2
THEN
LET
menuloc
=
5
IF
menuloc
=
3
THEN
LET
menuloc
=
6
END
IF
IF
z
=
19200
THEN
REM
left
IF
menuloc
=
4
THEN
LET
menuloc
=
1
IF
menuloc
=
5
THEN
LET
menuloc
=
2
IF
menuloc
=
6
THEN
LET
menuloc
=
3
END
IF
IF
menuloc
<=
0
THEN
LET
menuloc
=
1
IF
menuloc
>=
7
THEN
LET
menuloc
=
6
RETURN
monsterattacks:
REM
when the monster deals damage
to
the player
LET
monsterattack
=
(
INT
(
RND
*
5
)
+
1
)
*
level
LET
health
=
health
-
(
monsterattack
-
armour
)
LET
armourxp
=
armourxp
+
INT
(
RND
*
10
)
+
1
GOSUB
drawhud
GOSUB
drawroom
GOSUB
drawmenu
COLOR
&HFFFC5454
_PRINTSTRING
(
20
,
210
)
,
"DANDELION DELT"
+
STR$
(
monsterattack
-
armour
)
+
" DAMAGE!"
_DELAY
1
CLS
RETURN
drawmonster:
REM
draws world monsters
IF
monsterhealth
>
0
THEN
PSET
(
monsterx
,
200
)
,
&HFF54FC54
DRAW
stem$
IF
monstertype
=
1
THEN
PSET
(
monsterx
+
18
,
150
)
,
&HFFFCFC54
DRAW
dandelion1$
END
IF
IF
monstertype
=
2
THEN
PSET
(
monsterx
+
20
,
160
)
,
&HFFFCFC54
DRAW
dandelion2$
END
IF
IF
monstertype
=
3
THEN
PSET
(
monsterx
+
18
,
170
)
,
&HFFFCFC54
DRAW
dandelion3$
END
IF
END
IF
RETURN
drawdoors:
REM
draws room doors
IF
roomtype
=
4
THEN
RETURN
IF
roomexit
=
1
THEN
REM
draws one
exit
IF
exitc1
=
1
THEN
PSET
(
(
255
/
2
)
-
20
,
199
)
,
&HFFFCFCFC
IF
exitc1
=
2
THEN
PSET
(
(
255
/
2
)
-
20
,
199
)
,
&HFFFC54FC
IF
exitc1
=
3
THEN
PSET
(
(
255
/
2
)
-
20
,
199
)
,
&HFFFC5454
IF
exitc1
=
4
THEN
PSET
(
(
255
/
2
)
-
20
,
199
)
,
&HFF5454FC
IF
exitc1
=
5
THEN
PSET
(
(
255
/
2
)
-
20
,
199
)
,
&HFF54FCFC
DRAW
door$
END
IF
IF
roomexit
=
2
THEN
REM
draws two exits
IF
exitc1
=
1
THEN
PSET
(
(
255
/
2
)
-
80
,
199
)
,
&HFFFCFCFC
IF
exitc1
=
2
THEN
PSET
(
(
255
/
2
)
-
80
,
199
)
,
&HFFFC54FC
IF
exitc1
=
3
THEN
PSET
(
(
255
/
2
)
-
80
,
199
)
,
&HFFFC5454
IF
exitc1
=
4
THEN
PSET
(
(
255
/
2
)
-
80
,
199
)
,
&HFF5454FC
IF
exitc1
=
5
THEN
PSET
(
(
255
/
2
)
-
80
,
199
)
,
&HFF54FCFC
DRAW
door$
IF
exitc2
=
1
THEN
PSET
(
(
255
/
2
)
+
40
,
199
)
,
&HFFFCFCFC
IF
exitc2
=
2
THEN
PSET
(
(
255
/
2
)
+
40
,
199
)
,
&HFFFC54FC
IF
exitc2
=
3
THEN
PSET
(
(
255
/
2
)
+
40
,
199
)
,
&HFFFC5454
IF
exitc2
=
4
THEN
PSET
(
(
255
/
2
)
+
40
,
199
)
,
&HFF5454FC
IF
exitc2
=
5
THEN
PSET
(
(
255
/
2
)
+
40
,
199
)
,
&HFF54FCFC
DRAW
door$
END
IF
IF
roomexit
=
3
THEN
REM
draws three exits
IF
exitc1
=
1
THEN
PSET
(
(
255
/
2
)
-
100
,
199
)
,
&HFFFCFCFC
IF
exitc1
=
2
THEN
PSET
(
(
255
/
2
)
-
100
,
199
)
,
&HFFFC54FC
IF
exitc1
=
3
THEN
PSET
(
(
255
/
2
)
-
100
,
199
)
,
&HFFFC5454
IF
exitc1
=
4
THEN
PSET
(
(
255
/
2
)
-
100
,
199
)
,
&HFF5454FC
IF
exitc1
=
5
THEN
PSET
(
(
255
/
2
)
-
100
,
199
)
,
&HFF54FCFC
DRAW
door$
IF
exitc2
=
1
THEN
PSET
(
(
255
/
2
)
-
20
,
199
)
,
&HFFFCFCFC
IF
exitc2
=
2
THEN
PSET
(
(
255
/
2
)
-
20
,
199
)
,
&HFFFC54FC
IF
exitc2
=
3
THEN
PSET
(
(
255
/
2
)
-
20
,
199
)
,
&HFFFC5454
IF
exitc2
=
4
THEN
PSET
(
(
255
/
2
)
-
20
,
199
)
,
&HFF5454FC
IF
exitc2
=
5
THEN
PSET
(
(
255
/
2
)
-
20
,
199
)
,
&HFF54FCFC
DRAW
door$
IF
exitc3
=
1
THEN
PSET
(
(
255
/
2
)
+
60
,
199
)
,
&HFFFCFCFC
IF
exitc3
=
2
THEN
PSET
(
(
255
/
2
)
+
60
,
199
)
,
&HFFFC54FC
IF
exitc3
=
3
THEN
PSET
(
(
255
/
2
)
+
60
,
199
)
,
&HFFFC5454
IF
exitc3
=
4
THEN
PSET
(
(
255
/
2
)
+
60
,
199
)
,
&HFF5454FC
IF
exitc3
=
5
THEN
PSET
(
(
255
/
2
)
+
60
,
199
)
,
&HFF54FCFC
DRAW
door$
END
IF
RETURN
menuprocess:
REM
processes menu choices
IF
menuloc
=
1
THEN
GOSUB
doormenu
IF
menuloc
=
2
THEN
GOSUB
attackmenu
IF
menuloc
=
3
THEN
GOSUB
lootmenu
IF
menuloc
=
4
THEN
GOSUB
pocketmenu
IF
menuloc
=
5
THEN
GOSUB
statsmenu
IF
menuloc
=
6
THEN
GOTO
endgame
RETURN
doormenu:
REM
shows door menu
IF
roomexit
<=
0
THEN
REM
return
for
if
no doors present
COLOR
&HFFFC5454
_PRINTSTRING
(
20
,
210
)
,
"NO DOORS PRESENT!"
_DELAY
1
CLS
RETURN
END
IF
IF
monsterhealth
>
0
THEN
REM
return
for
if
monster present
COLOR
&HFFFC5454
_PRINTSTRING
(
20
,
210
)
,
"CANNOT LEAVE - ENEMY PRESENT!"
_DELAY
1
CLS
RETURN
END
IF
LET
menuloc2
=
1
LINE
(
0
,
201
)
-
(
256
,
303
)
,
&HFF000000
,
BF
DO
COLOR
&HFFFC5454
_PRINTSTRING
(
20
,
210
)
,
"ENTER DOOR..."
COLOR
&HFFFCFCFC
FOR
x
=
1
TO
roomexit
IF
menuloc2
=
1
THEN
COLOR
&HFF54FC54
ELSE
IF
exitc1
=
1
THEN
COLOR
&HFFFCFCFC
IF
exitc1
=
2
THEN
COLOR
&HFFFC54FC
IF
exitc1
=
3
THEN
COLOR
&HFFFC5454
IF
exitc1
=
4
THEN
COLOR
&HFF5454FC
IF
exitc1
=
5
THEN
COLOR
&HFF54FCFC
END
IF
IF
x
=
1
THEN
_PRINTSTRING
(
20
,
230
)
,
"DOOR 1"
IF
menuloc2
=
2
THEN
COLOR
&HFF54FC54
ELSE
IF
exitc2
=
1
THEN
COLOR
&HFFFCFCFC
IF
exitc2
=
2
THEN
COLOR
&HFFFC54FC
IF
exitc2
=
3
THEN
COLOR
&HFFFC5454
IF
exitc2
=
4
THEN
COLOR
&HFF5454FC
IF
exitc2
=
5
THEN
COLOR
&HFF54FCFC
END
IF
IF
x
=
2
THEN
_PRINTSTRING
(
20
,
240
)
,
"DOOR 2"
IF
menuloc2
=
3
THEN
COLOR
&HFF54FC54
ELSE
IF
exitc3
=
1
THEN
COLOR
&HFFFCFCFC
IF
exitc3
=
2
THEN
COLOR
&HFFFC54FC
IF
exitc3
=
3
THEN
COLOR
&HFFFC5454
IF
exitc3
=
4
THEN
COLOR
&HFF5454FC
IF
exitc3
=
5
THEN
COLOR
&HFF54FCFC
END
IF
IF
x
=
3
THEN
_PRINTSTRING
(
20
,
250
)
,
"DOOR 3"
NEXT
x
IF
menuloc2
>
roomexit
THEN
COLOR
&HFF54FC54
ELSE
COLOR
&HFFFCFCFC
END
IF
_PRINTSTRING
(
20
,
270
)
,
"CANCEL"
DO
LET
b$
=
UCASE$
(
INKEY$
)
LET
xx
=
_KEYHIT
LOOP
UNTIL
xx
OR
b$
=
" "
IF
b$
=
" "
AND
menuloc2
>
roomexit
THEN
CLS
:
RETURN
IF
b$
=
" "
AND
menuloc2
<=
roomexit
THEN
_SNDPLAY
opendoor:
GOSUB
newroom:
CLS
:
RETURN
IF
xx
=
18432
THEN
LET
menuloc2
=
menuloc2
-
1
:
REM
up
IF
xx
=
20480
THEN
LET
menuloc2
=
menuloc2
+
1
:
REM
down
IF
menuloc2
<=
0
THEN
LET
menuloc2
=
1
IF
menuloc2
>
roomexit
+
1
THEN
LET
menuloc2
=
roomexit
+
1
LOOP
RETURN
newroom:
REM
generates a new room
REM
adds up values
LET
room
=
room
+
1
LET
xp
=
xp
+
1
LET
score
=
score
+
5
REM
generates new room values
IF
roomtype
=
4
OR
roomtype
=
0
OR
level
=
1
THEN
LET
roomtype
=
INT
(
RND
*
3
)
+
1
ELSE
LET
roomtype
=
INT
(
RND
*
4
)
+
1
END
IF
LET
roomexit
=
INT
(
RND
*
3
)
+
1
REM
generates door colours
LET
exitc1
=
INT
(
RND
*
5
)
+
1
LET
exitc2
=
INT
(
RND
*
5
)
+
1
LET
exitc3
=
INT
(
RND
*
5
)
+
1
REM
generates room decal
LET
roomdecal
=
INT
(
RND
*
15
)
+
1
LET
decalx
=
INT
(
RND
*
240
)
+
1
10
LET
decaly
=
INT
(
RND
*
125
)
+
1
IF
decaly
<
20
THEN
GOTO
10
LET
decalc
=
INT
(
RND
*
6
)
+
1
LET
lootamount
=
0
LET
lootreward
=
0
LET
lootopen
=
0
IF
roomtype
=
1
OR
roomtype
=
3
THEN
REM
loot room
LET
lootreward
=
INT
(
RND
*
6
)
+
1
LET
lootamount
=
INT
(
RND
*
10
)
+
1
20
LET
lootx
=
INT
(
RND
*
230
)
+
1
IF
roomexit
=
1
THEN
REM
loot location
for
rooms with one door
IF
lootx
>=
(
(
255
/
2
)
-
50
)
AND
lootx
<=
(
(
255
/
2
)
+
20
)
THEN
GOTO
20
END
IF
IF
roomexit
=
2
THEN
IF
lootx
>=
(
(
255
/
2
)
-
110
)
AND
lootx
<=
(
(
255
/
2
)
-
40
)
THEN
GOTO
20
IF
lootx
>=
(
(
255
/
2
)
+
10
)
AND
lootx
<=
(
(
255
/
2
)
+
80
)
THEN
GOTO
20
END
IF
IF
roomexit
=
3
THEN
IF
lootx
>=
(
(
255
/
2
)
-
130
)
AND
lootx
<=
(
(
255
/
2
)
-
60
)
THEN
GOTO
20
IF
lootx
>=
(
(
255
/
2
)
-
50
)
AND
lootx
<=
(
(
255
/
2
)
+
20
)
THEN
GOTO
20
IF
lootx
>=
(
(
255
/
2
)
+
30
)
AND
lootx
<=
(
(
255
/
2
)
+
100
)
THEN
GOTO
20
END
IF
END
IF
LET
monsterhealth
=
0
IF
roomtype
=
2
OR
roomtype
=
3
THEN
REM
monster room
LET
monsterhealth
=
(
INT
(
RND
*
5
)
+
1
)
*
level
LET
monstertype
=
INT
(
RND
*
3
)
+
1
30
LET
monsterx
=
INT
(
RND
*
230
)
+
1
IF
monsterx
<=
20
THEN
GOTO
30
END
IF
IF
roomtype
=
4
THEN
LET
storeoffer
=
INT
(
RND
*
5
)
+
1
LET
storecost
=
INT
(
RND
*
10
)
+
1
LET
storeamount
=
INT
(
RND
*
5
)
+
1
END
IF
RETURN
attackmenu:
REM
shows attack menu
IF
monsterhealth
<=
0
THEN
REM
return
for
if
no monsters present
COLOR
&HFFFC5454
_PRINTSTRING
(
20
,
210
)
,
"NO MONSTER PRESENT!"
_DELAY
1
CLS
RETURN
END
IF
LET
menuloc2
=
1
LINE
(
0
,
201
)
-
(
256
,
303
)
,
&HFF000000
,
BF
DO
COLOR
&HFFFC5454
_PRINTSTRING
(
20
,
210
)
,
"ATTACK..."
IF
menuloc2
=
1
THEN
COLOR
&HFF54FC54
ELSE
COLOR
&HFFFCFCFC
END
IF
_PRINTSTRING
(
20
,
230
)
,
"SWORD ATTACK"
IF
menuloc2
=
2
THEN
COLOR
&HFF54FC54
ELSE
IF
magic
>
0
THEN
COLOR
&HFFFCFCFC
ELSE
COLOR
&HFF545454
END
IF
END
IF
_PRINTSTRING
(
20
,
240
)
,
"MAGIC ATTACK ("
+
STR$
(
magic
)
+
" )"
IF
menuloc2
=
3
THEN
COLOR
&HFF54FC54
ELSE
IF
bomb
>
0
THEN
COLOR
&HFFFCFCFC
ELSE
COLOR
&HFF545454
END
IF
END
IF
_PRINTSTRING
(
20
,
250
)
,
"BOMB ATTACK ("
+
STR$
(
bomb
)
+
" )"
IF
menuloc2
=
4
THEN
COLOR
&HFF54FC54
ELSE
COLOR
&HFFFCFCFC
END
IF
_PRINTSTRING
(
20
,
270
)
,
"CANCEL"
DO
LET
b$
=
UCASE$
(
INKEY$
)
LET
xx
=
_KEYHIT
LOOP
UNTIL
xx
OR
b$
=
" "
IF
b$
=
" "
AND
menuloc2
=
4
THEN
CLS
:
RETURN
IF
b$
=
" "
AND
menuloc2
=
1
THEN
GOSUB
swordattack:
CLS
:
RETURN
IF
b$
=
" "
AND
menuloc2
=
2
THEN
GOSUB
magicattack:
CLS
:
RETURN
IF
b$
=
" "
AND
menuloc2
=
3
THEN
GOSUB
bombattack:
CLS
:
RETURN
IF
xx
=
18432
THEN
LET
menuloc2
=
menuloc2
-
1
:
REM
up
IF
xx
=
20480
THEN
LET
menuloc2
=
menuloc2
+
1
:
REM
down
IF
menuloc2
<=
0
THEN
LET
menuloc2
=
1
IF
menuloc2
>=
5
THEN
LET
menuloc2
=
4
LOOP
RETURN
magicattack:
REM
calculates a magic attack
IF
magic
<=
0
THEN
REM
return
for
if
no magic
CLS
GOSUB
drawhud
GOSUB
drawroom
GOSUB
drawmenu
COLOR
&HFFFC5454
_PRINTSTRING
(
20
,
210
)
,
"CANNOT ATTACK - NO MAGIC!"
_DELAY
1
RETURN
END
IF
LET
attack
=
(
magic
*
level
)
LET
magic
=
0
LET
monsterhealth
=
monsterhealth
-
attack
REM
displays attack animation
LET
animation
=
10
LET
anix
=
monsterx
LET
aniy
=
175
_SNDPLAY
magichit
DO
CIRCLE
(
anix
,
aniy
)
,
animation
,
&HFFFC54FC
LET
animation
=
animation
-
1
_DELAY
0.05
LOOP
UNTIL
animation
=
1
REM
redraw room
CLS
GOSUB
drawhud
GOSUB
drawroom
REM
display messages
COLOR
&HFF54FC54
_PRINTSTRING
(
20
,
230
)
,
"DELT"
+
STR$
(
attack
)
+
" MAGIC DAMAGE!"
_DELAY
1
IF
monsterhealth
>
0
THEN
_PRINTSTRING
(
20
,
240
)
,
"ENEMY HAS"
+
STR$
(
monsterhealth
)
+
" HEALTH LEFT!"
ELSE
_PRINTSTRING
(
20
,
240
)
,
"ENEMY IS DEAD!"
LET
xp
=
xp
+
INT
(
RND
*
10
)
+
1
LET
score
=
score
+
(
10
*
level
)
END
IF
_DELAY
1
RETURN
bombattack:
REM
calculates a bomb attack
IF
bomb
<=
0
THEN
REM
return
for
if
no bombs
CLS
GOSUB
drawhud
GOSUB
drawroom
GOSUB
drawmenu
COLOR
&HFFFC5454
_PRINTSTRING
(
20
,
210
)
,
"CANNOT ATTACK - NO BOMBS!"
_DELAY
1
RETURN
END
IF
LET
attack
=
5
LET
monsterhealth
=
monsterhealth
-
attack
REM
displays attack animation
LET
animation
=
1
LET
anix
=
monsterx
LET
aniy
=
175
_SNDPLAY
bombhit
DO
CIRCLE
(
anix
,
aniy
)
,
animation
,
&HFFA85400
LET
animation
=
animation
+
1
_DELAY
0.05
LOOP
UNTIL
animation
=
10
REM
redraw room
CLS
GOSUB
drawhud
GOSUB
drawroom
REM
display messages
COLOR
&HFF54FC54
_PRINTSTRING
(
20
,
230
)
,
"DELT"
+
STR$
(
attack
)
+
" BOMB DAMAGE!"
_DELAY
1
IF
monsterhealth
>
0
THEN
_PRINTSTRING
(
20
,
240
)
,
"ENEMY HAS"
+
STR$
(
monsterhealth
)
+
" HEALTH LEFT!"
ELSE
_PRINTSTRING
(
20
,
240
)
,
"ENEMY IS DEAD!"
LET
xp
=
xp
+
INT
(
RND
*
10
)
+
1
LET
score
=
score
+
(
10
*
level
)
END
IF
_DELAY
1
RETURN
swordattack:
REM
calculates a sword attack
LET
attack
=
(
INT
(
RND
*
5
)
+
1
)
*
sword
LET
monsterhealth
=
monsterhealth
-
attack
REM
displays attack animation
LET
animation
=
0
LET
anix
=
monsterx
-
20
LET
aniy
=
200
_SNDPLAY
swordhit
DO
LINE
(
monsterx
-
20
,
200
)
-
(
anix
,
aniy
)
,
&HFFA8A8A8
LET
animation
=
animation
+
1
LET
anix
=
anix
+
1
LET
aniy
=
aniy
-
1
_DELAY
0.005
LOOP
UNTIL
animation
=
40
REM
redraw room
CLS
GOSUB
drawhud
GOSUB
drawroom
REM
display messages
COLOR
&HFF54FC54
_PRINTSTRING
(
20
,
230
)
,
"DELT"
+
STR$
(
attack
)
+
" SWORD DAMAGE!"
_DELAY
1
IF
monsterhealth
>
0
THEN
_PRINTSTRING
(
20
,
240
)
,
"ENEMY HAS"
+
STR$
(
monsterhealth
)
+
" HEALTH LEFT!"
ELSE
_PRINTSTRING
(
20
,
240
)
,
"ENEMY IS DEAD!"
LET
swordxp
=
swordxp
+
INT
(
RND
*
10
)
+
1
LET
xp
=
xp
+
INT
(
RND
*
10
)
+
1
LET
score
=
score
+
(
10
*
level
)
END
IF
_DELAY
1
RETURN
pocketmenu:
REM
shows pockets
LINE
(
0
,
201
)
-
(
256
,
303
)
,
&HFF000000
,
BF
COLOR
&HFF54FC54
_PRINTSTRING
(
20
,
210
)
,
pockettext$
COLOR
&HFFFCFCFC
_PRINTSTRING
(
20
,
230
)
,
"SWORD LEVEL: "
+
STR$
(
sword
)
_PRINTSTRING
(
20
,
240
)
,
"ARMOUR LEVEL: "
+
STR$
(
armour
)
_PRINTSTRING
(
20
,
250
)
,
"MAGIC: "
+
STR$
(
magic
)
_PRINTSTRING
(
20
,
260
)
,
"HEALTHKITS: "
+
STR$
(
healthkit
)
_PRINTSTRING
(
20
,
270
)
,
"GOLD: "
+
STR$
(
gold
)
_PRINTSTRING
(
20
,
280
)
,
"BOMBS: "
+
STR$
(
bomb
)
IF
healthkit
>=
1
THEN
REM
use healthkit
?
COLOR
&HFF54FC54
_PRINTSTRING
(
150
,
260
)
,
"H = USE KIT"
DO
LET
b$
=
UCASE$
(
INKEY$
)
LOOP
UNTIL
b$
=
" "
OR
b$
=
"H"
IF
b$
=
"H"
THEN
REM
use healthkit
LET
healthkit
=
healthkit
-
1
LET
addhealth
=
25
LET
recovered
=
0
DO
LET
health
=
health
+
1
LET
addhealth
=
addhealth
-
1
LET
recovered
=
recovered
+
1
LOOP
UNTIL
health
=
100
OR
addhealth
=
0
CLS
GOSUB
drawhud
GOSUB
drawroom
GOSUB
drawmenu
COLOR
&HFF54FC54
_PRINTSTRING
(
20
,
210
)
,
"RECOVERED"
+
STR$
(
recovered
)
+
" HEALTH!"
_DELAY
1
CLS
RETURN
END
IF
ELSE
DO
:
LOOP
UNTIL
INKEY$
=
" "
END
IF
CLS
RETURN
statsmenu:
REM
shows stats menu
LINE
(
0
,
201
)
-
(
256
,
303
)
,
&HFF000000
,
BF
COLOR
&HFF54FC54
_PRINTSTRING
(
20
,
210
)
,
stattext$
COLOR
&HFFFCFCFC
_PRINTSTRING
(
20
,
230
)
,
"LEVEL: "
+
STR$
(
level
)
_PRINTSTRING
(
20
,
240
)
,
"XP: "
+
STR$
(
xp
)
_PRINTSTRING
(
20
,
250
)
,
"KILLS: "
+
STR$
(
killcount
)
_PRINTSTRING
(
20
,
260
)
,
"ROOM: "
+
STR$
(
room
)
_PRINTSTRING
(
20
,
270
)
,
"SWORD XP: "
+
STR$
(
swordxp
)
_PRINTSTRING
(
20
,
280
)
,
"ARMOUR XP: "
+
STR$
(
armourxp
)
DO
:
LOOP
UNTIL
INKEY$
=
" "
CLS
RETURN
lootmenu:
REM
shows loot menu
IF
lootamount
<=
0
THEN
REM
return
for
if
no loot present
COLOR
&HFFFC5454
_PRINTSTRING
(
20
,
210
)
,
"NO LOOT PRESENT!"
_DELAY
1
CLS
RETURN
END
IF
IF
lootopen
=
1
THEN
REM
return
for
if
loot already collected
COLOR
&HFFFC5454
_PRINTSTRING
(
20
,
210
)
,
"LOOT ALREADY TAKEN!"
_DELAY
1
CLS
RETURN
END
IF
LET
lootopen
=
1
LET
score
=
score
+
INT
(
RND
*
10
)
+
1
COLOR
&HFF54FC54
_SNDPLAY
pickup
IF
lootreward
=
1
THEN
LET
gold
=
gold
+
lootamount:
_PRINTSTRING
(
20
,
210
)
,
"FOUND"
+
STR$
(
lootamount
)
+
" GOLD!"
IF
lootreward
=
2
THEN
LET
armourxp
=
armourxp
+
lootamount:
_PRINTSTRING
(
20
,
210
)
,
"FOUND"
+
STR$
(
lootamount
)
+
" ARMOUR XP!"
IF
lootreward
=
3
THEN
LET
swordxp
=
swordxp
+
lootamount:
_PRINTSTRING
(
20
,
210
)
,
"FOUND"
+
STR$
(
lootamount
)
+
" SWORD XP!"
IF
lootreward
=
4
THEN
LET
bomb
=
bomb
+
lootamount
IF
lootamount
=
1
THEN
_PRINTSTRING
(
20
,
210
)
,
"FOUND"
+
STR$
(
lootamount
)
+
" BOMB!"
ELSE
_PRINTSTRING
(
20
,
210
)
,
"FOUND"
+
STR$
(
lootamount
)
+
" BOMBS!"
END
IF
END
IF
IF
lootreward
=
5
THEN
LET
magic
=
magic
+
lootamount:
_PRINTSTRING
(
20
,
210
)
,
"FOUND"
+
STR$
(
lootamount
)
+
" MAGIC!"
IF
lootreward
=
6
THEN
LET
healthkit
=
healthkit
+
1
:
_PRINTSTRING
(
20
,
210
)
,
"FOUND HEALTHKIT!"
LET
xp
=
xp
+
INT
(
RND
*
10
)
+
1
_DELAY
1
CLS
RETURN
playgame:
REM
playgame
CLS
LET
frames
=
60
:
REM
frames per second
LET
health
=
100
:
REM
player heatlth
LET
room
=
1
:
REM
room number
LET
score
=
0
:
REM
player score
LET
roomtype
=
0
:
REM
room
type
LET
roomexit
=
1
:
REM
number of doors in room
LET
roommonster
=
0
:
REM
number of monsters in room
LET
lootreward
=
0
:
REM
type
of loot
LET
lootamount
=
0
:
REM
amount of loot
LET
menuloc
=
1
:
REM
menu cursor location
LET
level
=
1
:
REM
player level
LET
xp
=
0
:
REM
player xp
LET
healthkit
=
0
:
REM
amount of health kits
LET
gold
=
0
:
REM
amount of gold
LET
bomb
=
0
:
REM
amount of bombs
LET
sword
=
1
:
REM
sword level
LET
armour
=
1
:
REM
armour level
LET
swordxp
=
0
:
REM
amount of sword xp
LET
armourxp
=
0
:
REM
amount of armour xp
LET
magic
=
0
:
REM
amount of magic
LET
killcount
=
0
:
REM
amount of kills
LET
roomdecal
=
0
:
REM
room decal
LET
decalx
=
0
:
REM
x
loc
of room decal
LET
decaly
=
0
:
REM
y
loc
of room decal
LET
decalc
=
0
:
REM
colour of room decal
LET
doortext$
=
"DOOR"
LET
attacktext$
=
"ATTACK"
LET
loottext$
=
"LOOT"
LET
pockettext$
=
"BACKPACK"
LET
stattext$
=
"STATUS"
LET
endgametext$
=
"LEAVE"
LET
exitc1
=
INT
(
RND
*
5
)
+
1
:
REM
door
1
colour
LET
exitc2
=
INT
(
RND
*
5
)
+
1
:
REM
door
2
colour
LET
exitc3
=
INT
(
RND
*
5
)
+
1
:
REM
door
3
colour
DO
GOSUB
drawhud
GOSUB
inputter
GOSUB
drawroom
GOSUB
drawmenu
GOSUB
timekeeper
LET
a$
=
UCASE$
(
INKEY$
)
LET
z
=
_KEYHIT
_LIMIT
frames
LOOP
timekeeper:
REM
keeps game time
LET
ctime
=
(
TIMER
-
itime
)
LET
ctime
=
INT
(
ctime
)
IF
xp
>=
100
THEN
REM
level up!
LET
xp
=
0
LET
level
=
level
+
1
COLOR
&HFF54FC54
_PRINTSTRING
(
20
,
210
)
,
"LEVEL POINT GAINED!"
_DELAY
1
CLS
END
IF
IF
swordxp
>=
100
THEN
REM
sword power up
LET
swordxp
=
0
LET
sword
=
sword
+
1
COLOR
&HFF54FC54
_PRINTSTRING
(
20
,
210
)
,
"YOU HAVE FOUND A BETTER SWORD!"
_DELAY
1
CLS
END
IF
IF
armourxp
>=
100
THEN
REM
armour power up
LET
armourxp
=
0
LET
armour
=
armour
+
1
COLOR
&HFF54FC54
_PRINTSTRING
(
20
,
210
)
,
"YOU HAVE FOUND BETTER ARMOUR!"
_DELAY
1
CLS
END
IF
IF
health
<=
0
THEN
REM
game over
GOSUB
gameover
END
IF
RETURN
gameover:
REM
game over
CLS
COLOR
&HFF5454FC
_SNDPLAY
gameover
_PRINTSTRING
(
1
,
1
)
,
"GAME OVER!"
_PRINTSTRING
(
1
,
15
)
,
"SCORE: "
+
STR$
(
score
)
DO
:
LOOP
UNTIL
INKEY$
=
" "
GOSUB
highscores
GOTO
endgame
RETURN
highscores:
REM
high score table
CLS
OPEN
"dandedata\highscores.ddf"
FOR
INPUT
AS
#1
INPUT
#1
,
high1
,
name1$
,
high2
,
name2$
,
high3
,
name3$
,
high4
,
name4$
,
high5
,
name5$
,
high6
,
name6$
,
high7
,
name7$
,
high8
,
name8$
,
high9
,
name9$
,
high10
,
name10$
CLOSE
#1
LET
x
=
10000
PRINT
"HIGH SCORES!"
PRINT
LET
highest$
=
""
LET
lowest$
=
""
LET
highest
=
0
LET
lowest
=
0
DO
IF
high1
=
x
THEN
PRINT
STR$
(
high1
)
+
" - "
+
name1$
IF
high1
>
0
THEN
LET
lowest$
=
name1$:
LET
lowest
=
high1
IF
highest$
=
""
THEN
LET
highest$
=
name1$:
LET
highest
=
high1
END
IF
IF
high2
=
x
THEN
PRINT
STR$
(
high2
)
+
" - "
+
name2$
LET
lowest$
=
name2$:
LET
lowest
=
high2
IF
highest$
=
""
THEN
LET
highest$
=
name2$:
LET
highest
=
high2
END
IF
IF
high3
=
x
THEN
PRINT
STR$
(
high3
)
+
" - "
+
name3$
LET
lowest$
=
name3$:
LET
lowest
=
high3
IF
highest$
=
""
THEN
LET
highest$
=
name3$:
LET
highest
=
high3
END
IF
IF
high4
=
x
THEN
PRINT
STR$
(
high4
)
+
" - "
+
name4$
LET
lowest$
=
name4$:
LET
lowest
=
high4
IF
highest$
=
""
THEN
LET
highest$
=
name4$:
LET
highest
=
high4
END
IF
IF
high5
=
x
THEN
PRINT
STR$
(
high5
)
+
" - "
+
name5$
LET
lowest$
=
name5$:
LET
lowest
=
high5
IF
highest$
=
""
THEN
LET
highest$
=
name5$:
LET
highest
=
high5
END
IF
IF
high6
=
x
THEN
PRINT
STR$
(
high6
)
+
" - "
+
name6$
LET
lowest$
=
name6$:
LET
lowest
=
high6
IF
highest$
=
""
THEN
LET
highest$
=
name6$:
LET
highest
=
high6
END
IF
IF
high7
=
x
THEN
PRINT
STR$
(
high7
)
+
" - "
+
name7$
LET
lowest$
=
name7$:
LET
lowest
=
high7
IF
highest$
=
""
THEN
LET
highest$
=
name7$:
LET
highest
=
high7
END
IF
IF
high8
=
x
THEN
PRINT
STR$
(
high8
)
+
" - "
+
name8$
LET
lowest$
=
name8$:
LET
lowest
=
high8
IF
highest$
=
""
THEN
LET
highest$
=
name8$:
LET
highest
=
high8
END
IF
IF
high9
=
x
THEN
PRINT
STR$
(
high9
)
+
" - "
+
name9$
LET
lowest$
=
name9$:
LET
lowest
=
high9
IF
highest$
=
""
THEN
LET
highest$
=
name9$:
LET
highest
=
high9
END
IF
IF
high10
=
x
THEN
PRINT
STR$
(
high10
)
+
" - "
+
name10$
LET
lowest$
=
name10$:
LET
lowest
=
high10
IF
highest$
=
""
THEN
LET
highest$
=
name10$:
LET
highest
=
high10
END
IF
LET
x
=
x
-
1
LOOP
UNTIL
x
<
0
PRINT
IF
score
>
lowest
THEN
_SNDPLAY
highscore
IF
score
>
lowest
THEN
PRINT
"HIGH SCORE!"
IF
score
>
highest
THEN
PRINT
"HIGHEST SCORE!"
INPUT
"WHAT IS YOUR NAME? "
; playername$
IF
high1
=
lowest
THEN
LET
high1
=
score:
LET
name1$
=
playername$:
LET
lowest
=
-
1
IF
high2
=
lowest
THEN
LET
high2
=
score:
LET
name2$
=
playername$:
LET
lowest
=
-
1
IF
high3
=
lowest
THEN
LET
high3
=
score:
LET
name3$
=
playername$:
LET
lowest
=
-
1
IF
high4
=
lowest
THEN
LET
high4
=
score:
LET
name4$
=
playername$:
LET
lowest
=
-
1
IF
high5
=
lowest
THEN
LET
high5
=
score:
LET
name5$
=
playername$:
LET
lowest
=
-
1
IF
high6
=
lowest
THEN
LET
high6
=
score:
LET
name6$
=
playername$:
LET
lowest
=
-
1
IF
high7
=
lowest
THEN
LET
high7
=
score:
LET
name7$
=
playername$:
LET
lowest
=
-
1
IF
high8
=
lowest
THEN
LET
high8
=
score:
LET
name8$
=
playername$:
LET
lowest
=
-
1
IF
high9
=
lowest
THEN
LET
high9
=
score:
LET
name9$
=
playername$:
LET
lowest
=
-
1
IF
high10
=
lowest
THEN
LET
high10
=
score:
LET
name10$
=
playername$:
LET
lowest
=
-
1
OPEN
"dandedata\highscores.ddf"
FOR
OUTPUT
AS
#1
WRITE
#1
,
high1
,
name1$
,
high2
,
name2$
,
high3
,
name3$
,
high4
,
name4$
,
high5
,
name5$
,
high6
,
name6$
,
high7
,
name7$
,
high8
,
name8$
,
high9
,
name9$
,
high10
,
name10$
CLOSE
#1
PRINT
END
IF
PRINT
"THANK YOU FOR PLAYING!"
DO
:
LOOP
UNTIL
INKEY$
=
" "
RETURN
storemenu:
REM
draws the store menu
LET
menuloc2
=
1
GOSUB
drawhud
COLOR
&HFFFCFCFC
IF
storeoffer
=
1
THEN
_PRINTSTRING
(
50
,
230
)
,
STR$
(
storeamount
)
+
" BOMBS FOR"
+
STR$
(
storecost
)
+
" GOLD?"
IF
storeoffer
=
2
THEN
_PRINTSTRING
(
50
,
230
)
,
STR$
(
storeamount
)
+
" MAGIC FOR"
+
STR$
(
storecost
)
+
" GOLD?"
IF
storeoffer
=
3
THEN
_PRINTSTRING
(
50
,
230
)
,
STR$
(
storeamount
)
+
" ARMOUR XP FOR"
+
STR$
(
storecost
)
+
" GOLD?"
IF
storeoffer
=
4
THEN
_PRINTSTRING
(
50
,
230
)
,
STR$
(
storeamount
)
+
" SWORD XP FOR"
+
STR$
(
storecost
)
+
" GOLD?"
IF
storeoffer
=
5
THEN
_PRINTSTRING
(
50
,
230
)
,
"1 HEALTHKIT FOR"
+
STR$
(
storecost
)
+
" GOLD?"
_PRINTSTRING
(
50
,
240
)
,
"GOLD:"
+
STR$
(
gold
)
DO
IF
gold
>=
storecost
THEN
COLOR
&HFFFCFCFC
ELSE
COLOR
&HFF545454
END
IF
IF
menuloc2
=
1
THEN
COLOR
&HFF54FC54
_PRINTSTRING
(
50
,
260
)
,
"SURE!"
IF
menuloc2
=
2
THEN
COLOR
&HFF54FC54
ELSE
COLOR
&HFFFCFCFC
END
IF
_PRINTSTRING
(
130
,
260
)
,
"NO THANKS!"
DO
LET
b$
=
UCASE$
(
INKEY$
)
LET
xx
=
_KEYHIT
LOOP
UNTIL
xx
OR
b$
=
" "
IF
xx
=
19712
THEN
LET
menuloc2
=
2
IF
xx
=
19200
THEN
LET
menuloc2
=
1
IF
b$
=
" "
AND
menuloc2
=
2
THEN
GOSUB
newroom:
CLS
:
RETURN
IF
b$
=
" "
AND
menuloc2
=
1
THEN
REM
attempt purchase
IF
gold
<
storecost
THEN
REM
return
for
if
not
enough money
COLOR
&HFFFC5454
_PRINTSTRING
(
20
,
210
)
,
"NOT ENOUGH GOLD!"
_DELAY
1
CLS
RETURN
END
IF
LET
gold
=
gold
-
storecost
COLOR
&HFF54FC54
_SNDPLAY
store
IF
storeoffer
=
1
THEN
LET
bomb
=
bomb
+
storeamount
IF
storeamount
=
1
THEN
_PRINTSTRING
(
20
,
210
)
,
"BOUGHT"
+
STR$
(
storeamount
)
+
" BOMB!"
ELSE
_PRINTSTRING
(
20
,
210
)
,
"BOUGHT"
+
STR$
(
storeamount
)
+
" BOMBS!"
END
IF
END
IF
IF
storeoffer
=
2
THEN
LET
magic
=
magic
+
storeamount:
_PRINTSTRING
(
20
,
210
)
,
"BOUGHT"
+
STR$
(
storeamount
)
+
" MAGIC!"
IF
storeoffer
=
3
THEN
LET
armourxp
=
armourxp
+
storeamount:
_PRINTSTRING
(
20
,
210
)
,
"BOUGHT"
+
STR$
(
storeamount
)
+
" ARMOUR XP!"
IF
storeoffer
=
4
THEN
LET
swordxp
=
swordxp
+
storeamount:
_PRINTSTRING
(
20
,
210
)
,
"BOUGHT"
+
STR$
(
storeamount
)
+
" SWORD XP!"
IF
storeoffer
=
5
THEN
LET
healthkit
=
healthkit
+
1
:
_PRINTSTRING
(
20
,
210
)
,
"BOUGHT 1 HEALTHKIT!"
_DELAY
1
GOSUB
newroom
CLS
RETURN
END
IF
LOOP
RETURN
drawmenu:
REM
draws the menu
REM
divert
for
store menu
IF
roomtype
=
4
THEN
GOSUB
storemenu:
RETURN
REM
door menu
IF
roomexit
>
0
THEN
COLOR
&HFFFCFCFC
ELSE
COLOR
&HFF545454
END
IF
IF
menuloc
=
1
THEN
COLOR
&HFF54FC54
_PRINTSTRING
(
20
,
230
)
,
doortext$
REM
attack menu
IF
monsterhealth
>
0
THEN
COLOR
&HFFFCFCFC
ELSE
COLOR
&HFF545454
END
IF
IF
menuloc
=
2
THEN
COLOR
&HFF54FC54
_PRINTSTRING
(
20
,
250
)
,
attacktext$
REM
loot menu
IF
lootamount
>
0
AND
lootopen
<=
0
THEN
COLOR
&HFFFCFCFC
ELSE
COLOR
&HFF545454
END
IF
IF
menuloc
=
3
THEN
COLOR
&HFF54FC54
_PRINTSTRING
(
20
,
270
)
,
loottext$
REM
pockets menu
COLOR
&HFFFCFCFC
IF
menuloc
=
4
THEN
COLOR
&HFF54FC54
_PRINTSTRING
(
100
,
230
)
,
pockettext$
REM
stats menu
COLOR
&HFFFCFCFC
IF
menuloc
=
5
THEN
COLOR
&HFF54FC54
_PRINTSTRING
(
100
,
250
)
,
stattext$
COLOR
&HFFFCFCFC
IF
menuloc
=
6
THEN
COLOR
&HFF54FC54
_PRINTSTRING
(
100
,
270
)
,
endgametext$
RETURN
drawroom:
REM
draws a room
LINE
(
0
,
200
)
-
(
256
,
200
)
,
&HFFFCFCFC
IF
roomtype
=
0
THEN
REM
print
tutorial
COLOR
&HFF5454FC
_PRINTSTRING
(
10
,
40
)
,
"WELCOME TO THE DANDELION DUNGEON!"
_PRINTSTRING
(
10
,
60
)
,
"NOW GO THROUGH THE DOOR TO PLAY!"
END
IF
IF
roomtype
=
4
THEN
REM
display store message
COLOR
&HFF5454FC
_PRINTSTRING
(
10
,
40
)
,
"WELCOME TO THE STORE! SEE OUR DEAL!"
CIRCLE
(
255
/
2
,
100
)
,
25
,
&HFF5454FC
LINE
(
115
,
90
)
-
(
120
,
90
)
,
&HFF5454FC
LINE
(
135
,
90
)
-
(
140
,
90
)
,
&HFF5454FC
LINE
(
120
,
110
)
-
(
135
,
110
)
,
&HFF5454FC
PSET
(
108
,
115
)
,
&HFF5454FC
DRAW
shopbody1$
PSET
(
150
,
115
)
,
&HFF5454FC
DRAW
shopbody2$
END
IF
GOSUB
drawdecal:
REM
draws room decal
GOSUB
drawdoors:
REM
draws room doors
GOSUB
drawloot:
REM
draws room loot
GOSUB
drawmonster:
REM
draws monster
RETURN
drawloot:
REM
draws room loot
IF
lootamount
>
0
THEN
IF
decalc
=
1
THEN
PSET
(
lootx
,
205
)
,
&HFFA8A8A8
IF
decalc
=
2
THEN
PSET
(
lootx
,
205
)
,
&HFFA85400
IF
decalc
=
3
THEN
PSET
(
lootx
,
205
)
,
&HFF545454
IF
decalc
=
4
THEN
PSET
(
lootx
,
205
)
,
&HFF0000A8
IF
decalc
=
5
THEN
PSET
(
lootx
,
205
)
,
&HFFA80000
IF
decalc
=
6
THEN
PSET
(
lootx
,
205
)
,
&HFF00A800
IF
lootopen
=
0
THEN
DRAW
chestclosed$
ELSE
DRAW
chestopen$
END
IF
END
IF
RETURN
drawdecal:
REM
draws room decal
IF
roomtype
=
4
THEN
RETURN
IF
roomdecal
>
0
THEN
REM
draws decal
IF
decalc
=
1
THEN
PSET
(
decalx
,
decaly
)
,
&HFFA8A8A8
IF
decalc
=
2
THEN
PSET
(
decalx
,
decaly
)
,
&HFFA85400
IF
decalc
=
3
THEN
PSET
(
decalx
,
decaly
)
,
&HFF545454
IF
decalc
=
4
THEN
PSET
(
decalx
,
decaly
)
,
&HFF0000A8
IF
decalc
=
5
THEN
PSET
(
decalx
,
decaly
)
,
&HFFA80000
IF
decalc
=
6
THEN
PSET
(
decalx
,
decaly
)
,
&HFF00A800
IF
roomdecal
=
1
THEN
DRAW
decal1$
IF
roomdecal
=
2
THEN
DRAW
decal2$
IF
roomdecal
=
3
THEN
DRAW
decal3$
IF
roomdecal
=
4
THEN
DRAW
decal4$
IF
roomdecal
=
5
THEN
DRAW
decal5$
IF
roomdecal
=
6
THEN
DRAW
decal6$
IF
roomdecal
=
7
THEN
DRAW
decal7$
IF
roomdecal
=
8
THEN
DRAW
decal8$
IF
roomdecal
=
9
THEN
DRAW
decal9$
IF
roomdecal
=
10
THEN
DRAW
decal10$
IF
roomdecal
=
11
THEN
DRAW
decal11$
IF
roomdecal
=
12
THEN
DRAW
decal12$
IF
roomdecal
=
13
THEN
DRAW
decal13$
IF
roomdecal
=
14
THEN
DRAW
decal14$
IF
roomdecal
=
15
THEN
DRAW
decal15$
END
IF
RETURN
endgame:
REM
unloads all
files
from memory
and
quits game
REM
unloads images
_FREEIMAGE
titledisplay
REM
unloads audio
_SNDCLOSE
bombhit
_SNDCLOSE
swordhit
_SNDCLOSE
magichit
_SNDCLOSE
highscore
_SNDCLOSE
gameover
_SNDCLOSE
dooropen
_SNDCLOSE
store
_SNDCLOSE
pickup
REM
Danni Pond
SYSTEM
dandedata folder needed :)
Controls - Arrow keys and Space
Text Only
|
Text with Attachments