Yeah but I want different colors. Writing one RGB command then C+Ping it is about the same time as making an ink command so yeah. The Perform CheckList helped. Now the last thing screen res works
Rem Project: Menu
Rem Created: Monday, August 09, 2010
Rem ***** Main Source File *****
set text font "Ariel"
Set text size 30
`Set Sound Volume 1, 50 unrem this and delete this message when installing in main program
`Set Music Volume 1, 50 same as above
sw = screen width()` just in case
sh= screen height()
Menu:
Repeat
CLS
Click = 0
Box 100,50,700,150, rgb(0,0,255), rgb(0,0,255), rgb(0,0,255), rgb(0,0,255)
Center Text 350, 85, " Play Space Invaders"
Box 100, 300, 700, 400, rgb(255,0,0), rgb(255,0,0), rgb(255,0,0), rgb(255,0,0)
Center Text 350, 335, "Exit"
Box 10, 500, 150, 550, rgb(175,175,175), rgb(175,175,175), rgb(175,175,175), rgb(175,175,175)
Center text 70, 505, "Settings"
If mouseclick() = 1 and Click = 0
If mouseWithin(100,50,700,150) and Click = 0 ` testing stuff, dont mind the "and click = 0" part
Goto Playing `replace with Goto blah blah later.
Done = 1
Click = 1
endif
Endif
If mouseclick() = 1 and Click = 0
If mouseWithin(100, 300, 700, 400) and Click = 0
end
endif
Endif
If mouseclick() = 1 and Click = 0
if mousewithin(10,500,150,550) and Click = 0
Gosub Settings
endif
endif
Until Done = 1
Settings:
CLS
Dim ScreenRes(6) ` again just in case
ScreenRes(1) = 640
ScreenRes(2) = 480
ScreenRes(3) = 800
ScreenRes(4) = 600
ScreenRes(5) = 1024
ScreenRes(6) = 768
do
CLS
Set text size 30
Box 50,10,700,70, RGB(175,175,175), RGB(175,175,175), RGB(175,175,175), RGB(175,175,175)
Text 70, 20, "Screen Resolution Press E to exit or press shiny blue button."
Box 50,140,700,200, RGB(200,0,0), RGB(200,0,0), RGB(200,0,0), RGB(200,0,0)` the boxes
Box 50,270,700,330,RGB(255,255,0),RGB(255,255,0),RGB(255,255,0),RGB(255,255,0)
Box 50,400,700,460,RGB(0,255,0),RGB(0,255,0),RGB(0,255,0),RGB(0,255,0)
Box 200,500,600,599,RGB(0,0,255),RGB(0,0,255),RGB(0,0,255),RGB(0,0,255)
Center Text 150,150, "640x480x32"
center text 150,280, "800x600x32"
center text 150,410, "1024x768x32"
center text 350, 540, "Main Menu"
If keystate(18) = 1
exit
endif
If MouseWithin(50,140,700,200) and mouseclick() = 1 ` better way to do it
Set Display Mode ScreenRes(1), ScreenRes(2), 32
ScreenPrintTest$ = "640x480x16" ` testing to see if mousewithin function is working properly
Endif
If MouseWithin(50,280,700,340) and mouseclick() = 1
Set Display Mode ScreenRes(3), ScreenRes(4), 32
ScreenPrintTest$ = "800x600x16"
endif
If MouseWithin(50,400,700,460) and mouseclick() = 1
Set Display Mode ScreenRes(5), ScreenRes(6), 32
ScreenPrintTest$ = "960x720x16"
endif
If Mousewithin(200,500,600,599) and MouseClick() = 1
Exit
endif
loop
Return
Playing:
do
cls
Print "Wow this is fun" ` to be replaced with the actual playing
if keystate(25) = 1
Gosub Pause
endif
loop
Pause:
thumbX= 250
Volume# = 50
Do
BOX 80,50,500,250, RGB(255,0,0), RGB(255,0,0), RGB(255,0,0), RGB(255,0,0)
Text 90, 60, "Volume"
Text 90, 100, "0"
Text 400, 100, "100"
Text 90, 200, "Press spacebar to continue"
if mouseclick() = 1 and CFlag = 0 ` ooooooohhhhhhhhhh a slider :D
squaredDistance = (mousex() - thumbX)^2 + (mousey() - 100)^2
if squaredDistance <= 16 and CFlag = 0
thumbClicked = 1
offsetX = mousex() - thumbX
CFlag = 1
endif
CFlag = 1
endif
if mouseclick() = 0
CFlag = 0
thumbClicked = 0
endif
if thumbClicked = 1
thumbX = mousex() - offsetX
if thumbX < 100 then thumbX = 100
if thumbX > 400 then thumbX = 400
Volume# = (thumbX - 100) / 3
endif
ink rgb(255,255,255),0
line 100,100,400,100
ink rgb(0,255,0),0
circle thumbX, 100, 4
`set music volume 1, Volume# un rem when installing in code
`set sound volume 1, Volume#
if keystate(57) = 1
exit
endif
Text 190, 60, str$(Volume#)
loop
return
function mouseWithin(x1,y1,x2,y2)` this is very useful
mx = mousex()
my = mousey()
if mx>=x1 and mx<=x2 and my>=y1 and my<=y2 then exitfunction 1 `self explanatory
endfunction 0
Done my job.
*realizes he has to do the sprite animations and graphics*
NOOOOOOOOOOOOOOOOOO!!!!!!!!!!!