Menu Hilfe,...

Übersicht BlitzBasic Allgemein

Neue Antwort erstellen

 

Svolf

Betreff: Menu Hilfe,...

BeitragSo, März 12, 2006 18:07
Antworten mit Zitat
Benutzer-Profile anzeigen
Kann mir jemand helfen also das hier wäre mein Menu

Code: [AUSKLAPPEN]
AppTitle "Quiz  Beta Version 0.1                                                                                                         
Graphics 800,600,16,2
SetBuffer BackBuffer()

SetFont(LoadFont("Comic Sans MS",30,1))

Const game_pause = 1
Const game_menue = 2
Const game_haupt = 3
Const game_over = 4

Global game_zustand = game_menue

Repeat

Select game_zustand
Case game_menue
GameMenue()
Case game_haupt
GameHaupt()
Case game_pause
GamePause()
End Select

Until game_zustand = game_over
End

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

Function GameMenue()

Local temp_zustand = game_zustand

FlushMouse()
FlushKeys()

Repeat
ClsColor 100,20,100
Cls
Color 0,0,255
Text GraphicsWidth()/2,100,"ICH BIN DAS MENUE!!!",1,1

Color 255,255,255
Text GraphicsWidth()/2,400,"START"

Color 255,255,255
Text GraphicsWidth()/2,500,"ENDE"

If MouseHit(1)
If RectsOverlap(MouseX(),MouseY(),1,1,GraphicsWidth()/2,400,StringWidth("START"),StringHeight("START"))
game_zustand = game_haupt
ElseIf RectsOverlap(MouseX(),MouseY(),1,1,GraphicsWidth()/2,500,StringWidth("ENDE"),StringHeight("ENDE"))
game_zustand = game_over
EndIf
EndIf
 

If KeyHit(1)
End
EndIf
Flip

Until game_zustand<>temp_zustand

End Function

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

Function GameHaupt()

Local temp_zustand = game_zustand
Local x = GraphicsWidth()/2
Local y = GraphicsHeight()/2
Local h = 0

FlushKeys()
FlushMouse()

Repeat
ClsColor 200,200,200
Cls

Color 0,0,255
Text 400, 100,"Willkommen!",1,1

Color 250,0,0
Locate 250,250
Name$=Input$("Wie ist Ihr Name? ")
Locate 250,300
Alter#=Input("Wie alt sind Sie? ")
Locate 190,450
Beginn$=Input("Möchten Sie nun beginnen Ja/Nein? ")
 If  Beginn$="Ja" Then
   Print "ok mom,....."
 
 If  Beginn$="Nein" Then
   Print "Schade"
EndIf
 EndIf

If KeyHit(57)
game_zustand = game_pause
EndIf

If KeyHit(1)
game_zustand = game_menue
EndIf

Flip
Until game_zustand<>temp_zustand

End Function

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

Function GamePause()

Local temp_zustand = game_zustand

FlushKeys()
FlushMouse()

Repeat
ClsColor 255,0,0
Cls

Color 0,0,255
Text GraphicsWidth()/2,GraphicsHeight()/2,"ICH BIN DIE PAUSE!!!",1,1

If KeyHit(57)
game_zustand = game_haupt
EndIf

Flip
Until game_zustand<>temp_zustand

End Function



Ich wollte fragen da wo man Namen auswählt wenn ich jetzt z.B. ein Quiz machen möchte das er alles löscht und es nun ein neues Fenster kommt das könnte man doch mit include am besten machen ok also sage ich,..



if Beginn$="ja" then
Include "...."

aber er machs net entweder öffnet er gleich die andere include oder sagt end of,....... kann mir da jemand helfen wie ich das machen könnte[/quote]

skey-z

BeitragSo, März 12, 2006 20:37
Antworten mit Zitat
Benutzer-Profile anzeigen
Includes dürfen nur im Hauptprogramm stehen, weil sie fügen dann alles was darin steht an dieser position ein.

Also musst du dort wo auh deine Konstanten stehen die includes einfügen.
Darin können nun wieder funktionen stehen, die du aus deinem Programm aufrufen kannst, oder auch Global, Const, Types und Arrays können dort drin stehen, dürfen dann allerdings nihct in einer funktion sein.
Awards:
Coffee's Monatswettbewerb Feb. 08: 1. Platz
BAC#57: 2. Platz
Twitter

Neue Antwort erstellen


Übersicht BlitzBasic Allgemein

Gehe zu:

Powered by phpBB © 2001 - 2006, phpBB Group