Ich hätte ein neues Noob Projekt und hoffe mal das ein paar Leute es Interresant finden und mitarbeiten... =)
Wie weit ich bin:
- Gui
- Punkte System
- Die "Basis" fürs Programm
Was noch fehlt:
- Fragen per Text datei auslesen/einfügen
- Zufalls system für die Fragen
- "Kastensystem" damit öfter richtige Beantwortete Fragen seltener gestellt werden
- (eher unwichtig) Kleine Belohnungen wie kurze Filme etc.
Spoiler anzeigen
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
$punkte= 0
$pos= 50
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 625, 443, 192, 124)
$Label1 = GUICtrlCreateLabel("Lern Trainer", 192, 16, 259, 41)
GUICtrlSetFont(-1, 25, 400, 0, "MS Sans Serif")
$Label2 = GUICtrlCreateLabel("Punkte", 16, 96, 26, 17)
$Label3 = GUICtrlCreateLabel("Label3", 64, 96, 36, 17)
$Edit1 = GUICtrlCreateEdit("", 112, 144, 409, 137, $ES_WANTRETURN)
GUICtrlSetData(-1, "Edit1")
$Group1 = GUICtrlCreateGroup("Group1", 48, 304, 529, 137)
$A = GUICtrlCreateButton("A", 80, 328, 227, 41, $WS_GROUP)
$B = GUICtrlCreateButton("C", 80, 376, 227, 41, $WS_GROUP)
$C = GUICtrlCreateButton("B", 320, 328, 227, 41, $WS_GROUP)
$D = GUICtrlCreateButton("D", 320, 376, 227, 41, $WS_GROUP)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Label4 = GUICtrlCreateLabel("", 128, 112, 390, 28)
GUICtrlSetFont(-1, 15, 400, 0, "MS Sans Serif")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
$round=0
$correct=0
$save=0
GUICtrlSetData($label3,$punkte)
GUICtrlSetData($label4,"Die "& $pos & " Punkte Frage ")
MsgBox(0,"Lern Trainer","Das Spiel beginnt nach dem Klicken auf 'OK' oder nach 5 sekunden",5)
_setquestions()
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $A
If $correct="a" Then
MsgBox(64,"Richtig!","Sehr gut. Auf zur nächsten Frage!")
$punkte=$pos
GUICtrlSetData($label3,$punkte)
_setQuestions()
Else
MsgBox(16,"Oops","Leider falsch"&$save&" Punkte")
GUICtrlSetData($label4,"Leider falsch. Du hast "&$save&" Punkte gewonnen")
GUICtrlSetData($edit1,"")
GUICtrlSetData($A,"A")
GUICtrlSetData($B,"B")
GUICtrlSetData($C,"C")
GUICtrlSetData($D,"D")
$round=0
$correct=0
$save=0
msgBox(0,"Leider falsch","Na dann noch mal")
_setquestions()
EndIf
Case $B
If $correct="b" Then
MsgBox(64,"Richtig!","Sehr gut. Auf zur nächsten Frage!")
$punkte=$pos
GUICtrlSetData($label3,$punkte)
_setQuestions()
Else
MsgBox(16,"Oops","Leider falsch "&$save&" Punkte")
GUICtrlSetData($label4,"Leider falsch. Du hast "&$save&" Punkte gewonnen")
GUICtrlSetData($edit1,"")
GUICtrlSetData($A,"A")
GUICtrlSetData($B,"B")
GUICtrlSetData($C,"C")
GUICtrlSetData($D,"D")
$round=0
$correct=0
$save=0
msgBox(0,"Neues Spiel","Es wird ein neues Spiel begonnen")
_setquestions()
EndIf
Case $C
If $correct="c" Then
MsgBox(64,"Richtig!","Ja, genau. Los, nächste Frage!")
$punkte=$pos
GUICtrlSetData($label3,$punkte)
_setQuestions()
Else
MsgBox(16,"Oops","Leider falsch "&$save&" Punkte")
GUICtrlSetData($label4,"Leider falsch. Du hast "&$save&" Punkte gewonnen")
GUICtrlSetData($edit1,"")
GUICtrlSetData($A,"A")
GUICtrlSetData($B,"B")
GUICtrlSetData($C,"C")
GUICtrlSetData($D,"D")
$round=0
$correct=0
$save=0
msgBox(0,"Leider falsch","Na dann noch mal")
_setquestions()
EndIf
Case $D
If $correct="d" Then
MsgBox(64,"Richtig!","Sehr gut. Auf zur nächsten Frage!")
$money=$pos
GUICtrlSetData($label3,$punkte)
_setQuestions()
Else
MsgBox(16,"Oops","Leider falsch "&$save&" Punkte")
GUICtrlSetData($label4,"Leider falsch. Du hast "&$save&" Punkte gewonnen")
GUICtrlSetData($edit1,"")
GUICtrlSetData($A,"A")
GUICtrlSetData($B,"B")
GUICtrlSetData($C,"C")
GUICtrlSetData($D,"D")
$round=0
$correct=0
$save=0
msgBox(0,"Leider falsch","Na dann noch mal")
_setquestions()
EndIf
EndSwitch
WEnd
Func _setQuestions()
If $punkte= 500 Then
$save= 500
elseif $punkte= 5000 Then
$save= 5000
EndIf
$round=$round+1
Switch $round
Case 1
$pos = 50
GUICtrlSetData($label4,"Die "& $pos & " Punkte Frage")
GUICtrlSetData($edit1,"Beispielfrage")
GUICtrlSetData($A,"A: Antwort A")
GUICtrlSetData($B,"B: Antwort B")
GUICtrlSetData($C,"C: Antwort C")
GUICtrlSetData($D,"D: Antwort D")
$correct="a" ;Antwort a ist richtig
Case 2
$pos=100
GUICtrlSetData($label4,"Die "& $pos & " Punkte Frage")
GUICtrlSetData($edit1,"Beispielfrage")
GUICtrlSetData($A,"A: Antwort A")
GUICtrlSetData($B,"B: Antwort B")
GUICtrlSetData($C,"C: Antwort C")
GUICtrlSetData($D,"D: Antwort C")
$correct="b" ;Antwort b ist richtig
EndSwitch
EndFunc