i suppose you could check every sprite in every frame, but i think a
more organized way of doing it is to create some kind of sprite manager
(global object) that keeps track of which sprite channels are occupied,
and even what's in them. 
you can make it store as much info about the sprites as you like, but on
the most basic level, give each sprite a registration behaviour that
sends its spritenum of the manager, and then you can easily query the
manager as to the highest occupied channel....

--bhakti


clars danvold wrote:
> 
> hello all-
> 
> Messing with a handler that reports the highest occupied sprite channel
> (for spawning/puppeting new sprites), I find myself a a bit stumped.
> 
> The handler below works, but only for the current frame; if the user
> jumps to a frame containing more sprites than the current one, the info
> is inaccurate, and my poor puppets cause errors.
> 
> Is there any way I can check ALL the frames without actually playing
> them?
> 
> on getEmptyChannel me
>   tLastChan = the lastChannel
>   --find the last OCCUPIED channel
>   repeat with i = tLastChan down to 1
>     if sprite(i).type <> 0 then
>       --return the EMPTY channel after it
>       emptyChan = i + 1
>       exit repeat
>     end if
>   end repeat
>   return emptyChan
> end
> 
> regards and thanks
> Clars Danvold
> 
> [To remove yourself from this list, or to change to digest mode, go to
> http://www.penworks.com/LUJ/lingo-l.cgi  To post messages to the list,
> email [EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED])
> Lingo-L is for learning and helping with programming Lingo.  Thanks!]

-- 
R. Bhakti Klein
Educational Software R & D
http://www.DLWorkshop.net
��
Baritone
���
"On Earth, you can only do little things;
but you can do them with a lot of Love."
                              -- Mother Theresa

[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi  To post messages to the list,
email [EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo.  Thanks!]

Reply via email to