im trying to make a FF style RPG menu system and im having difficulties with using heal items.
`````heal effect needs repaired````````
sync on
sync rate 300
cls
P$ = "Potion"
PD$ = "Pheonix Down"
PQ=3
PDQ =2
start:
cls
mc$ = "Daedalus"
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
HP=50
maxhp=100
magic=20
Lv=1
str=10
mde=10
def=10
do
`clear screen
`cls 0
`-----
`stats
`-----
`make decorations
ink rgb(255,255,255),1
box 0,0,639,103
ink rgb(0,0,255),1
box 7,7,632,96
`print stats
ink rgb(255,255,255),1
set cursor 300,10
print "MENU"
set cursor 10,10
print "";get date$()
print
set cursor 10,40
print "";get time$()
print
`button controls
if makebuttonmagic(320,250,"Items")>0 then buttonpressed=1
if mouseclick()=1 and buttonpressed=1 then goto c
if makebuttonattack(320,200,"Status")>0 then buttonpressed =2
if mouseclick()=1 and buttonpressed =2 then goto b
sync
loop
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,255),0 : box x-50,y-12,x+50,y+12
ink rgb(0,128,0),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 makebuttonattack(x,y,desc$)
buttonpressed=0
ink rgb(255,255,255),0 : box x-52,y-14,x+52,y+14
ink rgb(0,0,255),0 : box x-50,y-12,x+50,y+12
ink rgb(0,128,0),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
c:
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 17,17,203,463
ink rgb(0,0,255),0
box 20,20,200,460
ink rgb(255,255,255),0
text 40,35,"MENUS"
line 40,55,180,55
`Do right menu graphics
ink rgb(255,255,255),0
box 247,17,623,463
ink rgb(0,0,255),0
box 250,20,620,460
ink rgb(255,255,255),0
text 270,35,"ITEM"
text 500,35,"QUANTITY"
line 270,55,600,55
line 480,35,480,440
ink rgb(255,255,255),0
set cursor 40,70
print "Healing"
myx=mousex() : myy=mousey()
if myx>40 and myx<90
if myy>67 and myy<80
if mouseclick()=1 then goto healing
endif
endif
sync
cls
if scancode()=17 then goto start
loop
healing:
do
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>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,255),0
box 205,355,375,415
inc HP,6
dec PQ,1
ink rgb(255,255,255),0
set cursor 285,370
print hp
set cursor 320,370
print maxhp
goto healing
endif
endif
endif
if scancode()=17 then goto start
sync
loop
b:
cls
ink rgb(255,255,255),0
box 17,17,203,463
ink rgb(0,0,255),0
box 20,20,200,460
do
ink rgb(255,255,255),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
if scancode()=17 then goto start
if mousex()>20 and mousex()<20+text width(mc$) and mousey()>40+20 and mousey()<40+20+text height(mc$) and mouseclick()=1
ink rgb(255,255,255),0
box 247,17,623,463
ink rgb(0,0,255),0
box 250,20,620,460
ink rgb(255,255,255),0
ink rgb(255,255,255),0
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 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 270,390
print "Current Armour"
if scancode()=17 then goto start
endif
sync
loop
if i go to the itmes part and use a potion it will update the hp on this section but if i go back by pressing 'W' and click on statu it isnt updated here. ive spent hours trying to sort this out any help will be grateful
Daedalus