hahaha very funny well heres the code for my menu, begining and health bar(just the health bar) i aint going to give yall the media though. for my begining
load music "music misty room.mp3",1
play music 1
scrolly$=" A DRAGONSEIGE PRODUCTION "
scrlsize=len(scrolly$)
scrlpos=1
maxchar=20
width=9.9
height=19
startpoint=200
endpoint=1
speed=1
dim xpos(600)
spacing=startpoint/maxchar
set text font "tahoma"
set text size 128
for j = 1 to 60
cls 0
center text 64,32,chr$(j+31)
get image j,0,0,128,128
next j
hide mouse
sync on
sync rate 0
backdrop on
color backdrop rgb(0,0,0)
set image colorkey 0,0,0
for char=1 to maxchar
make object cube char,width
make object cube 100+char,width
make object cube 200+char,width
make object cube 300+char,width
make object cube 400+char,width
make object cube 500+char,width
ghost object on char,0
ghost object on 100+char,0
ghost object on 200+char,0
ghost object on 300+char,0
ghost object on 400+char,0
ghost object on 500+char,0
xpos(char)=char*spacing
texture object char,1
texture object 100+char,1
texture object 200+char,1
texture object 300+char,1
texture object 400+char,1
texture object 500+char,1
set object transparency char,1
set object transparency 100+char,1
set object transparency 200+char,1
set object transparency 300+char,1
set object transparency 400+char,1
set object transparency 500+char,1
next char
position camera startpoint/2,0,-80
point camera startpoint/2,0,0
For T=1 to 750
for char=1 to maxchar
if scrlpos=scrlsize
scrlpos=1
endif
if xpos(char)<endpoint
xpos(char)=startpoint
a$=mid$(scrolly$,scrlpos)
a=asc(a$)-31
texture object char,a
texture object 100+char,a
texture object 200+char,a
texture object 300+char,a
texture object 400+char,a
texture object 500+char,a
inc scrlpos,1
endif
xpos(char)=xpos(char)-speed
position object char,xpos(char),0,0
position object 100+char,xpos(char),0,-20
position object 200+char,xpos(char),xpos(char),xpos(char)
position object 300+char,xpos(char),0-xpos(char),xpos(char)
position object 400+char,50+xpos(char),xpos(char)-20,xpos(char)-20
position object 500+char,50+xpos(char),(0-xpos(char))+20,xpos(char)-20
next char
sync
Next T
for char=1 to maxchar
hide object char
hide object 100+char
hide object 200+char
hide object 300+char
hide object 400+char
hide object 500+char
set text size 24
next char
wait 100
sync on
sync rate 0
backdrop on
color backdrop 0
a = 255
b = 100
c = 100
choice = 1
leftkeypressed = 0
rightkeypressed = 0
`-------------------- Select screen -------------------------------
do
load image "ads.bmp",1
paste image 1, 3,310
`if key e pressed
if keystate(18) = 1
if keypressed = 0
choice = 3
endif
endif
`if key l pressed
if keystate(38) = 1
if keypressed = 0
choice = 2
endif
endif
`if key n is pressed
if keystate(49) = 1
if keypressed = 0
choice = 1
endif
endif
`cycle through next option and update choice
if rightkey() = 1
if keypressed = 0
inc choice, 1
if choice > 3 then choice = 1
endif
else
leftkeypressed = 0
endif
`cycle through previous option and update choice
if leftkey() = 1
if keypressed = 0
dec choice, 1
if choice < 1 then choice = 3
endif
else
rightkeypressed = 0
endif
`set colors for print options
select choice
case 1 : a = 255 : b = 100 : c = 100 : selected$ = "new game highlighted" : endcase
case 2 : a = 100 : b = 255 : c = 100 : selected$ = "load game highlighted" : endcase
case 3 : a = 100 : b = 100 : c = 255 : selected$ = "exit game highlighted" : endcase
case default : a = a : b = b : c = c : selected$ = selected$ : endcase
endselect
`pressing enter prints the selected option
if keystate(28) = 1
if choice = 3 then end
selected$ = "exit was selected"
endif
if choice = 2
if keystate(38) = 1
filename$ = "currentsave.save"
if File Exist(filename$)=1
open to read 1,filename$
rem read floats ------
read float 1,savedata1#
read float 1,savedata2#
read float 1,savedata3#
position object 1,savedata1#,savedata2#,savedata3#
close file 1
endif
selected$ = "load game was selected"
endif
endif
if choice = 1
selected$ = "new game was selected"
endif
`reset keypressed
if scancode() = 0
keypressed = 0
else
keypressed = 1
ink rgb(255,255,255), 0
set cursor 5,5
print selected$
endif
`print options
ink rgb(a,a,a),0 : center text 200, 400, "[N]ew Game"
ink rgb(b,b,b),0 : center text 330, 400, "[L]oad Game"
ink rgb(c,c,c),0 : center text 450, 400, "[E]xit Game"
sync
loop
for the menu
load image "wewerr.jpg", 1
data "items",0
data "save",0
data "character",0
data "quit"
`Number of submenus
numSubMenus=5
`Where the sub menu names will be stored
dim mainMenu$(numSubMenus)
`Where the item names will be stored
dim subMenu$(numSubMenus,20)
`Where the amount of item will be stored
dim subMenuQuantity(numSubMenus,20)
`Where the amount of items in the sub menu will be stored
dim subMenuAmount(numSubMenus)
`Read in data
for x=1 to numSubMenus
read mainMenu$(x)
read subMenuAmount(x)
for y=1 to subMenuAmount(x)
read subMenu$(x,y)
subMenuQuantity(x,y)=rnd(10)+1
next y
next x
sync on
do
`Background
ink rgb(0,0,0),0
box 0,0,639,479
paste image 1, 0,20
`Loop through sub menus
for x=1 to numSubMenus
`If the mouse is hovering it
if mousex()>40 and mousex()<40+text width(mainMenu$(x)) and mousey()>40+20*x and mousey()<40+20*x+text height(mainMenu$(x))
ink rgb(0,200,0),0
`If the mouse is clicked then switch menus to that one
if mouseclick()=1 then currentMenu=x
else
ink rgb(100,100,100),0
endif
`Print main menu text
text 40,40+20*x,mainMenu$(x)
next x
`Reset the 'cursor' for printing the text to the top of the list
listInc=0
`Loop through items
for x=1 to subMenuAmount(currentMenu)
`If the amount is more than 0
if subMenuQuantity(currentMenu,x)>0
`Move the 'cursor' for printing the text down, so we don't get overlapping text
inc listInc
`If mouse is hovering it
if mousex()>270 and mousex()<270+text width(subMenu$(currentMenu,x)) and mousey()>40+20*listInc and mousey()<40+20*listInc+text height(subMenu$(currentMenu,x))
ink rgb(255,255,0),0
`If the mouse is clicked and the time has passed from the last item click
if mouseclick()=1 and timer()-clickTimer>200
`Decriment the number of items
subMenuQuantity(currentMenu,x)=subMenuQuantity(currentMenu,x)-1
`Reset timer
clickTimer=timer()
endif
else
ink rgb(100,100,100),0
endif
`Print item name
text 270,40+20*listInc,subMenu$(currentMenu,x)
`Print item quantity
text 500,40+20*listInc,str$(subMenuQuantity(currentMenu,x))
endif
next x
REM HERE'S WHAT I'VE CHANGED -------------------------------------
if currentMenu=1
`Do right menu graphics
if "items" then ink rgb(120,102,200),0
box 253,23,623,463
ink rgb(260,246,232),0
box 250,20,620,460
ink rgb(0,0,0),0
text 270,35,"ITEM"
text 500,35,"QUANTITY"
EndIf
if currentMenu=2
`Do right menu graphics
if "save" then ink rgb(120,102,200),0
box 253,23,623,463
ink rgb(260,246,232),0
box 250,20,620,460
ink rgb(0,0,0),0
if keystate(31) = 1
filename$ = "currentsave.save"
if file exist (filename$) = 1 then delete file filename$
open to write 1, filename$
savadata1# = object position x(1)
savadata2# = object position y(1)
savadata3# = object position z(1)
write float 1,savadata1#
write float 1,savadata2#
write float 1,savadata3#
close file 1
endif
endIf
if currentMenu=4 then end
sync
cls
loop
for the health bar
max = 10000
current = 10000
load image "meter.bmp",1
DO
cls
paste image 1,5,400
drawHealthBar(70,435,187,3,current, max)
sync
LOOP
function drawHealthBar(X, Y, LOB, WOB, CHP, MHP)
REM X = X coordinate to position health bar at
REM Y = Y coordinate to position health bar at
REM LOB = length of health bar
REM WOB = width of health bar
REM CHP = current health points
REM MHP = maximum health points
if CHP < 0 then CHP = 0
if CHP > MHP then CHP = MHP
percent = (CHP*LOB)/MHP
ink rgb(0,0,0), 0
box X, Y, X+LOB, Y
ink rgb(255,0,0), 0
box X, Y, X+percent, Y+WOB
endfunction
hope yall like it
Dragonseige