Skip to content

Instantly share code, notes, and snippets.

@slice
Last active Nov 23, 2019
Embed
What would you like to do?
a weird game i made when i was 11
'Dungeon Masters
'In SMILEBasic.
CLEAR
'---
CLS
'---
PRINT "Loading Font..."
@LOAD
SYSBEEP=FALSE
LOAD "BGF0:MYFNT1",FALSE
IF RESULT==FALSE GOTO @ERR1
SYSBEEP=TRUE
'---
GOTO @INI
'---
@HPPRNT
RETURN
'---
@DBGATV
GOTO @DBGMNU
'---
@CLS
ACLS
CLS
RETURN
'---
@PHPCHK
IF HP<=0 THEN GOTO @GAMEOVER
RETURN
'---
@VL
PRINT "Loading Values..."
'Values and Levels
PNLTYPE "OFF"
LEVEL=1
HP=150
LSEQ=0
NSEQ=0
FSATTK=0
FSEQ=0
KEYEQ=0
INVMODE=0
ONESHOT=0
DUNST=0
NDFS=0
NATK=0
ATK=0
DFS=0
RETURN
'---
@GAMEOVER
CLS
ACLS
CLEAR
PNLTYPE "OFF"
LOCATE 11,12
PRINT "GAME OVER
PNLSTR 11,12,"GAME OVER",0
BGMPLAY 6
WAIT 390
END
'---
@INI
GOSUB @VL
BGMPLAY 1
GOSUB @PHPCHK
GOSUB @HPPRNT
CLS
ACLS
GOTO @MENU
'---
@MENU
LOCATE 9,12
PRINT "DUNGEON MASTERS"
BGMPLAY 7
PNLTYPE "OFF"
PNLSTR 11,11,"???????????
PNLSTR 11,12,"?PLAY GAME?
PNLSTR 11,13,"???????????
@TCHLOOP1
IF TCHTIME==1 GOTO @GAME
GOTO @TCHLOOP1
'---
@GAME
@SEL
CLS
ICONSET 3,59
BGMPLAY 1
PRINT "DungeonMasters ver.1.0
PRINT "Runs on SMILEBASIC
PRINT FREEMEM" memory free"
PRINT "
PRINT "HP: "HP
PRINT "
PRINT "Inventory:"
PRINT "
IF LSEQ==1 THEN PRINT "Legend Sword"
IF FSEQ==1 THEN PRINT "Fire Sword"
IF NSEQ==1 THEN PRINT "Normal Sword"
IF KEYEQ==1 THEN PRINT "Key"
PRINT "Attack Stat: "ATK
PRINT "Defense Stat: "DFS
PRINT "
PRINT "Press  to go a direction."
GOSUB @PHPCHK
@BTLOOP
IF ICONCHK()==3 THEN GOSUB @PAU
IF BTRIG()!=1 GOTO @BTSKIP
GOTO @UP
@BTSKIP
IF BTRIG()!=2 GOTO @BTSKIP0
GOTO @DWN
@BTSKIP0
IF BTRIG()!=4 GOTO @BTSKIP1
GOTO @LFT
@BTSKIP1
IF BTRIG()!=8 GOTO @BTSKIPDB
GOTO @RGT
@BTSKIPDB
IF BTRIG()!=1024 GOTO @BTLOOP
GOTO @DBGATV
'---
@KEYFLE
PRINT "You found a door."
WAIT 120
PRINT "Seems locked."
WAIT 120
GOTO @SEL
'---
@DUNDOOR
IF KEYEQ==0 THEN GOTO @KEYFLE
PRINT "
PRINT "You found a door..."
WAIT 120
PRINT "It's locked."
PRINT "
PRINT ":Use Key
PRINT ":Ignore
@BTLOOPA1
IF ICONCHK()==3 THEN GOSUB @PAU
IF BTRIG()!=16 THEN GOTO @BTSKIPA1
GOTO @INDUNG
@BTSKIPA1
IF BTRIG()!=64 THEN GOTO @BTLOOPA1
GOTO @SEL
'---
@INDUNG
CLS
PRINT "You stepped in the dungeon."
WAIT 120
DECDUN1 = RND(5)
IF DECDUN1==1 GOTO @SET1
IF DECDUN1==2 GOTO @SET2
IF DECDUN1==3 GOTO @SET3
IF DECDUN1==4 GOTO @SET4
'---
@SET1
BGMPLAY 15
PRINT "
PRINT "You found Steak Meal Deluxe!"
WAIT 120
PRINT "You ate the meal.."
WAIT 120
PRINT "Mmm!"
WAIT 60
BEEP 12
PRINT "You restored 135 HP!"
WAIT 120
HP = HP+120
KEYEQ=0
GOTO @SEL
'---
@SET2
BGMPLAY 15
PRINT "
PVRINT "You found Steak Meal!"
WAIT 120
PRINT "You ate the meal.."
WAIT 120
PRINT "Yummy!"
WAIT 60
BEEP 12
PRINT "You restored 115 HP!"
WAIT 120
HP = HP+115
KEYEQ=0
GOTO @SEL
'---
@SET3
BGMPLAY 15
PRINT "
PRINT "You found Hotdog Meal!"
WAIT 120
PRINT "You ate the meal.."
WAIT 120
PRINT "Yummy!"
WAIT 60
BEEP 12
PRINT "You restored 85 HP."
WAIT 120
HP = HP+85
KEYEQ=0
GOTO @SEL
'---
@SET4
BGMPLAY 15
PRINT "
PRINT "You found Nachos Meal!"
WAIT 120
PRINT "You ate the meal.."
WAIT 120
PRINT "Mmm!"
WAIT 60
BEEP 12
PRINT "You restored 120
HP = HP+85
KEYEQ=0
GOTO @SEL
'---
@CHST
GOSUB @HPPRNT
PRINT "You found a chest!"
PRINT":Open by hands"
PRINT":Open by magic"
PRINT":Ignore
@BTLOOP1
IF ICONCHK()==3 THEN GOSUB @PAU
IF BTRIG()!=16 GOTO @BTSKIP7
GOTO @OPENHND
@BTSKIP7
IF BTRIG()!=32 GOTO @BTSKIP8
GOTO @OPENMAG
@BTSKIP8
IF BTRIG()!=64 GOTO @BTLOOP1
GOTO @SEL
'---
@OPENHND
RNDOPNHN=RND(3)
IF RNDOPNHN==1 GOTO @CHSTITM
IF RNDOPNHN==2 GOTO @CHSTITM
IF RNDOPNHN==3 GOTO @CHSTTRP
GOTO @OPENHND
'---
@OPENMAG
BEEP 8
PRINT "You used magic!"
WAIT 120
GOTO @CHSTITM
'---
@CHSTITM
DETRITM=RND(9)
IF DETRITM==1 GOTO @COOKSTK
IF DETRITM==2 GOTO @HEALPILL
IF DETRITM==3 GOTO @LGNDSWOD
IF DETRITM==4 GOTO @NORMSWOD
IF DETRITM==5 GOTO @FIRESWOD
IF DETRITM==6 GOTO @SOUPBOWL
IF DETRITM==7 GOTO @CANDY
IF DETRITM==8 GOTO @KEY
'---Item coding
@COOKSTK
PRINT "You found Cooked Steak!"
WAIT 120
BEEP 12
PRINT "45 HP was restored."
WAIT 120
HP = HP+80
GOTO @SEL
'---Item coding
@HEALPILL
PRINT "You found a heal pill!"
WAIT 120
BEEP 12
PRINT "15 HP was restored."
WAIT 120
HP = HP+25
GOTO @SEL
'---Item coding
@LGNDSWOD
BEEP 12
PRINT "You found a Legend Sword!"
WAIT 120
LSEQ = LSEQ+1
IF LSEQ==2 THEN LSEQ=1
GOTO @SEL
'---Item coding
@NORMSWOD
BEEP 12
PRINT "You found a Normal Sword!"
WAIT 120
NSEQ = NSEQ+1
IF NSEQ==2 THEN NSEQ=1
GOTO @SEL
'---Item coding
@FIRESWOD
BEEP 12
PRINT "You found a Fire Sword!"
WAIT 120
FSEQ = FSEQ+1
IF FSEQ==2 THEN FSEQ = FSEQ=1
GOTO @SEL
'---Item coding
@SOUPBOWL
PRINT "You found Soup!"
WAIT 120
BEEP 12
PRINT "15 HP was restored."
WAIT 120
HP = HP+25
GOTO @SEL
'---Item coding
@CANDY
PRINT "You found Candy!"
WAIT 120
BEEP 12
PRINT "20 HP was restored."
WAIT 120
HP = HP+45
GOTO @SEL
'---Item coding
@KEY
PRINT "You found a key!"
WAIT 120
PRINT "Hmm.. What can you do with this?"
WAIT 200
KEYEQ=1
GOTO @SEL
'---
@CHSTTRP
RNDTRP=RND(19)
BEEP 11
IF INVMODE==1 THEN RNDTRP=0
PRINT "Trap!"
WAIT 120
PRINT "You lost "RNDTRP" HP..."
WAIT 120
HP = HP-RNDTRP
GOTO @SEL
'---
@FOUNDNOT
PRINT "
PRINT "Found nothing..."
WAIT 120
GOTO @SEL
'---
@UP
RND0=RND(5)
IF RND0==4 GOTO @CHST
IF RND0==1 GOTO @CHST
IF RND0==2 GOTO @MONS
IF RND0==3 GOTO @DUNDOOR
'---
@DWN
RND1=RND(5)
IF RND1==4 GOTO @CHST
IF RND1==1 GOTO @CHST
IF RND1==3 GOTO @DUNDOOR
IF RND1==2 GOTO @MONS
'---
@LFT
RND2=RND(5)
IF RND2==4 GOTO @CHST
IF RND2==1 GOTO @CHST
IF RND2==3 GOTO @DUNDOOR
IF RND2==2 GOTO @MONS
'---
@RGT
RND3=RND(5)
IF RND3==4 GOTO @CHST
IF RND3==1 GOTO @CHST
IF RND3==3 GOTO @DUNDOOR
IF RND3==2 GOTO @MONS
'---
@MONS
'---
'Monster Data and Variables
MHP=15
IF LSEQ==1 THEN MHP = MHP+25
IF NSEQ==1 THEN MHP = MMP+10
IF FSEQ==1 THEN MHP = MHP+15
'---
GOTO @MONSINI
'---
@MHPCHK
IF MHP<=0 GOTO @MDFT
RETURN
'---
@MDFT
BGMPLAY 5
PRINT "Monster defeated!"
WAIT 160
MONSDFTD = MONSDFTD+1
IF MONSDFTD==5 THEN GOSUB @LVLUP
IF MONSDFTD==15 THEN GOSUB @LVLUP
IF MONSDFTD==25 THEN GOSUB @LVLUP
IF MONSDFTD==35 THEN GOSUB @LVLUP
IF MONSDFTD==40 THEN GOSUB @LVLUP
HP = HP+40
FSATTK=0
GOTO @SEL
'---
@LVLUP
PRINT "
LEVEL = LEVEL+1
IF LEVEL==3 THEN LEVEL==3
BGMPLAY 5
PRINT "You leveled up!!"
WAIT 120
PRINT "You are now level "LEVEL
WAIT 120
NDFS=RND(5)
NATK=RND(5)
PRINT "New Defense: "NDFS
PRINT "New Attack: "NATK
DFS = DFS+NDFS
ATK = ATK+NATK
GOTO @SEL
'---
@MONSINI
BGMPLAY 2
GOSUB @PHPCHK
@MYTURN
CLS
GOSUB @PHPCHK
GOSUB @HPPRNT
PRINT "A Monster appeared!"
PRINT "
PRINT "Monster HP:"MHP
PRINT "Monster Level:"LEVEL
PRINT "Player HP: "HP
PRINT "Player Level:"LEVEL
PRINT "
PRINT "
PRINT "(A): Punch
PRINT "(B): Magic
IF LSEQ==1 THEN PRINT "(X): Legend Sword"
IF NSEQ==1 THEN PRINT "(Y): Normal Sword"
IF FSEQ==1 THEN PRINT "(L): Fire Sword"
PRINT "START: Run"
@BTLOOP0
IF ICONCHK()==3 THEN GOSUB @PAU
IF BTRIG()!=16 GOTO @BTSKIP2
GOTO @PPUNCH
@BTSKIP2
IF BTRIG()!=32 GOTO @BTSKIP3
GOTO @PMAGMONS
@BTSKIP3
IF BTRIG()!=1024 GOTO @BTSKIP4
GOTO @PRUNMONS
@BTSKIP4
IF BTRIG()!=64 GOTO @BTSKIP5
GOTO @PLSMONS
@BTSKIP5
IF BTRIG()!=128 GOTO @BTSKIP6
GOTO @PNSMONS
@BTSKIP6
IF BTRIG()!=256 GOTO @BTLOOP0
GOTO @PFSMONS
'---
@PPUNCH
BEEP 11
RNDPNCH=RND(15)+ATK
PRINT "You did "RNDPNCH" damage!"
WAIT 120
MHP = MHP-RNDPNCH
IF ONESHOT==1 GOTO @MDFT
GOSUB @MHPCHK
GOSUB @MATTK
GOTO @MYTURN
'---
@PMAGMONS
BEEP 8
IF INVMODE==1 GOTO @SKIP1
HP = HP-5
@SKIP1
PRINT "You used Magic!"
WAIT 60
RNDMG=RND(20)+ATK
PRINT "You did "RNDMG" damage!"
WAIT 120
IF ONESHOT==1 GOTO @MDFT
MHP = MHP-RNDMG
GOSUB @MHPCHK
GOSUB @MATTK
GOTO @MYTURN
'---
@SWFAIL
BEEP 2
PRINT "You don't have that!"
WAIT 120
GOSUB @MATTK
'---
@PRUNMONS
PRINT "You ran away!"
WAIT 120
GOTO @SEL
'---
@PFSMONS
BEEP 11
IF FSEQ==0 THEN GOTO @SWFAIL
PRINT "You used the Fire Sword!"
WAIT 120
FSATTK=1
COLOR 13
PRINT "You inflicted a burn!!"
BEEP 10
FSATTK=1
COLOR 0
WAIT 60
BEEP 11
FSATK=15+ATK
PRINT "The sword did "FSATK" damage!"
MHP = MHP-FSATK
WAIT 120
IF ONESHOT==1 GOTO @MDFT
GOTO @MATTK
GOSUB @MHPCHK
GOTO @MYTURN
'---
@PNSMONS
BEEP 11
IF NSEQ==0 THEN GOTO @SWFAIL
PRINT "You used normal sword!"
WAIT 60
BEEP 11
NSATK=15+ATK
PRINT "You did "NSATK" damage!"
WAIT 120
MHP = MHP-NSATK
IF ONESHOT==1 GOTO @MDFT
GOSUB @MHPCHK
GOTO @MATTK
GOTO @MYTURN
'---
@PLSMONS
BEEP 11
IF LSEQ==0 THEN GOTO @SWFAIL
PRINT "You used legend sword!"
WAIT 60
BEEP 10
LSATK=25+ATK
PRINT "You did "LSATK" damage!"
WAIT 120
IF ONESHOT==1 GOTO @MDFT
MHP = MHP-LSATK
GOSUB @MHPCHK
GOTO @MATTK
GOTO @MYTURN
'---
@MATTK
RNDMATTK=RND(19)-DFS
PRINT "The monster attacked!"
WAIT 60
IF INVMODE==1 THEN RNDMATTK=0
IF FSATTK==1 THEN GOSUB @BURNINFL
BEEP 11
PRINT "He did "RNDMATTK" damage!"
WAIT 120
HP = HP-RNDMATTK
GOTO @MYTURN
'---
@BURNINFL
IF FSATTK==0 THEN RETURN
PRINT "Yowch! The monster got burned!"
WAIT 60
BEEP 10
PRINT "You inflicted 10 damage!"
WAIT 120
RETURN
'---
@DBGMNU
WAIT 10
CLS
ACLS
PRINT "+----------------+
PRINT "|DEBUG MENU |"
PRINT "|(A):Change HP |"
PRINT "|(B):Equip Sword |"
PRINT "|(X):Equip Key |"
PRINT "|(Y):Invinc. Mode|"
PRINT "|(L):OneShot Mode|"
PRINT "+----------------+"
PRINT "
PRINT "START: Back
@BTLOOPD
IF ICONCHK()==3 THEN GOSUB @PAU
IF BTRIG()!=16 GOTO @BTSKIPD1
GOTO @CHNGEHP
@BTSKIPD1
IF BTRIG()!=32 GOTO @BRSKIPD2
GOTO @EQSWOD
@BRSKIPD2
IF BTRIG()!=64 GOTO @BTSKIPD3
GOTO @EQKEY
@BTSKIPD3
IF BTRIG()!=128 GOTO @BTSKIPD4
GOTO @INVMODE
@BTSKIPD4
IF BTRIG()!=256 GOTO @BTSKIPD5
GOTO @ONESHOTM
@BTSKIPD5
IF BTRIG()!=1024 GOTO @BTLOOPD
WAIT 10
GOTO @SEL
'---
@CHNGEHP
INPUT "How much starter HP do you want";CHGEHP
IF CHGEHP>99999 THEN GOTO @OVRFLW
HP=CHGEHP
GOTO @DBGMNU
'---
@OVRFLW
COLOR 13
PRINT "
PRINT "Overflow!"
WAIT 120
COLOR 0
GOTO @CHNGEHP
'---
@EQSWOD
CLS
PRINT "What sword do you want to equip?"
PRINT "(A): Normal Sword"
PRINT "(X): Fire Sword"
PRINT "(Y): Legend Sword"
PRINT "
PRINT "START: Back
@BTLOOPD1
IF BTRIG()!=16 GOTO @BTSKIPD6
GOTO @EQNS
@BTSKIPD6
IF BTRIG()!=64 GOTO @BTSKIPD7
GOTO @EQFS
@BTSKIPD7
IF BTRIG()!=128 GOTO @BTSKIPD8
GOTO @EQLS
@BTSKIPD8
IF BTRIG()!=1024 GOTO @BTLOOPD1
GOTO @DBGMNU
'---
@UNEQNS
PRINT "Un-Equipped Normal Sword."
WAIT 120
NSEQ=0
GOTO @EQSWOD
'---
@EQNS
IF NSEQ==1 THEN GOTO @UNEQNS
NSEQ=1
PRINT "Normal Sword Equipped."
WAIT 120
GOTO @EQSWOD
'---
@UNEQFS
FSEQ=0
PRINT "Un-Equipped Fire Sword."
WAIT 120
GOTO @EQSWOD
'---
@EQFS
IF FSEQ==1 THEN GOTO @UNEQFS
FSEQ=1
PRINT "Fire Sword Equipped."
WAIT 120
GOTO @EQSWOD
'---
@EQLS
IF LSEQ==1 THEN GOTO @UNEQLS
LSEQ=1
PRINT "Legend Sword Equipped."
WAIT 120
GOTO @EQSWOD
'---
@UNEQLS
LSEQ=0
PRINT "Un-Equipped Legend Sword."
WAIT 120
GOTO @EQSWOD
'---
@EQKEY
IF KEYEQ==1 GOTO @UNEQKEY
KEYEQ=1
PRINT "Equipped Key."
WAIT 120
GOTO @DBGMNU
'---
@UNEQKEY
KEYEQ=0
PRINT "Key unequipped."
WAIT 120
GOTO @DBGMNU
'---
@INVMODE
IF INVMODE==1 GOTO @UNDOINV
INVMODE=1
PRINT "Invincible Mode toggled On."
WAIT 120
GOTO @DBGMNU
'---
@UNDOINV
INVMODE=0
PRINT "Invincible Mode toggled Off."
WAIT 120
GOTO @DBGMNU
'---
@ONESHOTM
IF ONESHOT==1 GOTO @UNDOONESM
ONESHOT=1
PRINT "OneShot Mode toggled On."
WAIT 120
GOTO @DBGMNU
'---
@UNDOONESM
ONESHOT=0
PRINT "OneShot Mode toggled Off."
WAIT 120
GOTO @DBGMNU
'---
@ERR
BEEP 2
CLS
PRINT "An error has occurred."
PRINT "
PRINT "Please restart Dungeo"
PRINT "n Masters. If that do"
PRINT "sen't work, see if yo"
PRINT "u read the QR Codes c"
PRINT "orrectly. If that dos"
PRINT "en't fix it, this ver"
PRINT "sion of Dungeon Maste"
PRINT "rs is bugged. "
WAIT 99999
GOTO @ERR
'---
@ERR1
BEEP 2
SYSBEEP=1
CLS
PRINT "An error has occurred."
PRINT "
PRINT "An error has occured "
PRINT "loading the font file"
PRINT "BGF0:MYFNT1. - This f"
PRINT "ile is needed for gam"
PRINT "eplay.If you deleted "
PRINT "the file, retrieve th"
PRINT "e file by scanning th"
PRINT "QR Codes. "
PRINT "
GOTO @ERR1
'---
@PAU
WAIT 10
PNLSTR 14,12,"PAUSE",12
@PLOOP
IF ICONCHK()==3 THEN PNLSTR 14,12," ",12:WAIT 10:RETURN
GOTO @PLOOP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment