Could someone tell me how to make a main menu? I've seen code for it before and I'll attach part of my game WITHOUT MEDIA so everthings white, but all I want to do is have a main menu. I've tried adding another gosub routine for the mainmenu and made it to where it went to that first until u did something like press a key, but all it did was go to the game still. Here's the code:
rem Subject: Pirates
Rem Created: 2/15/2004 4:24:39 PM
Rem ***** Main Source File *****
rem Initial settings
gosub _play_game
_play_game:
sync on : sync rate 1000
hide mouse
autocam off
rem load game
gosub _load_textures
rem setup game
gosub _setup_world
rem setup sounds
gosub _setup_sounds
rem setup music
gosub _setup_music
rem setup camera
gosub _setup_camera
rem setup objects
gosub _setup_objects
rem NPC's
gosub _setup_npc
rem setup character
gosub _setup_character
rem setup buildings
gosub _setup_buildings
rem Main Loop
do
gosub _control_player
gosub _control_weapons
gosub _control_npc
sync
gosub _control_enemies
gosub _control_effects
gosub _control_sounds
sync
loop
rem subroutines
_load_textures:
remstart
set dir "media"
load image "Textures/Cement_render.bmp",1
load image "textures/walls/stone01.bmp",2
load image "textures/real/wood/medium01.bmp",3
load image "textures/oak_door.bmp",4
load image "textures/real/green/moss05.bmp",5
load image "textures/real/water/water06.bmp",6
load image "textures/real/water/water05.bmp",7
load image "textures/real/water/water04.bmp",8
load image "textures/real/water/water03.bmp",9
load image "textures/real/water/water02.bmp",10
load image "textures/real/water/water01.bmp",11
load image "textures/real/water/water07.bmp",12
load image "textures/real/water/water08.bmp",13
load image "textures/sandstone_cliff_t.bmp",14
load image "textures/real/wood/dark03.bmp",15
load image "textures/real/wood/medium04.bmp",16
load image "textures/arcade/green/leaves04.bmp",17
load image "textures/wheat/wheat08.jpg",18
load image "textures/real/walls/stone14.bmp",19
load image "textures/sky/sky05.jpg",20
load image "textures/temporary names/shipyard.bmp",21
load image "textures/temporary names/storage yard.bmp",23
load image "textures/grass/grass01.jpg",22
load image "textures/gravel/gravel04.jpg",24
load image "textures/real/metal/steel01.bmp",25
remend
return
_setup_world:
`make grass in port royal behind storage yard 1
make matrix 8,327,300,1,1
position matrix 8,-300,-.5,-480
`prepare matrix texture 8,22,2,2
`make gravel 1 by dock 1
make matrix 1,125,125,1,1
`prepare matrix texture 1,1,1,1
`make gravel 3 by dock 1 and storage yard 1
make matrix 5,100,185,1,1
position matrix 5,25,0,-185
`prepare matrix texture 5,1,1,1
`make gravel 2 in port royal by storage yard
make matrix 3,300,75,10,1
position matrix 3,-300,-14.5,-75
`prepare matrix texture 3,2,1,1
make object box 84,300,15,75
position object 84,-150,-17.53,-37.5
`texture object 84,2
`make towers by dock 1
`make gravel 1
make object box 2,18.25,37.5,18.75
position object 2,15,18.75,31
` texture object 2,2
`make measurement blocks
`Island at dock width
make object box 108,3,3,19800
position object 108,15,1.5,-9900
`Island length at longest all land part
make object box 109,3,3,6930
position object 109,30,1.5,-3465
make object box 110,47025,3,3
position object 110,6172.5,1.5,-6928.5
`make towers
make object box 3,18.75,37.5,18.75
position object 3,106,18.75,31
`texture object 3,2
make object box 6,125,40,125
position object 6,62.5,-20.1,62.5
`texture object 6,2
`make wall 1 connected to tower 1 by dock 1
make object box 93,60,15,12
position object 93,136,7.5,31
`texture object 93,2
`make iron fence 1 in port royal by dock 1
make object box 107,255,15,1
position object 107,291,7.5,31
`texture object 107,25
`make ocean wall 1 at port royal to left of dock 1
make object box 106,300,30,2
position object 106,275,-14,37
`texture object 106,2
`make stairs for gravel 2
make object box 86,12,10,75
position object 86,19.5,-4,-37.5
` texture object 86,2
make object box 87,8,7.5,75
position object 87,12.5,-4.5,-37.5
` texture object 87,2
make object box 88,8,5,75
position object 88,7.5,-7,-37.5
` texture object 88,2
make object box 89,8,2.5,75
position object 89,3,-9.5,-37.5
` texture object 89,2
`make garden part 1 by storage yard 1
make object box 90,2,2,110
position object 90,25,1,-130
` texture object 90,16
make object box 91,24,2,2
position object 91,12,1,-184
` texture object 91,16
make matrix 4,24,108,1,1
position matrix 4,0,0,-183
` prepare matrix texture 4,17,1,2
`make garden 2 port royal port
make object box 96,2,2,25
position object 96,125,1,12.5
` texture object 96,16
make object box 97,298,2,2
position object 97,275,1,1
` texture object 97,16
make object box 98,2,2,35
position object 98,424,1,17.5
` texture object 98,16
make matrix 6,300,36,1,1
position matrix 6,125,1,1
` prepare matrix texture 6,17,1,1
`make road 1 in port royal by dock 1
make matrix 7,500,125,1,1
position matrix 7,124,.02,-125
` prepare matrix texture 7,1,1,1
`make road 2 in port royal by dock 1
make object box 99,90,1,350
position object 99,10,5,-325
yrotate object 99,205
` texture object 99,1
xrotate object 99,-2
`temporary storage building(basic area coverage)
make object box 92,300,85,110
position object 92,-150,31.5,-130
` texture object 92,23
make object box 94,30,15,55
position object 94,15,-7.53,-102.5
texture object 94,19
`temporary shipyard (basic area coverage)
make object box 100,300,110,200
position object 100,300,55,-300
` texture object 100,21
`shipyard grass and paths
`paths
make object box 101,30,1,115
position object 101,200,-.5,-162.5
` texture object 101,24
yrotate object 101,340
`yard
make object box 102,100,-.1,75
make object box 103,100,-.1,75
make object box 104,100,-.1,75
make object box 105,100,-.1,75
position object 102,175,0,-162.5
position object 103,275,0,-162.5
position object 104,375,0,-162.5
position object 105,475,0,-162.5
` texture object 102,22
` texture object 103,22
` texture object 104,22
` texture object 105,22
`make water 1 at port royal
make object box 38,10000,10000,30
position object 38,0,-40,5000
`texture object 38,12
`make misc items on part 3 of dock 1
`make pole 1
make object sphere 82,3
position object 82,255,12,615
` texture object 82,3
make object cylinder 81,3
scale object 81,100,400,100
position object 81,255,6,615
` texture object 81,3
`make 4th and farthest part dock 1
make object box 71,107.5,1.875,56.25
make object box 72,107.5,1.875,56.25
position object 71,40,0,650
position object 72,-67.5,0,650
`texture object 71,4
`texture object 72,4
`make 1st part of dock 1
make object box 10,56.25,1.875,62.5
make object box 11,56.25,1.875,62.5
make object box 12,56.25,1.875,62.5
make object box 13,56.25,1.875,62.5
make object box 14,56.25,1.875,62.5
make object box 15,56.25,1.875,62.5
make object box 17,56.25,1.875,62.5
make object box 18,56.25,1.875,62.5
`make 3rd part of dock 1
make object box 20,60,1.7,56.25
make object box 39,60,1.7,56.25
position object 20,120,0,330
position object 39,180,0,330
`make covered area on dock 1
make object box 21,2,30,2
make object box 22,2,30,2
make object box 23,2,30,2
make object box 24,2,30,2
make object box 25,57,2,2
make object box 26,57,2,2
make object box 27,2,14,2
make object box 28,2,14,2
make object box 29,29.5,2,2
make object box 30,29.5,2,2
make object box 31,29.5,2,2
make object box 32,29.5,2,2
make object box 33,2,2,51
make object box 34,2,14,2
make object box 35,2,28,2
make object box 36,2,28,2
`make top to covered area on dock 1
make object sphere 83,50
position object 83,178.5,31,330
scale object 83,175,5,175
`texture object 83,18
make object cone 37,20
position object 37,178.5,39,330
scale object 37,500,100,500
`texture object 37,18
`make ocean bottom at port royal part 1
make matrix 2,1000,1000,1,1
position matrix 2,-500,-45,0
`prepare matrix texture 2,14,1,1
`make supporting dock poles
make object cylinder 41,5
scale object 41,100,1000,100
position object 41,40,-25,155
`texture object 41,15
make object cylinder 42,5
scale object 42,100,1000,100
position object 42,85,-25,155
`texture object 42,15
make object cylinder 43,5
scale object 43,100,1000,100
position object 43,40,-25,220
`texture object 43,15
make object cylinder 44,5
scale object 44,100,1000,100
position object 44,85,-25,220
`texture object 44,15
make object cylinder 45,5
scale object 45,100,1000,100
position object 45,40,-25,280
`texture object 45,15
make object cylinder 46,5
scale object 46,100,1000,100
position object 46,85,-25,280
`texture object 46,15
make object cylinder 49,5
scale object 49,100,1000,100
position object 49,40,-25,345
`texture object 49,15
make object cylinder 50,5
scale object 50,100,1000,100
position object 50,85,-25,345
`texture object 50,15
make object cylinder 47,5
scale object 47,100,1000,100
position object 47,40,-25,405
`texture object 47,15
make object cylinder 48,5
scale object 48,100,1000,100
position object 48,85,-25,405
`texture object 48,15
make object cylinder 51,5
scale object 51,100,1000,100
position object 51,40,-25,470
`texture object 51,15
make object cylinder 52,5
scale object 52,100,1000,100
position object 52,85,-25,470
`texture object 52,15
make object cylinder 53,5
scale object 53,100,1000,100
position object 53,40,-25,530
`texture object 53,15
make object cylinder 54,5
scale object 54,100,1000,100
position object 54,85,-25,530
`texture object 54,15
make object cylinder 55,5
scale object 55,100,1000,100
position object 55,40,-25,593
`texture object 55,15
make object cylinder 56,5
scale object 56,100,1000,100
position object 56,85,-25,593
`texture object 56,15
make object cylinder 57,5
scale object 57,100,1000,100
position object 57,100,-25,310
`texture object 57,15
make object cylinder 58,5
scale object 58,100,1000,100
position object 58,100,-25,355
`texture object 58,15
make object cylinder 59,5
scale object 59,100,1000,100
position object 59,150,-25,310
`texture object 59,15
make object cylinder 60,5
scale object 60,100,1000,100
position object 60,150,-25,355
`texture object 60,15
make object cylinder 61,5
scale object 61,100,1000,100
position object 61,205,-25,310
`texture object 61,15
make object cylinder 62,5
scale object 62,100,1000,100
position object 62,205,-25,355
`texture object 62,15
make object cylinder 63,5
scale object 63,100,1000,100
position object 63,220,-25,605
`texture object 63,15
make object cylinder 64,5
scale object 64,100,1000,100
position object 64,110,-25,620
`texture object 64,15
make object cylinder 65,5
scale object 65,100,1000,100
position object 65,160,-25,590
`texture object 65,15
make object cylinder 66,5
scale object 66,100,1000,100
position object 66,160,-25,635
`texture object 66,15
make object cylinder 67,5
scale object 67,100,1000,100
position object 67,100,-25,575
`texture object 67,15
make object cylinder 68,5
scale object 68,100,1000,100
position object 68,220,-25,650
`texture object 68,15
make object cylinder 69,5
scale object 69,100,1000,100
position object 69,280,-25,620
`texture object 69,15
make object cylinder 70,5
scale object 70,100,1000,100
position object 70,280,-25,665
`texture object 70,15
`dock 1 supports
make object cylinder 77,5
scale object 77,100,1000,100
position object 77,85,-25,675
`texture object 77,15
make object cylinder 78,5
scale object 78,100,1000,100
position object 78,85,-25,625
`texture object 78,15
make object cylinder 73,5
scale object 73,100,1000,100
position object 73,25,-25,675
`texture object 73,15
make object cylinder 74,5
scale object 74,100,1000,100
position object 74,25,-25,625
`texture object 74,15
make object cylinder 75,5
scale object 75,100,1000,100
position object 75,-35,-25,675
`texture object 75,15
make object cylinder 76,5
scale object 76,100,1000,100
position object 76,-35,-25,625
`texture object 76,15
make object cylinder 79,5
scale object 79,100,1000,100
position object 79,-115,-25,675
`texture object 79,15
make object cylinder 80,5
scale object 80,100,1000,100
position object 80,-115,-25,625
`texture object 80,15
`texture dock 1 things
remstart
texture object 10,4
texture object 11,4
texture object 12,4
texture object 13,4
texture object 14,4
texture object 15,4
texture object 17,4
texture object 18,4
texture object 20,4
texture object 39,4
texture object 21,3
texture object 22,3
texture object 23,3
texture object 24,3
texture object 25,3
texture object 26,3
texture object 27,3
texture object 28,3
texture object 29,3
texture object 30,3
texture object 31,3
texture object 32,3
texture object 33,3
texture object 34,3
texture object 35,3
texture object 36,3
remend
zrotate object 29,25
zrotate object 30,335
zrotate object 31,25
zrotate object 32,335
xrotate object 35,60
xrotate object 36,300
`position 1st part of dock 1
position object 10,62.5,0,156.25
position object 11,62.5,0,218.75
position object 12,62.5,0,281.25
position object 13,62.5,0,343.75
position object 14,62.5,0,406.25
position object 15,62.5,0,468.75
position object 17,62.5,0,531.25
position object 18,62.5,0,593.75
position object 21,207,16,355.5
position object 22,207,16,304.5
position object 23,150,16,355.5
position object 24,150,16,304.5
position object 25,178.5,14,355.5
position object 26,178.5,14,304.5
position object 27,178.5,7,355.5
position object 28,178.5,7,304.5
position object 29,164.25,7,304.5
position object 30,192.75,7,304.5
position object 31,164.25,7,355.5
position object 32,192.75,7,355.5
position object 33,207,14,330
position object 34,207,7,330
position object 35,207,7,317.25
position object 36,207,7,342.75
`make 2nd part of dock 1
make object box 16,107.5,1.7,56.25
make object box 19,107.5,1.7,56.25
position object 16,135,0,605
position object 19,238.5,0,632.5
yrotate object 16,345
yrotate object 19,345
texture object 16,4
texture object 19,4
return
_setup_sounds:
`load sound "sounds/animals/gulls.wav",1
`load sound "sounds/human/Earth slow.wav",2
`set sound speed 2,17250
return
_setup_music:
`load music "music/Last port of call.mid",1
`play music 1 : loop music 1
return
_setup_buildings:
return
_setup_objects:
`load object "models/torch/torch.x",7
`load object "models/torch/torch.x",8
`scale object 7,10,10,10
`yrotate object 7,90
`position object 7,106.25,18,50
`texture object 7,3
`scale object 8,10,10,10
`yrotate object 8,90
`position object 8,15.625,18,50
`texture object 8,3
return
_setup_npc:
`load object "models/people/walk.x",4
`set object speed 4,10
`yrotate object 4,270
`scale object 4,14,12,12
`position object 4,125,0,-50
return
_setup_character:
`load object "models/people/walk.x",1
`set object speed 1,10
`scale object 1,14.375,12.5,12.5
`yrotate object 1,180
`position object 1,62.5,0,23.25
return
_control_player:
`if ppz#>-75 and ppx#>13.5 and ppx#<25.5 and ppz#<0
`position object 1,ppx#,1,ppz#
`endif
a#=.15
`playerframe#=total object frames(1)
camx#=camera position x()
camy#=camera position y()
camz#=camera position z()
camangy#=camera angle y()
camx#=62.5
camy#=24
camz#=2
`ppx#=object position x(1)
`ppy#=object position y(1)
`ppz#=object position z(1)
remstart
if upkey()=1
loop sound 2
move camera a#
loop object 1,0,25
move object 1,-a#
endif
if upkey()=0
stop sound 2
loop object 1,0,0
endif
remend
if keystate(17)=1
move camera 10
endif
remstart
if downkey()=1
move camera -a#
loop object 1,0,25
move object 1,a#
endif
remend
if keystate(31)=1
move camera -10
endif
remstart
if leftkey()=1
turn camera left 1
turn object left 1,1
endif
remend
if keystate(30)=1
turn camera left 1
endif
if keystate(32)=1
turn camera right 1
endif
remstart
if rightkey()=1
turn camera right 1
turn object right 1,1
endif
remend
return
_setup_camera:
camx#=62.5
camy#=24
camz#=2
position camera camx#,camy#,camz#
set camera range 1,10000
if keystate(34)=1
camy#=camy#+1
endif
return
_control_weapons:
return
_control_npc:
`npc001=object position x(4)
`if npc001<250
`loop object 4,0,25
`move object 4,-a#
`endif
`if npc001>249
`move object 4,0
`loop object 4,0,0
`endif
`if npc
return
_control_enemies:
return
_control_effects:
height#=0
`x#=object position x(1)
`y#=object position y(1)
`z#=object position z(1)
xrotate object 38,270
return
_control_sounds:
return
return
return
Anyone have any ideas?