Creating menu for a game... Plz Help!!!!

Blitz3D Forums/Blitz3D Beginners Area/Creating menu for a game... Plz Help!!!!

NerdyBrendan(Posted 2010) [#1]
I really need urgent help for this matter.... I want to make a game (FPS) that has a menu at the beginning (like 'Click to Play' or something like that)... If anyone can help.... that would be excellent!


Midimaster(Posted 2010) [#2]
You can use any 2D command before FLIP. And you can use Sub-Functions to jump into different parts of your game. So....
Graphics3D 800,600
Light=CreateLight()
Cube=CreateCube()
Camera=CreateCamera()
MoveEntity Camera,-2,1.5,-5

Repeat
    Color 5,55,155
    Rect 0,0,800,600
    Color 255,255,255
    Text 100,100,"Press <1> to start the game"
    Text 100,150,"Press <2> to make settings"
    Text 100,200,"Press <ESC> To Exit"
    If KeyHit(2) Then
        StartNow
    ElseIf KeyHit(3) Then
        SettingsNow
    Else
        ;....
    EndIf
    Delay 15
    Flip 0
Until KeyHit(1)



Function StartNow()
    ; pre game code
    Repeat
         ; game code
         RenderWorld()
         Color 255,255,255
         Text 100,200,"Press <ESC> To Return"
         Flip 0
    Until KeyHit(1)
End Function



Function SettingsNow()
    Repeat
        Color 155,155,5
        Rect 0,0,800,600
        Color 255,255,255
       Text 100,100,"Press <1> to select Engine"
        Text 100,150,"Press <2> to change wappon"
        Text 100,200,"Press <ESC> To Return"
        If KeyHit(2) Then
            ; code for select engine
        ElseIf KeyHit(3) Then
            ; code for slect wappons
        Else
            ;....
        EndIf
        Delay 15
        Flip 0
    Until KeyHit(1)
End Function     


Each Part has its own Repeat/Until-Loop and its own FLIP command. An KeyHit(1) which is <ESC> brings you back to the main loop


NerdyBrendan(Posted 2010) [#3]
Cool! Thanks!!!