Posted: 20th Mar 2012 06:29
thanx for reply i didnt know you had to click code twice
heres the code again hopefully neater but i dont know how i would reorganise cos i tried and my game messed up more and i tried the repeat and until it didnt work unless i had put them in wrong
`GAME MENU
FUNCTION menu()
hide mouse
do
paste image IMG_BACKGROUND, 0, 0
paste image IMG_TITLE, 0, 0, 1
set text font "Arial"
set text size 18
ink rgb(255,255,255),0
text 0,0,"mousex = "+str$(mousex())+" "
text 0,20, "mousey = "+str$(mousey())+" "
text 0,60, "screen fps "+str$(screen fps())
if mousex() > 280 and mousex() < 280 + image width(IMG_NEWGAME) and mousey() > 200 and mousey() < 200 + image height(IMG_NEWGAME)
paste image IMG_NEWGAMES, 280, 200, 1
paste image IMG_HEART, mousex(), mousey(), 1
if mouseclick()=1
splashscreen()
endif
else
paste image IMG_NEWGAME, 280, 200, 1
paste image IMG_HEART, mousex(), mousey(), 1
endif
if mousex() > 270 and mousex() < 270 + image width(IMG_LOADGAME) and mousey() > 270 and mousey() < 270 + image height(IMG_LOADGAME)
paste image IMG_LOADGAMES, 270, 270, 1
paste image IMG_HEART, mousex(), mousey(), 1
if mouseclick()=1
loadgame()
endif
else
paste image IMG_LOADGAME, 270, 270, 1
paste image IMG_HEART, mousex(), mousey(), 1
endif
if mousex() > 271 and mousex() < 271 + image width(IMG_OPTION) and mousey() > 340 and mousey() < 340 + image height(IMG_OPTION)
paste image IMG_OPTIONS, 271, 340, 1
paste image IMG_HEART, mousex(), mousey(), 1
if mouseclick()=1
options()
endif
else
paste image IMG_OPTION, 271, 340, 1
paste image IMG_HEART, mousex(), mousey(), 1
endif
if mousex() > 272 and mousex() < 272 + image width(IMG_CREDIT) and mousey() > 410 and mousey() < 410 + image height(IMG_CREDIT)
paste image IMG_CREDITS, 272, 410, 1
paste image IMG_HEART, mousex(), mousey(), 1
if mouseclick()=1
credit()
endif
else
paste image IMG_CREDIT, 272, 410, 1
paste image IMG_HEART, mousex(), mousey(), 1
endif
if mousex() > 272 and mousex() < 272 + image width(IMG_EXIT_EXIT) and mousey() > 480 and mousey() < 480 + image height(IMG_EXIT_EXIT)
paste image IMG_EXIT_EXITS, 272, 480, 1
paste image IMG_HEART, mousex(), mousey(), 1
if mouseclick()=1
end
endif
else
paste image IMG_EXIT_EXIT, 272, 480, 1
paste image IMG_HEART, mousex(), mousey(), 1
endif
`do the same as above if there is other buttons
sync
LOOP
EndFunction
`splash screen function
FUNCTION splashscreen()
cls
set text font "Arial Bold"
set text size 18
INK RGB(117,0,0),0
do
cls
paste image IMG_FOREST, 0, y
`black
`top
line 200,48,601,48
`right side
line 602,550,602,49
`top
line 200,49,601,49
`right side
line 601,550,601,49
`red
ink rgb(117,0,0),0
`bottom
line 200,550,600,550
`top
line 200,50,600,50
`left side
line 200,550,200,50
`right side
line 600,550,600,50
set text font "verdana"
set text size 20
gosub typing
ink rgb(255,255,255),0
set text font "Arial"
set text size 18
`just getting mouse position after finish delete
text 0,0,"mousex = "+str$(mousex())+" "
text 0,20, "mousey = "+str$(mousey())+" "
text 0,60, "screen fps "+str$(screen fps())
set text font "Zombie"
set text size 27
if mousex()=>13 and mousey()=>528 and mousex()<=103 and mousey()<=580
ink rgb(0,0,0),0
text 33,553, "BACK"
ink rgb(183,0,0),0
text 30,550, "BACK"
if mouseclick()=1
cls
menu()
endif
else
ink rgb(0,0,0),0
text 33,553, "BACK"
ink rgb(117,0,0),0
text 30,550, "BACK"
endif
if mousex()=>668 and mousey()=>532 and mousex()<=772 and mousey()<=576
ink rgb(0,0,0),0
text 693,553, "NEXT"
ink rgb(183,0,0),0
text 690,550, "NEXT"
if mouseclick()=1
play()
endif
else
ink rgb(0,0,0),0
text 693,553, "NEXT"
ink rgb(117,0,0),0
text 690,550, "NEXT"
endif
paste image IMG_HEART, mousex(), mousey(), 1
sync
LOOP
ENDFUNCTION
`the load game function
FUNCTION loadgame()
`clears the previous screen
cls
`loop
do
`clears any memory
cls
set text font "Arial"
set text size 18
ink rgb(255,255,255),0
text 0,0,"mousex = "+str$(mousex())+" "
text 0,20, "mousey = "+str$(mousey())+" "
text 0,60, "screen fps "+str$(screen fps())
`refresh the screen
sync
loop
ENDFUNCTION
FUNCTION options()
cls
do
cls
paste image IMG_PAPER, x, y
set text font "Arial"
set text size 18
ink rgb(255,255,255),0
text 0,0,"mousex = "+str$(mousex())+" "
text 0,20, "mousey = "+str$(mousey())+" "
text 0,60, "screen fps "+str$(screen fps())
set text font "Zombie"
set text size 60
if mousex() > 450 and mousex() < 450 + image width(25) and mousey() > 200 and mousey() < 200 + image height(25)
paste image IMG_CHECKS, 450, 200, 1
paste image IMG_HEART, mousex(), mousey(), 1
if mouseclick()=1
set window layout 0,0,0
maximize window
endif
if mouseclick()=1
restore window
endif
else
paste image IMG_CHECK, 450, 200, 1
paste image IMG_HEART, mousex(), mousey(), 1
endif
if mousex() > 190 and mousex() < 190 + image width(IMG_ARROW3) and mousey() > 400 and mousey() < 400 + image height(IMG_ARROW3)
paste image IMG_ARROW3S,190,400,1
paste image IMG_HEART,mousex(),mousey(),1
if mouseclick()=1
cls
menu()
endif
else
paste image IMG_ARROW3,190,400,1
endif
`music on and off
if mousex() > 450 and mousex() < 450 + image width(25) and mousey() > 280 and mousey() < 280 + image height(25)
paste image IMG_CHECKS, 450, 280, 1
paste image IMG_HEART, mousex(), mousey(), 1
if mouseclick()=1
endif
else
paste image IMG_CHECK, 450, 280, 1
paste image IMG_HEART, mousex(), mousey(), 1
endif
INK RGB(0,0,0),0
center text 400,85,"OPTIONS"
INK RGB(117,0,0) ,0
center text 386,80,"OPTIONS"
set text font "Arial Bold"
set text size 25
INK RGB(0,0,0),0
center text 330,200,"FullScreen On/Off"
center text 330,280,"Music Off/On"
paste image IMG_SKULL, 160,50,1
paste image IMG_HEART, mousex(), mousey(), 1
sync
loop
ENDFUNCTION
`credit function
FUNCTION credit()
`clears the previous screen
cls
`loop
do
`clears any memory
cls
`paste the image at x and y coordinates
paste image IMG_PAPER, x, y
paste image IMG_HEART, mousex(), mousey(), 1
set text font "Arial"
set text size 18
ink rgb(255,255,255),0
text 0,0,"mousex = "+str$(mousex())+" "
text 0,20, "mousey = "+str$(mousey())+" "
text 0,60, "screen fps "+str$(screen fps())
set text font "Zombie"
set text size 60
INK RGB(0,0,0),0
center text 400,85,"CREDIT"
INK RGB(117,0,0) ,0
center text 386,80,"CREDIT"
set text font "Arial Bold"
set text size 18
INK RGB(0,0,0),0
text 385,190,"By"
text 335,230,"Wendy Morrison"
text 355,280,"Made With"
text 310,330,"DarkBasic Professional"
paste image IMG_SKULL, 180,50,1
paste image IMG_HEART,mousex(),mousey(),1
if mousex() > 190 and mousex() < 190 + image width(IMG_ARROW3) and mousey() > 400 and mousey() < 400 + image height(IMG_ARROW3)
paste image IMG_ARROW3S,190,400,1
paste image IMG_HEART,mousex(),mousey(),1
if mouseclick()=1
cls
menu()
endif
else
paste image IMG_ARROW3,190,400,1
endif
sync
loop
ENDFUNCTION
`the play function
FUNCTION play()
`clears the previous screen
cls
`loop
do
`clears any memory
cls
`ink the shadow lines with black
ink rgb(0,0,0),0
`paste the background
paste image IMG_FOREST, 0,y
`top
line 200,48,601,48
`right side
line 602,550,602,49
`top
line 200,49,601,49
`right side
line 601,550,601,49
`red
ink rgb(117,0,0),0
`bottom
line 200,550,600,550
`top
line 200,50,600,50
`left side
line 200,550,200,50
`right side
line 600,550,600,50
`white color for text,and font and size of text
ink rgb(255,255,255),0
set text font "Arial"
set text size 18
`just getting mouse position and the frame rate after finish delete
text 0,0,"mousex = "+str$(mousex())+" "
text 0,20, "mousey = "+str$(mousey())+" "
text 0,60, "screen fps "+str$(screen fps())
`zombie font and size
set text font "Zombie"
set text size 27
`find the mouse over text position
if mousex()=>13 and mousey()=>528 and mousex()<=103 and mousey()<=580
`ink the shadow with black
ink rgb(0,0,0),0
text 33,553, "BACK"
`ink lighter red for the front text
ink rgb(183,0,0),0
text 30,550, "BACK"
`if you click on the word back it should go back to previous screen
if mouseclick()=1
`it goes back to the function splashscree
splashscreen()
`ends the mouse click statement
endif
else
`else it inks black shadow again
ink rgb(0,0,0),0
text 33,553, "BACK"
`it goes to the normal blood red color
ink rgb(117,0,0),0
text 30,550, "BACK"
`ends the mouse over text statement
endif
if mousex()=>355 and mousey()=>30 and mousex()<=417 and mousey()<=82
ink rgb(0,0,0),0
center text 398,53, "UP"
ink rgb(183,0,0),0
center text 395,50, "UP"
if mouseclick()=1
`put what function your clicking
endif
else
ink rgb(0,0,0),0
center text 398,53, "UP"
ink rgb(117,0,0),0
center text 395,50, "UP"
endif
if mousex()=>182 and mousey()=>237 and mousex()<=217 and mousey()<=409
ink rgb(0,0,0),0
center text 213,263, "L"
center text 213,303, "E"
center text 213,343, "F"
center text 213,383, "T"
ink rgb(183,0,0),0
center text 210,260, "L"
center text 210,300, "E"
center text 210,340, "F"
center text 210,380, "T"
if mouseclick()=1
set text font "Arial"
set text size 25
ink rgb(255,255,255),0
center text 390,20, "You can't go left. It's just a wall there."
endif
else
set text font "Zombie"
set text size 27
ink rgb(0,0,0),0
center text 213,263, "L"
center text 213,303, "E"
center text 213,343, "F"
center text 213,383, "T"
ink rgb(117,0,0),0
center text 210,260, "L"
center text 210,300, "E"
center text 210,340, "F"
center text 210,380, "T"
endif
if mousex()=>565 and mousey()=>237 and mousex()<=603 and mousey()<=451
ink rgb(0,0,0),0
center text 593,263, "R"
center text 593,303, "I"
center text 593,343, "G"
center text 593,383, "H"
center text 593,423, "T"
ink rgb(183,0,0),0
center text 590,260, "R"
center text 590,300, "I"
center text 590,340, "G"
center text 590,380, "H"
center text 590,420, "T"
if mouseclick()=1
set text font "Arial"
set text size 25
ink rgb(255,255,255),0
center text 390,20, "You can't go right. It's just a wall there."
endif
else
set text font "Zombie"
set text size 27
ink rgb(0,0,0),0
center text 593,263, "R"
center text 593,303, "I"
center text 593,343, "G"
center text 593,383, "H"
center text 593,383, "T"
ink rgb(117,0,0),0
center text 590,260, "R"
center text 590,300, "I"
center text 590,340, "G"
center text 590,380, "H"
center text 590,420, "T"
endif
`if you hit the m key you will bring up the map
`but you have to hold it down
if scancode()=50 then paste image IMG_MAP, 0, 0
`goes to pause but untill i work it out better you have to hold p key down
if inkey$()="p" then gosub pausemenu
`paste the cursor image
paste image IMG_HEART, mousex(), mousey(), 1
`refresh the screen
sync
`ends the loop
loop
`ends the function command
ENDFUNCTION
and i will try to upload my whole game just in case
i did press code twice dont know if it worked tho sorry if it didnt
ok just realize i have to use winrar to zip and then upload but if you do need to look please tell me and i will upload ok thanx