Hier sind:
Inhalt getpropertydescriptionlist getbehaviordescription beginsprite exitframe
Inhalt von MultiLoop vom. 28.03.98
Übersicht
-- spielt einen Filmloop wieOft male hintereinander ab
-- I know of no obscure lingo to question a filmloop whether its finished.
-- I had a project with hundreds of filmloops with animations
-- like "talking", "walkingLeft", ...
-- I wanted a FrameScript that could treat them all with minimum adaption
-- necessary.
-- So each FilmLoop keeps the info about its length in its name.
-- i.e.: "talking-3", "walkingLeft-9".
--
-- If i.e. "talking-3" needs to be repeated 10 times
-- the behavior below serves me well. I need not care if
-- someone else decides to add a frame to that loop. If it happens to be
-- "talking-5" in the end, I won't have to change a bazillion of frame scripts.
-- behavior plays a FilmLoop wieOft times
property myAnimCount,myAnimTimes,myWieOft, myMaxLoop
--====== STANDARD BEHAVIOR HANDLERS:
on getPropertyDescriptionList me
on getBehaviorDescription me
on beginSprite me
on exitFrame
Inhalt top Callers
on getPropertyDescriptionList me
set theProps to [:]
set c to "Wie oft denn?"
set f to #integer
set d to 1
set typeProps to [#comment: c, #format: f, #default: d]
addProp theProps, #myWieOft, typeProps
return theProps
end
Inhalt top Callers
on getBehaviorDescription me
set line1 to " This behavior spielt einen Filmloop wieOft male hintereinander ab." & RETURN
return line1
end
Inhalt top Callers
on beginSprite me
set myAnimTimes=1
set myAnimCount=1
set dName=the name of member the member of sprite the spriteNum of me
set da= offset("-", dName)
set myMaxLoop=value(chars(dName,da+1,the number of chars in dName))
put "los gehts",me
end
Inhalt top Callers
on exitFrame
if myMaxLoop<=myAnimCount then
-- aus, wir sind einmal durch
set myAnimCount=1
set myAnimTimes=myAnimTimes + 1
-- kann sein, wir sollen nochmal
if myWieOft<myAnimTimes then
-- ne, echt aus
set myAnimTimes=Value(VOID)
go the frame +1
else
set myAnimCount=1
go the frame
end if
else
set myAnimCount=myAnimCount + 1
go the frame
exit
end if
end
-- /IHV
HTML created by dp tiny script documenting xtra v0.2 28.03.98 pageID=MultiLoop