home *** CD-ROM | disk | FTP | other *** search
- global oncursor, kidobj, naobj, gamemode, userid, userpw, userpg, userpm, jumpmoviename, jumpmode, lasteventtime
-
- on startMovie
- set oncursor to [the number of cast "onCursor", the number of cast "onCursor" + 1]
- set kidobj to EMPTY
- set naobj to EMPTY
- if not voidp(userid) then
- put userid into field "userID"
- end if
- put 0 into field "label"
- put 0 into field "point"
- set lasteventtime to the ticks
- resetcursor()
- end
-
- on stopMovie
- put " " into field "addInfo"
- end
-
- on resetcursor
- cursor(oncursor)
- end
-
- on allreset
- set kidobj to EMPTY
- set naobj to EMPTY
- repeat with s = 1 to 48
- set the puppet of sprite s to 0
- end repeat
- end
-
- on gameback
- if (the ticks - lasteventtime) > 15 then
- if the frame >= (label("check") - 1) then
- allreset()
- go("loop")
- else
- if the frame >= (label("help") - 1) then
- if objectp(kidobj) then
- set the puppet of sprite clickOn() to 0
- go(label("game") + 1)
- else
- go("loop")
- end if
- else
- if the frame >= label("game") then
- allreset()
- go("loop")
- else
- allreset()
- jumpnetmovie("menu.dcr", 0)
- end if
- end if
- end if
- end if
- set lasteventtime to the ticks
- end
-
- on gamehelp
- set the puppet of sprite clickOn() to 0
- go("help")
- abort()
- end
-
- on gamequit
- if (the ticks - lasteventtime) > 15 then
- if the frame >= (label("check") - 1) then
- allreset()
- jumpnetmovie("menu.dcr", 0)
- else
- showscore()
- end if
- end if
- set lasteventtime to the ticks
- end
-
- on jumpnetmovie mname, jmode
- set jumpmoviename to mname
- set jumpmode to jmode
- if userid = "guest" then
- set jumpmode to 1
- end if
- repeat with s = 1 to 48
- set the puppet of sprite s to 0
- end repeat
- if jumpmode then
- gotonetmovie(mname)
- else
- setuserpm()
- end if
- go("move")
- end
-
- on setuserpm
- getnettext("http://202.224.191.2/cgi-bin/EcOpe.cgi?name=" & userid & "&password=" & userpw & "&amount=" & userpg & "¶meter=" & userpm)
- end
-
- on checknetresult
- if jumpmode then
- exit
- end if
- if netdone() then
- set nresult to nettextresult()
- if nresult starts "<" then
- alert(deletetag(nresult))
- go("loop")
- abort()
- else
- if nresult starts "E000" then
- if line 1 of nresult = "E0000" then
- set rtext to "Error : Server System Error"
- else
- if line 1 of nresult = "E0001" then
- set rtext to "Error : " & userid & "The name is not registered."
- else
- if line 1 of nresult = "E0002" then
- set rtext to "Error : The password is wrong."
- else
- if line 1 of nresult = "E0003" then
- set rtext to "Error : The parameter's form is wrong."
- else
- if line 1 of nresult = "E0003" then
- set rtext to "Error : Your balance is short - you cannot make a withdrawal."
- end if
- end if
- end if
- end if
- end if
- alert(rtext)
- go("loop")
- abort()
- else
- set jumpmode to 1
- gotonetmovie(jumpmoviename)
- end if
- end if
- end if
- end
-
- on deletetag ctext
- repeat while ctext contains "<"
- set fchar to offset("<", ctext)
- set echar to offset(">", ctext)
- delete char fchar to echar of ctext
- end repeat
- return ctext
- end
-
- on resetgame
- set kidobj to birth(script "kid script", 290, 155, 3)
- set naobj to birth(script "national script", 170, 151, 2)
- puppetSound("gong")
- end
-
- on dogame
- rolloverbtn()
- kidmove(kidobj)
- namove(naobj)
- end
-
- on guard
- if the frame >= label("help") then
- exit
- end if
- kidguard(kidobj)
- end
-
- on punchl
- if the frame >= label("help") then
- exit
- end if
- kidpunchl(kidobj)
- end
-
- on punchr
- if the frame >= label("help") then
- exit
- end if
- kidpunchr(kidobj)
- end
-
- on showscore
- repeat with s = 38 to 43
- set the puppet of sprite s to 0
- end repeat
- set ulabel to integer(9 - the dcount of kidobj)
- if ulabel < 0 then
- set ulabel to 0
- end if
- if the dcount of naobj < 9 then
- set ulabel to 0
- end if
- put ulabel into char 9 of userpm
- put integer(ulabel * 10) into field "point"
- if ulabel = 9 then
- put 100 into field "label"
- put "You have been awarded 10 bonus points." & RETURN & "Total points is 100." into field "addInfo"
- else
- put integer(ulabel * 10) into field "label"
- put " " into field "addInfo"
- end if
- go("check")
- end
-
- on rolloverbtn
- set rcnum to the mouseCast
- if rcnum > 0 then
- set rcname to string(the name of cast rcnum)
- if item 2 of rcname = "off" then
- repeat with s = 38 to 43
- if the castNum of sprite s = rcnum then
- set the puppet of sprite s to 1
- set the castNum of sprite s to rcnum + 1
- next repeat
- end if
- set the puppet of sprite s to 0
- end repeat
- else
- if item 2 of rcname = "on" then
- repeat with s = 38 to 43
- if the castNum of sprite s = rcnum then
- if the mouseDown and (clickOn() = s) then
- set the castNum of sprite s to rcnum + 1
- updateStage()
- do(item 1 of rcname)
- end if
- end if
- end repeat
- else
- if item 2 of rcname = "click" then
- repeat with s = 38 to 43
- if the castNum of sprite s = rcnum then
- if the mouseUp then
- set the castNum of sprite s to rcnum - 1
- next repeat
- end if
- end if
- end repeat
- else
- repeat with s = 38 to 43
- set the puppet of sprite s to 0
- end repeat
- end if
- end if
- end if
- else
- repeat with s = 38 to 43
- set the puppet of sprite s to 0
- end repeat
- end if
- end
-
- on allpuppetoff
- repeat with s = 1 to 48
- set the puppet of sprite s to 0
- end repeat
- end
-