Übungsaufgabe für alle :: Nr. 2

Übersicht BlitzBasic Beginners-Corner

Gehe zu Seite Zurück  1, 2

Neue Antwort erstellen

wunderkind

Betreff: Re: .........

BeitragMi, Dez 15, 2004 23:49
Antworten mit Zitat
Benutzer-Profile anzeigen
@Kryan
Auch ein schöne Lösung. Ich habe einige Menüeinträge hinzugefügt. Funktioniert einwandfrei.

Suco-X hat Folgendes geschrieben:
Die Aufgabenstellung war vielleicht doch ein wenig zu hoch angesetzt für diesen Forum Bereich.

Das wurde mir auch schon von anderer Stelle gesagt. Die nächste Aufgabe wird wieder etwas einfacher. Obwohl die erste eigentlich mehr Knobelgehalt hatte, als wie die aktuelle.
 

azureuz

BeitragFr, Dez 17, 2004 22:12
Antworten mit Zitat
Benutzer-Profile anzeigen
Kommt bald ne dritte aufgabe? Ich würde gerne was machen...hab nämlich echt ka was ich machen soll!

wunderkind

BeitragSa, Dez 18, 2004 17:53
Antworten mit Zitat
Benutzer-Profile anzeigen
Die nächste Aufgabe kommt morgen. Für viele wird es ein altbekanntes Thema sein, aber es hat trotzdem seinen Reiz.
 

der_idiot

Gast

BeitragSo, Dez 19, 2004 15:45
Antworten mit Zitat
kann man das als vernünftiges programm sehen?
BlitzBasic: [AUSKLAPPEN]

Graphics 800,600,16,3

HidePointer

