home *** CD-ROM | disk | FTP | other *** search
- on InitializeArrays
- global AR1idx, Ar1sound, Ar1time, Ar1Vol, ar1seg, ar1pos, Ar1col, Ar1Sprite, ar1cast, Ar1play, ARCiidx, ArCitime, ArCitrack, ArCisndcast, ArCiSeg, Ar1track, ArCiname, vsprites
- set AR1idx to Array(mnew)
- set Ar1sound to Array(mnew)
- set Ar1time to Array(mnew)
- set Ar1Vol to Array(mnew)
- set ar1seg to Array(mnew)
- set ar1pos to Array(mnew)
- set Ar1col to Array(mnew)
- set Ar1Sprite to Array(mnew)
- set ar1cast to Array(mnew)
- set Ar1play to Array(mnew)
- set Ar1track to Array(mnew)
- set ARCiidx to Array(mnew)
- set ArCitime to Array(mnew)
- set ArCitrack to Array(mnew)
- set ArCisndcast to Array(mnew)
- set ArCiSeg to Array(mnew)
- set ArCiname to Array(mnew)
- set vsprites to Array(mnew)
- end
-
- on KillArrays
- global AR1idx, Ar1sound, Ar1time, Ar1Vol, ar1seg, ar1pos, Ar1Len, Ar1Sprite, ar1cast, Ar1play, ARCiidx, ArCitime, ArCitrack, ArCisndcast, ArCiSeg, Ar1track, ArCiname, vsprites
- AR1idx(mdispose)
- Ar1sound(mdispose)
- Ar1time(mdispose)
- Ar1Vol(mdispose)
- ar1seg(mdispose)
- ar1pos(mdispose)
- Ar1col(mdispose)
- Ar1Sprite(mdispose)
- ar1cast(mdispose)
- Ar1play(mdispose)
- Ar1track(mdispose)
- ARCiidx(mdispose)
- ArCitime(mdispose)
- ArCitrack(mdispose)
- ArCisndcast(mdispose)
- ArCiSeg(mdispose)
- ArCiname(mdispose)
- vsprites(mdispose)
- end
-
- on InitSprites
- global Sp_idx, Sp_cast, Sp_locH, Sp_locV, Sp_ink, Sp_visib, Sp_name, Sp_fore, Sp_back, Sp_stch, Sp_stcv
- return
- set Sp_idx to Array(mnew)
- set Sp_cast to Array(mnew)
- set Sp_locH to Array(mnew)
- set Sp_locV to Array(mnew)
- set Sp_ink to Array(mnew)
- set Sp_visib to Array(mnew)
- set Sp_name to Array(mnew)
- set Sp_fore to Array(mnew)
- set Sp_back to Array(mnew)
- set Sp_stch to Array(mnew)
- set Sp_stcv to Array(mnew)
- end
-
- on KillSprites
- global Sp_idx, Sp_cast, Sp_locH, Sp_locV, Sp_ink, Sp_visib, Sp_name, Sp_fore, Sp_back, Sp_stch, Sp_stcv
- Sp_idx(mdispose)
- Sp_cast(mdispose)
- Sp_locH(mdispose)
- Sp_locV(mdispose)
- Sp_ink(mdispose)
- Sp_visib(mdispose)
- Sp_name(mdispose)
- Sp_fore(mdispose)
- Sp_back(mdispose)
- Sp_stch(mdispose)
- Sp_stcv(mdispose)
- return
- end
-
- on ar_get fieldname, fieldval
- global maxsegs, segcol, segsprite
- if fieldname = "IDX" then
- set i to 25
- end if
- if fieldname = "SOUND" then
- repeat with i = 1 to 25
- if fieldval = Ar1sound(mget, i) then
- exit repeat
- end if
- end repeat
- end if
- if fieldname = "TIME" then
- repeat with i = 1 to 25
- if fieldval = Ar1time(mget, i) then
- exit repeat
- end if
- end repeat
- end if
- if fieldname = "VOL" then
- repeat with i = 1 to 25
- if fieldval = Ar1Vol(mget, i) then
- exit repeat
- end if
- end repeat
- end if
- if fieldname = "SEG" then
- repeat with i = 1 to 25
- if fieldval = ar1seg(mget, i) then
- exit repeat
- end if
- end repeat
- end if
- if fieldname = "POS" then
- repeat with i = 1 to 25
- if fieldval = ar1pos(mget, i) then
- exit repeat
- end if
- end repeat
- end if
- if fieldname = "COL" then
- repeat with i = 1 to 25
- if fieldval = Ar1col(mget, i) then
- exit repeat
- end if
- end repeat
- end if
- if fieldname = "SPRITE" then
- repeat with i = 1 to 25
- if fieldval = Ar1Sprite(mget, i) then
- exit repeat
- end if
- end repeat
- end if
- if fieldname = "CAST" then
- repeat with i = 1 to 25
- if fieldval = ar1cast(mget, i) then
- exit repeat
- end if
- end repeat
- end if
- if fieldname = "PLAY" then
- repeat with i = 1 to 25
- if fieldval = Ar1play(mget, i) then
- exit repeat
- end if
- end repeat
- end if
- if i = 25 then
- put "AR_GET:>" & fieldname & "< val:>" & fieldval & "< i:>" & i
- end if
- return i
- end
-
- on clear_ARidx
- repeat with i = 1 to 25
- if AR1idx(mget, i) <> 0 then
- AR1idx(mput, i, 0)
- end if
- if ar1seg(mget, i) <> 0 then
- ar1seg(mput, i, 0)
- end if
- if ar1pos(mget, i) <> 0 then
- ar1pos(mput, i, 0)
- end if
- end repeat
- end
-
- on ar_pos2idx track, pos
- if track = 12 then
- set pos to pos - 12
- end if
- set spos to string(pos)
- if length(spos) < 2 then
- set spos to "0" & spos
- end if
- set retidx to 0
- repeat with i = 1 to 12
- if spos = ar1pos(mget, i + track) then
- set retidx to i + track
- exit repeat
- end if
- end repeat
- return retidx
- end
-
- on ar_pos2idxstop track, pos
- if track = 12 then
- set pos to pos - 12
- end if
- set spos to string(pos)
- if length(spos) < 2 then
- set spos to "0" & spos
- end if
- set retidx to 0
- repeat with i = 1 to 12
- if spos = (ar1pos(mget, i + track) + ar1seg(mget, i + track) - 1) then
- set retidx to i + track
- exit repeat
- end if
- end repeat
- return retidx
- end
-
- factory WALK
- method mnew ledidx
- set tmpsprite to getspritenum("WALK")
- set x to value(chars(ARLEDs(mget, ledidx), 2, 4))
- set y to value(chars(ARLEDs(mget, ledidx), 5, 7))
- sprite_show(tmpsprite, x, y)
-
- method mrelease
- set tmpsprite to getspritenum("WALK")
- sprite_blank(tmpsprite)
-
- method mmove ledidx
- set tmpsprite to getspritenum("WALK")
- set x to value(chars(ARLEDs(mget, ledidx), 2, 4))
- set y to value(chars(ARLEDs(mget, ledidx), 5, 7))
- set the locH of sprite tmpsprite to x
- set the locV of sprite tmpsprite to y
-
- factory LEDS
- method mnew x, y
- global reqLEDidx, areon
- if areon = 0 then
- put "Lon>" & areon
- set tmpsprite to getspritenum("LED1")
- set the castNum of sprite tmpsprite to the number of cast "LED1"
- else
- put "Lon>" & areon
- set tmpsprite to getspritenum("LED2")
- set the castNum of sprite tmpsprite to the number of cast "LED2"
- end if
- set the locH of sprite tmpsprite to x
- set the locV of sprite tmpsprite to y
- set the ink of sprite tmpsprite to 36
- puppetSprite(tmpsprite, 1)
-
- method mrelease sp
- sprite_blank(sp)
-
- method mmove sp, x, y
- set the locH of sprite sp to x
- set the locV of sprite sp to y
-
- factory SEGMENTS
- method mnew track, pos, len, col, cast, idx
- instance enterFrame, TSprite, TCol
- global vTSprite, objectCount, gTrack, gPos, GLen, gcast, gXp, gYp
- set TCol to 0
- set TSprite to objectCount
- set the puppet of sprite TSprite to 1
- set the castNum of sprite TSprite to the number of cast gcast
- set the locH of sprite TSprite to gXp
- set the locV of sprite TSprite to gYp
- set the ink of sprite TSprite to 8
- set the foreColor of sprite TSprite to col
- ar1cast(mput, idx, gcast)
- Ar1Sprite(mput, idx, TSprite)
- Ar1col(mput, idx, col)
- set vTSprite to TSprite
-
- method mrelease
- set the locH of sprite TSprite to 1500
- set the locV of sprite TSprite to 1500
- set the puppet of sprite TSprite to 0
-