home *** CD-ROM | disk | FTP | other *** search
- property Sp, SpriteList, pRadius, RoseOpen, RoseMode, tc, bWidth, fWidth, aRad, degMod, aDegMod
-
- on beginSprite me
- Sp = sprite(me.spriteNum)
- tc = 0
- bWidth = 60
- fWidth = 100
- degMod = 90
- aRad = 0
- Sp.width = bWidth
- Sp.height = bWidth
- sprite(Sp).member.centerRegPoint = 1
- pRadius = 70
- RoseOpen = 0
- SpriteList = [:]
- SpriteList = [sprite(22), sprite(23), sprite(24), sprite(25), sprite(26)]
- repeat with i = 1 to SpriteList.count
- SpriteList[i].loc = Sp.loc
- SpriteList[i].visible = 0
- SpriteList[i].member.centerRegPoint = 1
- end repeat
- end
-
- on exitFrame me
- if RoseOpen = 0 then
- if mGetDistance(the mouseLoc, Sp.loc) < pRadius then
- OpenRose()
- RoseOpen = 1
- end if
- end if
- if RoseOpen then
- if mGetDistance(the mouseLoc, Sp.loc) > (pRadius + 20) then
- CloseRose()
- RoseOpen = 0
- end if
- end if
- case RoseMode of
- "exp":
- if tc <> 1.0 then
- tc = tc + 0.20000000000000001
- Sp.width = bWidth + float((fWidth - bWidth) * tc)
- Sp.height = bWidth + float((fWidth - bWidth) * tc)
- aDegMod = degMod * tc
- aRad = pRadius * tc
- else
- RoseMode = "Open"
- Sp.width = 89
- Sp.height = 90
- repeat with i = 1 to SpriteList.count
- SpriteList[i].visible = 1
- end repeat
- put tc
- end if
- "shk":
- if tc > 0.0 then
- tc = tc - 0.20000000000000001
- Sp.width = bWidth + float((fWidth - bWidth) * tc)
- Sp.height = bWidth + float((fWidth - bWidth) * tc)
- aDegMod = degMod * tc
- aRad = pRadius * tc
- else
- RoseMode = "closed"
- repeat with i = 1 to SpriteList.count
- SpriteList[i].visible = 0
- end repeat
- end if
- end case
- baseLoc = point(Sp.locH, Sp.locV)
- deg = 360 / SpriteList.count
- repeat with o = 1 to SpriteList.count
- SpLoc = getXYPos(vector(baseLoc.locH, baseLoc.locV, 0), (deg * (o - 1)) - aDegMod, aRad)
- SpriteList[o].loc = point(SpLoc.x, SpLoc.y)
- SpriteList[o].blend = tc * 100
- end repeat
- end
-
- on CloseRose
- tc = 1.0
- RoseMode = "shk"
- end
-
- on OpenRose
- repeat with i = 1 to SpriteList.count
- SpriteList[i].visible = 1
- SpriteList[i].blend = 0
- end repeat
- tc = 0
- RoseMode = "exp"
- end
-
- on getXYPos origin, ang, dist
- myA = DegreesToRads(ang)
- return vector(origin.x + (dist * cos(myA)), origin.y + (dist * sin(myA)), 0)
- end
-
- on DegreesToRads aAngle
- return aAngle * PI / 180
- end
-
- on mGetDistance aPoint, AnotherPoint
- pDistance = sqrt(power(aPoint.locH - AnotherPoint.locH, 2) + power(aPoint.locV - AnotherPoint.locV, 2))
- return pDistance
- end
-