Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- define constant(1, flashlight timer)
- plotscript, flashlight circle of light, begin
- lights are off()
- setup flashlight
- variable (room which called script)
- room which called script := current map
- flashlight iteration()
- end
- plotscript, cancel flashlight, begin
- stop timer(flashlight timer)
- #free slice (flashlight circle)
- flashlight circle := 0
- flashlight circle of light()
- end
- script, flashlight iteration, begin
- if (current map <> room which called script) then (
- cancel flashlight
- exit script
- )
- # Keep moving above all other map slices, because the order could change when
- # the map changes
- if (flashlight circle <> last child (parent slice (flashlight circle))) then (
- move slice above (flashlight circle, last child (lookup slice (sl:map root)))
- )
- # Because the slice is parented to the maproot its
- # position is in map coordinates
- put slice (flashlight circle, hero pixel x, hero pixel y)
- # call this script again on the next tick
- set timer(flashlight timer, 0, 1, @flashlight iteration)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement