home *** CD-ROM | disk | FTP | other *** search
- on initlamp
- global glptmp
- repeat with i = 14 to 29
- set the puppet of sprite i to 1
- end repeat
- set glptmp to 0
- end
-
- on clearlamp
- repeat with i = 14 to 29
- set the puppet of sprite i to 0
- end repeat
- end
-
- on movelamp n
- global glpl, glpr, glptmp
- if n = 1 then
- if glptmp = 0 then
- if getAt(glpr, 4) = 0 then
- repeat with i = 4 to 7
- setAt(glpr, i, getAt(glpr, i + 1))
- end repeat
- setAt(glpr, 8, 0)
- else
- set glptmp to 4
- end if
- else
- if getAt(glpr, 4) = 1 then
- setAt(glpr, 4, 2)
- setAt(glpr, 5, 2)
- else
- setAt(glpr, 4, 1)
- setAt(glpr, 5, 1)
- end if
- set glptmp to glptmp - 1
- if glptmp = 0 then
- resetlamp(1)
- end if
- end if
- else
- if n = 2 then
- if glptmp = 0 then
- if getAt(glpr, 4) = 0 then
- repeat with i = 1 to 3
- setAt(glpr, i + 1, getAt(glpr, i))
- end repeat
- else
- set glptmp to 5
- end if
- else
- if glptmp = 1 then
- if getAt(glpr, 1) <> 0 then
- repeat with i = 1 to 3
- setAt(glpr, 4 - i, getAt(glpr, 5 - i))
- end repeat
- setAt(glpr, 4, 0)
- else
- set glptmp to 0
- resetlamp(2)
- end if
- else
- set glptmp to glptmp - 1
- set j to 1
- if getAt(glpr, 1) = 1 then
- set j to 2
- end if
- repeat with i = 1 to 4
- setAt(glpr, i, j)
- end repeat
- end if
- end if
- else
- if n = 3 then
- set j to 0
- if getAt(glpr, 1) = 0 then
- set j to 1
- end if
- repeat with i = 1 to 8
- setAt(glpr, i, j)
- setAt(glpl, i, j)
- end repeat
- else
- if n = 4 then
- if glptmp < 17 then
- set j to getAt(glpr, 8)
- set k to getAt(glpl, 1)
- repeat with i = 1 to 7
- setAt(glpr, 9 - i, getAt(glpr, 8 - i))
- setAt(glpl, i, getAt(glpl, i + 1))
- end repeat
- setAt(glpr, 1, k)
- setAt(glpl, 8, j)
- set glptmp to glptmp + 1
- else
- if glptmp < 22 then
- set j to 0
- if getAt(glpl, 1) = 0 then
- set j to 1
- end if
- repeat with i = 1 to 8
- setAt(glpr, i, j)
- setAt(glpl, i, j)
- end repeat
- set glptmp to glptmp + 1
- else
- set glptmp to 0
- resetlamp(4)
- end if
- end if
- end if
- end if
- end if
- end if
- end
-
- on resetlamp n
- global glpl, glpr, glptmp
- repeat with i = 1 to 8
- setAt(glpr, i, 0)
- setAt(glpl, i, 0)
- end repeat
- set glptmp to 0
- if n = 1 then
- setAt(glpr, 7, 1)
- setAt(glpr, 8, 1)
- else
- if n = 2 then
- setAt(glpr, 1, 1)
- else
- if n = 3 then
- else
- if n = 4 then
- setAt(glpr, 1, 1)
- setAt(glpr, 2, 1)
- setAt(glpr, 8, 2)
- setAt(glpl, 1, 1)
- setAt(glpl, 7, 2)
- setAt(glpl, 8, 2)
- end if
- end if
- end if
- end if
- end
-
- on updatelamp
- global glpl, glpr
- repeat with i = 1 to 8
- set the castNum of sprite (i + 21) to getAt(glpl, i) + 28
- set the castNum of sprite (i + 13) to getAt(glpr, i) + 28
- end repeat
- end
-