for example you can put this where you want, this was just in my head so i dont know if it will work
if buttonmenu(where you want,where you want,"menu")>0 and downkey()=1 then buttonpressed=2
if mouseclick()=1 and buttonpressed =2 then goto menu
_menu:
sync on
sync rate 300
set display mode 640,480,16
cls
`Gil
G=250
`items
P$ = "Potion"
PD$ = "Pheonix Down"
PV = 100
PQ=3
PDQ =2
`weapons
knife$ = "Small Knife"
knifeQ = 1
knifest = 10
`armour
bronzepl$ = "Bronze Plate"
bronzeplQ=1
bronzeplde=10
`accesory
acc$ = "None Equipped"
HP=50
`magic
f$ = "Fire1"
Fdesc$ = "Fire elemental attack"
fmp$ = "5"
c$ = "Cure1"
Cdesc$ = "Cures small amounts of HP"
cmp$ = "10"
`------------------------------------------------
`moved this code here, where you had it HP would be reset to 50
`everytime you came back to the label start:
maxhp=100
magic=20
maxmp=20
Lv=1
str=10
mde=10
def=10
`------------------------------------------------
start:
cls
mc$ = "Midtime: Redemption"
`dim key(250) : dim oldkey(250)
`if mouseclick > 0 then oldmouse = 1
`if mouseclick() > 0 and oldmouse = 0 : mouseclick = mouseclick() : else : mouseclick = 0 : endif
`if mouseclick() = 0 then oldmouse = 0
`for a = 1 to 250
` if key(a) = 1 then oldkey(a) = 1
` if keystate(a) = 1 and oldkey(a) = 0 : key(a) = 1 : else : key(a) = 0 : endif
` if keystate(a) = 0 then oldkey(a) = 0
`next a
do
`clear screen
`cls 0
`-----
`stats
`-----
`make decorations
ink rgb(255,255,255),0
box 0,0,479,103
box 480,0,639,475
box 0,104,479,475
ink rgb(0,0,0),0
box 2,2,480,101
box 482,2,637,473
box 0,200,450,500
box 2,104,479,473
`print stats
ink RGB(255,128,64),1
set cursor 300,10
print "MENU"
set cursor 10,10
print "";get date$()
print
set cursor 10,40
print "";get time$()
print
set cursor 20,120
print mc$
set cursor 100,150
print "[Insert Image]"
set cursor 20,300
print "HP:"
set cursor 50,300
print hp
set cursor 80,300
print "/"
set cursor 90,300
print maxhp
set cursor 150,300
Print "MP: "
set cursor 180,300
print magic
set cursor 200,300
print "/"
set cursor 210,300
print maxmp
set Cursor 50,400
Print "Gold:"
set cursor 150,400
print G
`button controls
if makebuttonstatus(550,100,"Status")>0 and downkey()=1 then buttonpressed=2
if mouseclick()=1 and buttonpressed =2 then goto status
if makebuttonitem(550,130,"Items")>0 then buttonpressed=1
if mouseclick()=1 and buttonpressed=1 then goto item
if makebuttonmagic(550,160,"Magic")>0 then buttonpressed=3
if mouseclick()=1 and buttonpressed=3 then goto magic
if makebuttonequip(550,190,"Quests")>0 then buttonpressed=4
if makebuttonabil(550,220,"Ability")>0 then buttonpressed=5
if makebuttonsave(550,300,"Save")>0 then buttonpressed=11
sync
loop
Item:
cls
do
`Background
ink rgb(0,0,0),0
box 0,0,639,479
`Do left menu graphics
ink rgb(255,255,255),0
box 0,0,242,477
ink RGB(0,0,0),1
box 2,2,240,475
ink RGB(255,128,64),1
text 40,35,"MENUS"
line 40,55,180,55
`Do right menu graphics
ink rgb(255,255,255),0
box 242,0,633,477
ink RGB(0,0,0),1
box 243,2,631,475
ink RGB(255,128,64),1
text 270,35,"ITEM"
text 500,35,"QUANTITY"
line 270,55,600,55
line 480,35,480,440
ink RGB(255,128,64),1
set cursor 40,70
if makebuttonheal(60,70,"Healing")>0 then buttonpressed=9
if mouseclick()=1 and buttonpressed=9 then goto healing
if makebuttonwea(67,90,"Weapons")>0 then buttonpressed=10
if mouseclick()=1 and buttonpressed=10 then goto weapon
if makebuttonback(70,450,"Back")>0 then buttonpressed=12
if mouseclick()=1 and buttonpressed=12 then goto start
sync
cls
loop
healing:
do
ink RGB(255,128,64),1
set cursor 270,70
print P$
set cursor 525,70
print PQ
set cursor 270,90
print PD$
set cursor 525,90
print PDQ
myx=mousex() : myy=mousey()
if myx>270 and myx<310
if myy>83 and myy<100
if mouseclick()=1 and HP = 0
inc HP,maxhp/4
dec PDQ
endif
endif
endif
myx=mousex() : myy=mousey()
if myx>270 and myx<310
if myy>67 and myy<80
if mouseclick()=1 and hp<maxhp
ink rgb(255,255,255),0
box 200,350,380,420
ink rgb(0,0,0),0
box 205,355,375,415
if HP>0
inc HP,PV
if HP>maxhp then hp=maxhp
dec PQ,1
`redraw the menu to dec PQ
cls
`Do left menu graphics
ink rgb(255,255,255),0
box 0,0,242,477
ink rgb(0,0,0),0
box 2,2,240,475
ink RGB(255,128,64),1
text 40,35,"MENUS"
line 40,55,180,55
`Do right menu graphics
ink rgb(255,255,255),0
box 242,0,633,477
ink rgb(0,0,0),0
box 243,2,631,475
ink RGB(255,128,64),1
text 270,35,"ITEM"
text 500,35,"QUANTITY"
line 270,55,600,55
line 480,35,480,440
`small box
ink rgb(255,255,255),0
box 200,350,380,420
ink rgb(0,0,0),0
box 202,352,378,418
ink RGB(255,128,64),1
set cursor 525,70
print pq
set cursor 285,370
print hp
set cursor 320,370
print maxhp
`this will stop you drinking multiple healing potions.
`not the best way to do it, but it will get you going.
`----------------------------------
repeat : until mouseclick()=0
`----------------------------------
goto healing
endif
endif
endif
endif
if makebuttonback(70,450,"Back")>0 then buttonpressed=12
if mouseclick()=1 and buttonpressed=12 then goto item
sync
loop
status:
cls
ink rgb(255,255,255),0
box 0,0,242,477
ink rgb(0,0,0),0
box 2,2,240,475
ink RGB(255,128,64),1
box 243,0,633,477
ink rgb(0,0,0),0
box 244,2,635,475
ink RGB(255,128,64),1
set cursor 270,30
print mc$
set cursor 400,50
print "(image)"
set cursor 270,200
Print "HP"
set cursor 305,200
print HP
set cursor 335,200
print "/"
set cursor 345,200
print maxhp
set cursor 270,225
Print "MP"
set cursor 305,225
print magic
set cursor 335,225
print "/"
set cursor 345,225
print maxmp
set cursor 270,250
print "Strength"
set cursor 340,250
print str
set cursor 270,275
print "Defence"
set cursor 340,275
print def
set cursor 270,300
print "Magic"
set cursor 340,300
print magic
set cursor 270,325
print "Magic Def"
set cursor 340,325
print mde
set cursor 270,370
print "Current Weapon: "
set cursor 400,370
print knife$
set cursor 270,390
print "Current Armour: "
set cursor 400,390
print bronzepl$
set cursor 270,410
print "Accesory: "
set cursor 400,410
print acc$
do
ink RGB(255,128,64),1
set cursor 20,20
print "Status"
set cursor 20,60
Print mc$
set cursor 20,80
print "level"
set cursor 60,80
print lv
set cursor 20,100
Print "HP"
set cursor 50,100
print hp
set cursor 75,100
print "/"
set cursor 79,100
print maxhp
set cursor 20,120
print "MP"
set cursor 50,120
print magic
set cursor 70,120
print "/"
set cursor 75,120
print maxmp
if makebuttonback(70,450,"Back")>0 then buttonpressed=12
if mouseclick()=1 and buttonpressed=12 then goto start
sync
loop
`Magic : needs made
Magic:
cls
ink rgb(255,255,255),0
box 0,0,200,479
box 201,0,636,479
ink rgb(0,0,0),0
box 2,2,198,477
box 201,2,634,477
set cursor 70,20
ink RGB(255,128,64),1
print "Magic"
do
if scancode()=18 then goto start
if makebuttonele(90,100,"Elemental")>0 then buttonpressed=6
if mouseclick()=1 and buttonpressed=6 then goto elementalmagicinfo
if makebuttonback(70,450,"Back")>0 then buttonpressed=12
if mouseclick()=1 and buttonpressed=12 then goto start
if makebuttoncura(85,130,"Curative")>0 then buttonpressed=8
if mouseclick()=1 and buttonpressed=8 then goto curativeinfo
if makebuttonback(70,450,"Back")>0 then buttonpressed=12
if mouseclick()=1 and buttonpressed=12 then goto start
sync
loop
elementalmagicinfo:
ink rgb(255,255,255),0
box 0,0,200,479
box 201,0,636,479
ink rgb(0,0,0),0
box 2,2,198,477
box 201,2,634,477
ink RGB(255,128,64),1
set cursor 50,20
print "Elemental Magic"
do
if scancode()=17 then goto magic
if makebuttonfire1(260,50,"Fire1")>0 then buttonpressed=7
if mouseclick()=1 and buttonpressed=7
ink rgb(255,255,255),0
box 300,300,500,350
ink rgb(0,0,0),0
box 302,302,498,348
ink RGB(255,128,64),1
set cursor 310,305
Print fdesc$
set cursor 310,325
print "MP needed:"
set cursor 420,325
print fmp$
endif
sync
loop
curativeinfo:
ink rgb(255,255,255),0
box 0,0,200,479
box 201,0,636,479
ink rgb(0,0,0),0
box 2,2,198,477
box 201,2,634,477
ink RGB(255,128,64),1
set cursor 50,20
print "Curative Magic"
do
if scancode()=17 then goto magic
if makebuttoncure1(260,50,"Cure1")>0 then buttonpressed=7
if mouseclick()=1 and buttonpressed=7
ink rgb(255,255,255),0
box 300,300,500,350
ink rgb(0,0,0),0
box 302,302,498,348
ink RGB(255,128,64),1
set cursor 310,305
Print cdesc$
set cursor 310,325
print "MP needed:"
set cursor 420,325
print cmp$
endif
sync
loop
weapon:
do
ink RGB(255,128,64),1
set cursor 525,70
print knifeQ
if makebuttonkn(305,70,knife$)>0 then buttonpressed=11
if mouseclick()=1 and buttonpressed = 11
ink rgb(255,255,255),0
box 100,200,300,400
ink rgb(0,0,0),0
box 102,202,298,398
ink RGB(255,128,64),1
set cursor 110,210
Print "Weapon Strength: "
set cursor 250,210
print knifest
set cursor 110,230
print "Strength: "
ost = str + knifest
set cursor 250,230
print ost
endif
if scancode()=18 then goto start
if scancode()=17 then goto item
sync
loop
function makebuttonitem(x,y,desc$)
buttonpressed=0
`ink rgb(255,255,255),0 : box x-52,y-14,x+52,y+14
ink RGB(0,0,0),0 : box x-50,y-12,x+50,y+12
ink RGB(255,128,64),0
myx=mousex() : myy=mousey()
if myx>x-50 and myx<x+50
if myy>y-12 and myy<y+12
buttonpressed=1
endif
endif
if buttonpressed=1 then ink rgb(255,255,0),0
set text size 18 : center text x,y-8,desc$
if mouseclick()=0 then buttonpressed=0
endfunction buttonpressed
function makebuttonstatus(x,y,desc$)
buttonpressed=0
`ink rgb(255,255,255),0 : box x-52,y-14,x+52,y+14
ink RGB(0,0,0),0 : box x-50,y-12,x+50,y+12
ink RGB(255,128,64),0
myx=mousex() : myy=mousey()
if myx>x-50 and myx<x+50
if myy>y-12 and myy<y+12
buttonpressed=1
endif
endif
if buttonpressed=1 then ink rgb(255,255,0),0
if buttonpressed=1
if key = 1 then key = 0
endif
set text size 18 : center text x,y-8,desc$
endfunction buttonpressed
function makebuttonmagic(x,y,desc$)
buttonpressed=0
`ink rgb(255,255,255),0 : box x-52,y-14,x+52,y+14
ink RGB(0,0,0),0 : box x-50,y-12,x+50,y+12
ink RGB(255,128,64),0
myx=mousex() : myy=mousey()
if myx>x-50 and myx<x+50
if myy>y-12 and myy<y+12
buttonpressed=1
endif
endif
if buttonpressed=1 then ink rgb(255,255,0),0
if buttonpressed=1
if key = 1 then key = 0
endif
set text size 18 : center text x,y-8,desc$
endfunction buttonpressed
function makebuttonabil(x,y,desc$)
buttonpressed=0
`ink rgb(255,255,255),0 : box x-52,y-14,x+52,y+14
ink RGB(0,0,0),0 : box x-50,y-12,x+50,y+12
ink RGB(255,128,64),0
myx=mousex() : myy=mousey()
if myx>x-50 and myx<x+50
if myy>y-12 and myy<y+12
buttonpressed=1
endif
endif
if buttonpressed=1 then ink rgb(255,255,0),0
if buttonpressed=1
if key = 1 then key = 0
endif
set text size 18 : center text x,y-8,desc$
endfunction buttonpressed
function makebuttonequip(x,y,desc$)
buttonpressed=0
`ink rgb(255,255,255),0 : box x-52,y-14,x+52,y+14
ink RGB(0,0,0),0 : box x-50,y-12,x+50,y+12
ink RGB(255,128,64),0
myx=mousex() : myy=mousey()
if myx>x-50 and myx<x+50
if myy>y-12 and myy<y+12
buttonpressed=1
endif
endif
if buttonpressed=1 then ink rgb(255,255,0),0
if buttonpressed=1
if key = 1 then key = 0
endif
set text size 18 : center text x,y-8,desc$
endfunction buttonpressed
function makebuttonele(x,y,desc$)
buttonpressed=0
`ink rgb(255,255,255),0 : box x-52,y-14,x+52,y+14
ink RGB(0,0,0),0 : box x-50,y-12,x+50,y+12
ink RGB(255,128,64),0
myx=mousex() : myy=mousey()
if myx>x-50 and myx<x+50
if myy>y-12 and myy<y+12
buttonpressed=1
endif
endif
if buttonpressed=1 then ink rgb(255,255,0),0
if buttonpressed=1
if key = 1 then key = 0
endif
set text size 18 : center text x,y-8,desc$
endfunction buttonpressed
function makebuttonfire1(x,y,desc$)
buttonpressed=0
`ink rgb(255,255,255),0 : box x-52,y-14,x+52,y+14
ink RGB(0,0,0),0 : box x-50,y-12,x+50,y+12
ink RGB(255,128,64),0
myx=mousex() : myy=mousey()
if myx>x-50 and myx<x+50
if myy>y-12 and myy<y+12
buttonpressed=1
endif
endif
if buttonpressed=1 then ink rgb(255,255,0),0
if buttonpressed=1
if key = 1 then key = 0
endif
set text size 18 : center text x,y-8,desc$
endfunction buttonpressed
function makebuttoncura(x,y,desc$)
buttonpressed=0
`ink rgb(255,255,255),0 : box x-52,y-14,x+52,y+14
ink RGB(0,0,0),0 : box x-50,y-12,x+50,y+12
ink RGB(255,128,64),0
myx=mousex() : myy=mousey()
if myx>x-50 and myx<x+50
if myy>y-12 and myy<y+12
buttonpressed=1
endif
endif
if buttonpressed=1 then ink rgb(255,255,0),0
if buttonpressed=1
if key = 1 then key = 0
endif
set text size 18 : center text x,y-8,desc$
endfunction buttonpressed
function makebuttoncure1(x,y,desc$)
buttonpressed=0
`ink rgb(255,255,255),0 : box x-52,y-14,x+52,y+14
ink RGB(0,0,0),0 : box x-50,y-12,x+50,y+12
ink RGB(255,128,64),0
myx=mousex() : myy=mousey()
if myx>x-50 and myx<x+50
if myy>y-12 and myy<y+12
buttonpressed=1
endif
endif
if buttonpressed=1 then ink rgb(255,255,0),0
if buttonpressed=1
if key = 1 then key = 0
endif
set text size 18 : center text x,y-8,desc$
endfunction buttonpressed
function makebuttonheal(x,y,desc$)
buttonpressed=0
`ink rgb(255,255,255),0 : box x-52,y-14,x+52,y+14
ink RGB(0,0,0),0 : box x-50,y-12,x+50,y+12
ink RGB(255,128,64),0
myx=mousex() : myy=mousey()
if myx>x-50 and myx<x+50
if myy>y-12 and myy<y+12
buttonpressed=1
endif
endif
if buttonpressed=1 then ink rgb(255,255,0),0
if buttonpressed=1
if key = 1 then key = 0
endif
set text size 18 : center text x,y-8,desc$
endfunction buttonpressed
function makebuttonwea(x,y,desc$)
buttonpressed=0
`ink rgb(255,255,255),0 : box x-52,y-14,x+52,y+14
ink RGB(0,0,0),0 : box x-50,y-12,x+50,y+12
ink RGB(255,128,64),0
myx=mousex() : myy=mousey()
if myx>x-50 and myx<x+50
if myy>y-12 and myy<y+12
buttonpressed=1
endif
endif
if buttonpressed=1 then ink rgb(255,255,0),0
if buttonpressed=1
if key = 1 then key = 0
endif
set text size 18 : center text x,y-8,desc$
endfunction buttonpressed
function makebuttonkn(x,y,desc$)
buttonpressed=0
`ink rgb(255,255,255),0 : box x-52,y-14,x+52,y+14
ink RGB(0,0,0),0 : box x-50,y-12,x+50,y+12
ink RGB(255,128,64),0
myx=mousex() : myy=mousey()
if myx>x-50 and myx<x+50
if myy>y-12 and myy<y+12
buttonpressed=1
endif
endif
if buttonpressed=1 then ink rgb(255,255,0),0
if buttonpressed=1
if key = 1 then key = 0
endif
set text size 18 : center text x,y-8,desc$
endfunction buttonpressed
function makebuttonsave(x,y,desc$)
buttonpressed=0
`ink rgb(255,255,255),0 : box x-52,y-14,x+52,y+14
ink RGB(0,0,0),0 : box x-50,y-12,x+50,y+12
ink RGB(255,128,64),0
myx=mousex() : myy=mousey()
if myx>x-50 and myx<x+50
if myy>y-12 and myy<y+12
buttonpressed=1
endif
endif
if buttonpressed=1 then ink rgb(255,255,0),0
if buttonpressed=1
if key = 1 then key = 0
endif
set text size 18 : center text x,y-8,desc$
endfunction buttonpressed
function makebuttonback(x,y,desc$)
buttonpressed=0
`ink rgb(255,255,255),0 : box x-52,y-14,x+52,y+14
ink RGB(0,0,0),0 : box x-50,y-12,x+50,y+12
ink RGB(255,128,64),0
myx=mousex() : myy=mousey()
if myx>x-50 and myx<x+50
if myy>y-12 and myy<y+12
buttonpressed=1
endif
endif
if buttonpressed=1 then ink rgb(255,255,0),0
if buttonpressed=1
if key = 1 then key = 0
endif
set text size 18 : center text x,y-8,desc$
endfunction buttonpressed