Sign in to follow this  
Followers 0
ludocus

fishie - The game ;)

8 posts in this topic

#1 ·  Posted (edited)

I had nothing to do and I made this:

#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

EndFunc

Enjoy!

Edited by ludocus

Share this post


Link to post
Share on other sites



i found this out the hard way. don't use negative worms.

in fact you should disallow negative worms :)

Share this post


Link to post
Share on other sites

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 :)

Share this post


Link to post
Share on other sites

Exactly..

so go play my game :)

just did

but where are fish and worm animations?

Share this post


Link to post
Share on other sites

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..

Share this post


Link to post
Share on other sites

:)

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..

Share this post


Link to post
Share on other sites

I HAD NOTHING TO DO...

so it is not a thing that I was planning to do and took long to make it..

Share this post


Link to post
Share on other sites

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 :)

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0