Global font10 = LoadFont(\"Comic Sans MS\",30,0,0,0)
Global font20 = LoadFont(\"Comic Sans MS\",50,0,0,1)


Type menue
Field optionen.menue
Field laden.menue
Field menueauswahl
End Type

Type laden
Field ladenauswahl
End Type

Type optionen
Field grafik.optionen
Field optionenauswahl
End Type

Type grafik
Field grafikauswahl
End Type

;----------------------------------------------------------------------

Global menueaw.menue = New menue
Global optionenaw.optionen = New optionen
Global ladenaw.laden = New laden
Global grafikaw.grafik = New grafik

;----------------------------------------------------------------------
menuefunction
;----------------------------------------------------------------------
Function menuefunction()

menueaw\menueauswahl = 1
Cls
SetFont font20
Color 255,0,0
Text 0,0,\"MENUE\"

SetFont font10
Color 0,255,0
Text 0,90,\"LADEN...\"
Text 0,120,\"SPEICHERN\"
Text 0,150,\"BEENDEN\"

Color 0,0,255
Text 0,60,\"OPTIONEN...\"

Repeat
If KeyHit(200) Then
menueaw\menueauswahl = menueaw\menueauswahl - 1
hit = 1
EndIf
If menueaw\menueauswahl < 1 Then menueaw\menueauswahl = 4

If KeyHit(208) Then
menueaw\menueauswahl = menueaw\menueauswahl + 1
hit = 1
EndIf
If menueaw\menueauswahl > 4 Then menueaw\menueauswahl = 1

If menueaw\menueauswahl = 1 And hit = 1 Then
Cls
SetFont font20
Color 255,0,0
Text 0,0,\"MENUE\"

SetFont font10
Color 0,255,0
Text 0,90,\"LADEN...\"
Text 0,120,\"SPEICHERN\"
Text 0,150,\"BEENDEN\"

Color 0,0,255
Text 0,60,\"OPTIONEN...\"
If KeyHit(28) Then optionenfunction
hit = 0
EndIf
If menueaw\menueauswahl = 2 And hit = 1 Then
Cls
SetFont font20
Color 255,0,0
Text 0,0,\"MENUE\"

SetFont font10
Color 0,255,0
Text 0,60,\"OPTIONEN...\"
Text 0,120,\"SPEICHERN\"
Text 0,150,\"BEENDEN\"

Color 0,0,255
Text 0,90,\"LADEN...\"
If KeyHit(28) Then ladenfunction
hit = 0
EndIf
If menueaw\menueauswahl = 3 And hit = 1 Then
Cls
SetFont font20
Color 255,0,0
Text 0,0,\"MENUE\"

SetFont font10
Color 0,255,0
Text 0,60,\"OPTIONEN...\"
Text 0,90,\"LADEN...\"
Text 0,150,\"BEENDEN\"

Color 0,0,255
Text 0,120,\"SPEICHERN\"
hit = 0
EndIf
If menueaw\menueauswahl = 4 And hit = 1 Then
Cls
SetFont font20
Color 255,0,0
Text 0,0,\"MENUE\"

SetFont font10
Color 0,255,0
Text 0,60,\"OPTIONEN...\"
Text 0,90,\"LADEN...\"
Text 0,120,\"SPEICHERN\"

Color 0,0,255
Text 0,150,\"BEENDEN\"
If KeyHit(28) Then End
hit = 0
EndIf
If KeyHit(28) And menueaw\menueauswahl =1 Then optionenfunction
If KeyHit(28) And menueaw\menueauswahl =2 Then ladenfunction
If KeyHit(28) And menueaw\menueauswahl =4 Then End
Forever
End Function

Function optionenfunction()

optionenaw\optionenauswahl = 1
Cls
SetFont font20
Color 255,0,0
Text 0,0,\"OPTIONEN\"

SetFont font10
Color 0,255,0
Text 0,90,\"SOUND\"
Text 0,120,\"STEUERUNG\"
Text 0,150,\"ZURÜCK\"

Color 0,0,255
Text 0,60,\"GRAFIK...\"

Repeat
If KeyHit(200) Then
optionenaw\optionenauswahl = optionenaw\optionenauswahl - 1
hit = 1
EndIf
If optionenaw\optionenauswahl < 1 Then optionenaw\optionenauswahl = 4

If KeyHit(208) Then
optionenaw\optionenauswahl = optionenaw\optionenauswahl + 1
hit = 1
EndIf
If optionenaw\optionenauswahl > 4 Then optionenaw\optionenauswahl = 1

If optionenaw\optionenauswahl = 1 And hit = 1 Then
Cls
SetFont font20
Color 255,0,0
Text 0,0,\"OPTIONEN\"

SetFont font10
Color 0,255,0
Text 0,90,\"SOUND\"
Text 0,120,\"STEUERUNG\"
Text 0,150,\"ZURÜCK\"

Color 0,0,255
Text 0,60,\"GRAFIK...\"
If KeyHit(28) Then grafikfunction
hit = 0
EndIf
If optionenaw\optionenauswahl = 2 And hit = 1 Then
Cls
SetFont font20
Color 255,0,0
Text 0,0,\"OPTIONEN\"

SetFont font10
Color 0,255,0
Text 0,60,\"GRAFIK...\"
Text 0,120,\"STEUERUNG\"
Text 0,150,\"ZURÜCK\"

Color 0,0,255
Text 0,90,\"SOUND\"
hit = 0
EndIf
If optionenaw\optionenauswahl = 3 And hit = 1 Then
Cls
SetFont font20
Color 255,0,0
Text 0,0,\"OPTIONEN\"

SetFont font10
Color 0,255,0
Text 0,60,\"GRAFIK...\"
Text 0,90,\"SOUND\"
Text 0,150,\"ZURÜCK\"

Color 0,0,255
Text 0,120,\"STEUERUNG\"
hit = 0
EndIf
If optionenaw\optionenauswahl = 4 And hit = 1 Then
Cls
SetFont font20
Color 255,0,0
Text 0,0,\"OPTIONEN\"

SetFont font10
Color 0,255,0
Text 0,60,\"GRAFIK...\"
Text 0,90,\"SOUND\"
Text 0,120,\"STEUERUNG\"

Color 0,0,255
Text 0,150,\"ZURÜCK\"
If KeyHit(28) Then menuefunction
hit = 0
EndIf
If KeyHit(28) And optionenaw\optionenauswahl =1 Then grafikfunction
If KeyHit(28) And optionenaw\optionenauswahl =4 Then menuefunction
Forever
End Function

Function ladenfunction()
ladenaw\ladenauswahl = 1
Cls
SetFont font20
Color 255,0,0
Text 0,0,\"LADEN\"

SetFont font10
Color 0,255,0
Text 0,90,\"WAV-DATEI\"
Text 0,120,\"TXT-DATEI\"
Text 0,150,\"ZURÜCK\"

Color 0,0,255
Text 0,60,\"BB-DATEI\"

Repeat
If KeyHit(200) Then
ladenaw\ladenauswahl = ladenaw\ladenauswahl - 1
hit = 1
EndIf
If ladenaw\ladenauswahl < 1 Then ladenaw\ladenauswahl = 4

If KeyHit(208) Then
ladenaw\ladenauswahl = ladenaw\ladenauswahl + 1
hit = 1
EndIf
If ladenaw\ladenauswahl > 4 Then ladenaw\ladenauswahl = 1

If ladenaw\ladenauswahl = 1 And hit = 1 Then
Cls
SetFont font20
Color 255,0,0
Text 0,0,\"LADEN\"

SetFont font10
Color 0,255,0
Text 0,90,\"WAV-DATEI\"
Text 0,120,\"TXT-DATEI\"
Text 0,150,\"ZURÜCK\"

Color 0,0,255
Text 0,60,\"BB-DATEI\"
hit = 0
EndIf
If ladenaw\ladenauswahl = 2 And hit = 1 Then
Cls
SetFont font20
Color 255,0,0
Text 0,0,\"LADEN\"

SetFont font10
Color 0,255,0
Text 0,60,\"BB-DATEI\"
Text 0,120,\"TXT-DATEI\"
Text 0,150,\"ZURÜCK\"

Color 0,0,255
Text 0,90,\"WAV-DATEI\"
hit = 0
EndIf
If ladenaw\ladenauswahl = 3 And hit = 1 Then
Cls
SetFont font20
Color 255,0,0
Text 0,0,\"LADEN\"

SetFont font10
Color 0,255,0
Text 0,60,\"BB-DATEI\"
Text 0,90,\"WAV-DATEI\"
Text 0,150,\"ZURÜCK\"

Color 0,0,255
Text 0,120,\"TXT-DATEI\"
hit = 0
EndIf
If ladenaw\ladenauswahl = 4 And hit = 1 Then
Cls
SetFont font20
Color 255,0,0
Text 0,0,\"LADEN\"

SetFont font10
Color 0,255,0
Text 0,60,\"BB-DATEI\"
Text 0,90,\"WAV-DATEI\"
Text 0,120,\"TXT-DATEI\"

Color 0,0,255
Text 0,150,\"ZURÜCK\"
If KeyHit(28) Then menuefunction
hit = 0
EndIf
If KeyHit(28) And ladenaw\ladenauswahl =4 Then menuefunction
Forever
End Function

Function grafikfunction()
grafikaw\grafikauswahl = 1
Cls
SetFont font20
Color 255,0,0
Text 0,0,\"GRAFIK\"

SetFont font10
Color 0,255,0
Text 0,90,\"HINTERGRUND\"
Text 0,120,\"ZEIGER\"
Text 0,150,\"ZURÜCK\"

Color 0,0,255
Text 0,60,\"AUFLÖSUNG\"

Repeat
If KeyHit(200) Then
grafikaw\grafikauswahl = grafikaw\grafikauswahl - 1
hit = 1
EndIf
If grafikaw\grafikauswahl < 1 Then grafikaw\grafikauswahl = 4

If KeyHit(208) Then
grafikaw\grafikauswahl = grafikaw\grafikauswahl + 1
hit = 1
EndIf
If grafikaw\grafikauswahl > 4 Then grafikaw\grafikauswahl = 1

If grafikaw\grafikauswahl = 1 And hit = 1 Then
Cls
SetFont font20
Color 255,0,0
Text 0,0,\"GRAFIK\"

SetFont font10
Color 0,255,0
Text 0,90,\"HINTERGRUND\"
Text 0,120,\"ZEIGER\"
Text 0,150,\"ZURÜCK\"

Color 0,0,255
Text 0,60,\"AUFLÖSUNG\"
hit = 0
EndIf
If grafikaw\grafikauswahl = 2 And hit = 1 Then
Cls
SetFont font20
Color 255,0,0
Text 0,0,\"GRAFIK\"

SetFont font10
Color 0,255,0
Text 0,60,\"AUFLÖSUNG\"
Text 0,120,\"ZEIGER\"
Text 0,150,\"ZURÜCK\"

Color 0,0,255
Text 0,90,\"HINTERGRUND\"
hit = 0
EndIf
If grafikaw\grafikauswahl = 3 And hit = 1 Then
Cls
SetFont font20
Color 255,0,0
Text 0,0,\"GRAFIK\"

SetFont font10
Color 0,255,0
Text 0,60,\"AUFLÖSUNG\"
Text 0,90,\"HINTERGRUND\"
Text 0,150,\"ZURÜCK\"

Color 0,0,255
Text 0,120,\"ZEIGER\"
hit = 0
EndIf
If grafikaw\grafikauswahl = 4 And hit = 1 Then
Cls
SetFont font20
Color 255,0,0
Text 0,0,\"GRAFIK\"

SetFont font10
Color 0,255,0
Text 0,60,\"AUFLÖSUNG\"
Text 0,90,\"HINTERGRUND\"
Text 0,120,\"ZEIGER\"

Color 0,0,255
Text 0,150,\"ZURÜCK\"
If KeyHit(28) Then optionenfunction
hit = 0
EndIf
If KeyHit(28) And grafikaw\grafikauswahl =4 Then optionenfunction
Forever
End Function
 

feider

ehemals "Decelion"

BeitragSo, Dez 19, 2004 15:50
Antworten mit Zitat
Benutzer-Profile anzeigen
Nun, auf 'Beenden' sollte er schon Beenden...

Kryan

BeitragMo, Dez 20, 2004 14:51
Antworten mit Zitat
Benutzer-Profile anzeigen
wo bleibt die nächste aufgabe?
Webspaceanbieter?
Klick hier!
Kultige Spieleschmiede?
Klick hier!
 

Aldi

BeitragFr, Dez 31, 2004 17:45
Antworten mit Zitat
Benutzer-Profile anzeigen
Hab mich mal ein wenig mit Types auseinandergesetzt und habe einen kleinen Menüansatz hingebogen!:

Code: [AUSKLAPPEN]

Type Button
 Field Name$
 Field x,y
End Type

Start.Button= New Button
Ende.Button= New Button
Credits.Button= New Button

Start\Name= "Start"
Start\x= 320
Start\y= 100

Ende\Name= "Ende"
Ende\x= 320
Ende\y= 200

Credits\Name= "Credits"
Credits\x= 320
Credits\y= 300

Graphics 640,480,16,1
SetBuffer BackBuffer()
font= LoadFont("Tahoma",40,1,0,0)
SetFont font
ClsColor 255,255,255

aktiv= 1

Repeat
 Cls
 If KeyHit(208)= 1 Then aktiv= aktiv + 1
 If KeyHit(200)= 1 Then aktiv= aktiv - 1
 If aktiv= 0 Then aktiv= 3
 If aktiv= 4 Then aktiv= 1
 If (KeyHit(28)= 1 Or KeyHit(57)= 1) And aktiv= 2 Then Start
 If aktiv= 1 Then
  Color 0,0,0
  Else Color 255,0,0
 EndIf
 Text Start\x,Start\y,Start\Name,1,1
 If aktiv= 2 Then
  Color 0,0,0
  Else Color 255,0,0
 EndIf
 Text Ende\x,Ende\y,Ende\Name,1,1
 If aktiv= 3 Then
  Color 0,0,0
  Else Color 255,0,0
 EndIf
 Text Credits\x,Credits\y,Credits\Name,1,1
Flip
Delay 25
Until KeyHit(1)= 1

End

Function Start()
 End
End Function


Die Aufgabe hat meinen Ehrgeiz ein wenig gekitzelt. Danke wunderkind! *schleim* *gg*
goto jollyroger.cabanova.de

Gehe zu Seite Zurück  1, 2

Neue Antwort erstellen


Übersicht BlitzBasic Beginners-Corner

Gehe zu:

Powered by phpBB © 2001 - 2006, phpBB Group