ludocus Posted March 26, 2008 Share Posted March 26, 2008 (edited) I had nothing to do and I made this:expandcollapse popup#include <GUIConstants.au3> ;RegDelete ("HKEY_LOCAL_MACHINE\SOFTWARE\fishie","score" ) ;exit $reger = RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\fishie","score" ) $oSp = ObjCreate("SAPI.SpVoice") #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("collect worms", 335, 235, 193, 125) $add = GUICtrlCreateButton("add a worm", 16, 48, 75, 25, 0) $take = GUICtrlCreateButton("take a worm", 16, 96, 75, 25, 0) $worms = GUICtrlCreateLabel("Worms in can: 0", 168, 100, 100, 17) $fish = GUICtrlCreateButton("Go Fishing", 120, 176, 75, 25, 0) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### $dat = 0 While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $add $dat = $dat + 1 GUICtrlSetData ( $worms, 'Worms in can: '&$dat ) Case $take $dat = $dat - 1 GUICtrlSetData ( $worms, 'Worms in can: '&$dat ) Case $fish goFish() exitloop EndSwitch WEnd func goFish() GUIDelete ( $Form1 ) #Region ### START Koda GUI section ### Form= $Form2 = GUICreate("fishing", 452, 320, 193, 125) $fish = GUICtrlCreateButton("Fish", 160, 72, 75, 25, 0) $fishes = GUICtrlCreateLabel("Fish: 0", 128, 160, 278, 24) GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif") $worm = GUICtrlCreateLabel("Worms: "&$dat, 128, 200, 278, 24) GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif") $stop = GUICtrlCreateButton("Stop", 168, 272, 75, 25, 0) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### $f = 0 $hop = 1 While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE msgbox ( 0, "Goodbye", "Goodbye Thnx for playing this game!" ) $oSp.Speak("Goodbye Thanks for playing this game "&$f ) exit Case $fish $reg = RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\fishie","score" ) if $dat = 0 or $dat < 0 Then $oSp.Speak('worms up ' ) sleep ( 200 ) $oSp.Speak('Game over') $oSp.Speak(' Fish cought: '&$f ) msgbox ( 0, "Aww...", "worms up.. Game over.."&@CRLF&"Fish cought: "&$f ) Exit EndIf if $reg > $reger and $hop = 1 then msgbox ( 0, "YAY!", "Hoeray! Highscore reached" ) $hop = $hop + 1 EndIf $r = random ( 1, 2, 1 ) ;GUICtrlSetData ( $fishes, 'Trying to catch a fish' ) $oSp.Speak('Trying to catch a fish..') ;sleep ( 4000 ) if $r = 2 Then $f = $f + 1 $dat = $dat - 1 GUICtrlSetData ( $fishes, 'Fish: '&$f ) GUICtrlSetData ( $worm, 'Worms: '&$dat ) RegWrite ("HKEY_LOCAL_MACHINE\SOFTWARE\fishie","score", "REG_SZ", $f&"" ) Else $dat = $dat - 1 $oSp.Speak("didn't catch a fish" ) ;GUICtrlSetData ( $fishes, "Aww.. didn't catch a fish" ) GUICtrlSetData ( $worm, 'Worms: '&$dat ) ;sleep ( 2000 ) GUICtrlSetData ( $fishes, 'Fish: '&$f ) ;RegWrite ("HKEY_LOCAL_MACHINE\SOFTWARE\fishie","score", "REG_SZ", $f&"" ) EndIf Case $stop msgbox ( 0, "Goodbye", "Goodbye Thnx for playing this game!" ) $oSp.Speak("Goodbye Thanks for playing this game " ) exit EndSwitch WEnd EndFuncEnjoy! Edited March 26, 2008 by ludocus Link to comment Share on other sites More sharing options...
Tomb Posted March 26, 2008 Share Posted March 26, 2008 i found this out the hard way. don't use negative worms. in fact you should disallow negative worms Link to comment Share on other sites More sharing options...
ludocus Posted March 26, 2008 Author Share Posted March 26, 2008 i found this out the hard way. don't use negative worms.in fact you should disallow negative worms Exactly..so go play my game Link to comment Share on other sites More sharing options...
Tomb Posted March 26, 2008 Share Posted March 26, 2008 Exactly..so go play my game just did but where are fish and worm animations? Link to comment Share on other sites More sharing options...
Swift Posted March 26, 2008 Share Posted March 26, 2008 Kinda...ugh...I can put it a nice way...I don't like it..really..the voice is annoying..and theres really no point to it.. Link to comment Share on other sites More sharing options...
ludocus Posted March 26, 2008 Author Share Posted March 26, 2008 I had nothing to do and I made this:...I had nothing to do..so I dind't wan't to take long making it.. so no animations.. Link to comment Share on other sites More sharing options...
ludocus Posted March 26, 2008 Author Share Posted March 26, 2008 I HAD NOTHING TO DO... so it is not a thing that I was planning to do and took long to make it.. Link to comment Share on other sites More sharing options...
Tomb Posted March 26, 2008 Share Posted March 26, 2008 I HAD NOTHING TO DO...so it is not a thing that I was planning to do and took long to make it..ok thats a start.now make it better. add animations Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now