--Rotate a Sprite clockwise or counterclockwise while sound behavior.
---------------------------------------------------------------------
---------------------------------------------------------------------
addprop desclist, #WhichSprite, [#comment : "The rotating Sprite is Spritenumber", ¬
# format : #integer, # default : ""]
addprop desclist, #HowFast, [#comment : "The Sprites rotation speed is", ¬
# format : #integer, # default : 5, #range : [#min:1, #max:10]]
addprop desclist, #CCW, [#comment : "Rotate CounterClockWise ?", ¬
# format : #boolean, # default : False]
addprop desclist, #RotSound, [#comment : "Play sound during rotation ?", ¬
# format : #boolean, # default : False]
addprop desclist, #WhichSound, [#comment : "Choose a soundmember to play", ¬
# format : #member, # default : ""]
addprop desclist, #WhichChannel, [#comment : "Play sound in which soundchannel (1-8) ?", ¬
# format : #integer, # default : "3"]
return desclist
end getPropertyDescriptionList
on getbehaviordescription
return "Rotate a Sprite clockwise or counterclockwise."&RETURN&"¬
You can set a rotation speed, and use a sound "&RETURN&"¬
while rotating.This behavior acts on mousedown."&RETURN&"¬
Drop on a Sprite to rotate directly, or drop it on "&RETURN&"¬
a button to rotate a given sprite."
end getbehaviordescription
on getbehaviortooltip
return "Rotate a Sprite clockwise or counterclockwise"
end getbehaviortooltip
on mousedown
if RotSound = true then puppetsound WhichChannel, whichSound
repeat while the mousedown
if CCW = FALSE then
sprite (WhichSprite) . rotation = sprite (WhichSprite) . rotation + HowFast
else
sprite (WhichSprite) . rotation = sprite (WhichSprite) . rotation - HowFast
end if
updatestage
end repeat
end mousedown
on mouseup me
puppetSound WhichChannel, 0
end mouseup
Contact
MMI
36 South Court Sq
Suite 300
Newnan, GA 30263
USA