home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
LAUNCH 2
/
LAUNCH.BIN
/
mac
/
SONY
/
MAINMOV.DIR
/
00010_Script_10
< prev
next >
Wrap
Text File
|
1995-06-07
|
13KB
|
461 lines
--3D Spin
---------------------------------------------------------------------
---------------------------------------------------------------------
--called from the score to initialize the spinning discman section
on SPIN3D
global QTMovieSprite,xframecount,yframecount,ChosenView,QTPath
global MaxX,MaxY
set QTPath = the pathName
put 0 into ChosenView
put 20 into QTMovieSprite
set the movietime of sprite(QTMovieSprite) = 184
set the movierate of sprite(QTMovieSprite) = 0
updatestage
put 9 into maxY --number of rotations along Y
put 22 into maxX --number of rotations around X
put 4 into xframecount
put 5 into yFrameCount
end
---------------------------------------------------------------------
---------------------------------------------------------------------
--called on the mousedown when the user clicks on a draggable portion
--of the discman
on TRACKUSER
global clickoriginH,clickoriginV,xFrameCount,FirstXFrame,yFrameCount,FirstYFrame
global MaxX,MaxY,LastXMouseMove,LastYMouseMove
put 0 into LastXMouseMove
put 0 into LastYMouseMove
if xframecount = "" then put 1 into xframecount
if yFrameCount = "" then put 7 into yFrameCount
put xFrameCount into FirstXFrame
put yFrameCount into FirstYFrame
set clickoriginH = the mouseH
set clickoriginV = the mouseV
repeat while the stillDown
--Number of pixels user must move to advance 1 frame
put 10 into PixPerFrame
--Get x movement
put clickoriginH into XOrigin
put (XOrigin - MouseH()) into MouseMove
if MouseMove < 0 then put true into ItsNeg
else put false into ItsNeg
--Figure x movement
put mousemove into LastXMouseMove
put abs (mouseMove) into mouseMove
put integer(MouseMove / PixPerFrame) into xFramemove
if ItsNeg then put FirstXFrame + xFramemove into xFrameCount
else put FirstXFrame - xFramemove into xFrameCount
if xFrameCount <= 0 then
repeat while xFrameCount <= 0
put (MaxX + xFrameCount) into xFrameCount
end repeat
end if
if xFrameCount >= (MaxX) then
repeat while xFrameCount >= (MaxX)
put (xFrameCount - MaxX) into xFrameCount
end repeat
end if
--Get y movement
put clickoriginV into YOrigin
put (YOrigin - MouseV()) into MouseMove
if MouseMove < 0 then put true into ItsNeg
else put false into ItsNeg
--Figure y movement
put mousemove into LastYMouseMove
put abs(mouseMove) into mouseMove
put integer(MouseMove / PixPerFrame) into yFramemove
if not ItsNeg then put FirstYFrame - yFramemove into yFrameCount
else put FirstYFrame + yFramemove into yFrameCount
if yFrameCount <= 0 then put 1 into yFrameCount
if yFrameCount > (MaxY) then put MaxY into yFrameCount
--this calls the handler to update the discman to display
--the current frame the user wants to see
PlayThisFrame (xFrameCount,yFrameCount)
end repeat
end
---------------------------------------------------------------------
---------------------------------------------------------------------
--show the user the frame they want to see on the 3D draggable
--discman
on PlayThisFrame xFrameCount,yFrameCount
global MaxX,QTMovieSprite
put (xFrameCount + ((yFrameCount-1)*MaxX)) * 4 into frameCount
set the movieTime of sprite(QTMovieSprite) to (frameCount/2)
updatestage
-- go to the frame
end
---------------------------------------------------------------------
---------------------------------------------------------------------
--when the user lets go of the 3D discman after spinning it around
--the discman will spin to one of the six positions
--called from the mouseup of the discman
on RESET3D
global QTMovieSprite
PICKVIEW
CHECKVIEW
end
---------------------------------------------------------------------
---------------------------------------------------------------------
--selects one of the six views to rotate the disman to
--called from RESET3D
on PICKVIEW
global XframeCount,YframeCount
-------------------------
--Y is forward
set sideForwardX = 0.0
set sideForwardY = 1.0
--X=5 is 5th axis, 22 rotations
set sideFrontx = 4.0
set sideFronty = 5.0
set sideLeftx = 10.0
set sideLefty = 5.0
set sideRightx = 21.0
set sideRighty = 5.0
set sideBackx = 15.0
set sideBacky = 5.0
--Y is rear side
set sideRearX = 19.0
set sideRearY = 9.0
-------------------------
if YframeCount < 3 then
ROTATETOVIEW(sideForwardX,sideForwardY)
else
if YframeCount > 7 then
ROTATETOVIEW(sideRearX,sideRearY)
else
if XframeCount < 7 then ROTATETOVIEW(sideFrontX,sideFrontY)
else if XframeCount <14 then ROTATETOVIEW(sideLeftX,sideLeftY)
else if XframeCount >18 then ROTATETOVIEW(sideRightX,sideRightY)
else ROTATETOVIEW(sideBackX,sideBackY)
end if
end if
end
---------------------------------------------------------------------
---------------------------------------------------------------------
--rotates the disman to one of the six views
--called from PICKVIEW
on ROTATETOVIEW XdestFrame, YdestFrame
global XframeCount,YframeCount
set Xdif =(XdestFrame) - (XframeCount)
set Xdif = (Xdif + .0)
set Ydif = (YdestFrame) - (YframeCount)
set Ydif = (Ydif + .0)
If Xdif = 0 then
set slope = 0
else
set slope = float(Ydif/Xdif)
end if
set offSet = (YframeCount) - (slope * XframeCount)
If abs(Xdif) > abs(Ydif) then
set numPoints = abs(Xdif) - 1
If numpoints <= 0 then
set XframeCount = XdestFrame
set YframeCount = YdestFrame
PlayThisFrame(XframeCount,YframeCount)
exit
end if
set step = (Xdif) / (numPoints +1)
repeat with i = 1 to numPoints
set Xpoint = integer(XframeCount + (i * step))
set Ypoint = integer((slope * Xpoint) + offSet)
PlayThisFrame(Xpoint,Ypoint)
end repeat
else
set numPoints = abs(Ydif) - 1
IF numPoints <= 0 then
set XframeCount = XdestFrame
set YframeCount = YdestFrame
PlayThisFrame(XframeCount,YframeCount)
exit
end if
set step =(Ydif) / (numPoints + 1)
repeat with i = 1 to numpoints
set Ypoint = integer(YframeCount + (i * step))
IF slope = 0 then
set Xpoint = XframeCount
else
set Xpoint = integer((Ypoint - offSet) / slope)
end if
PlayThisFrame(Xpoint,Ypoint)
end repeat
end if
set XframeCount = XdestFrame
set YframeCount = YdestFrame
PlayThisFrame(XframeCount,YframeCount)
end
---------------------------------------------------------------------
---------------------------------------------------------------------
--sets the variable telling me what view the user stopped to
--look at from the 3D discman
--called from RESET3D
on CHECKVIEW
global ChosenView,QTMovieSprite,WhatSide
global Area1,Area2,Area3,Area4,Area5,Area6
put the movieTime of sprite(QTMovieSprite) into ChosenView
--the numbers below is the current frame of the movie
if ChosenView = 0 then set WhatSide = 1 --forward side
else if ChosenView = 390 then set WhatSide = 2 --rear side
else if ChosenView = 184 then set WhatSide = 3 --front/top side
else if ChosenView = 196 then set WhatSide = 4 --left side
else if ChosenView = 218 then set WhatSide = 5 --right side
else if ChosenView = 206 then set WhatSide = 6 --back side
--now we have the side, next determine the hotspots
set textBlock = the number of cast("Side" & "." & WhatSide)
set numItem = (the number of lines in the text of cast(textblock))
repeat with i = 1 to (numItem)
put (item 1 to 4 of line i of the text of cast(textBlock)) into it
set Area= rect(integer(item 1 of it),integer(item 2 of it),integer(item 3 of it),integer(item 4 of it))
if i = 1 then set Area1 = Area
else if i = 2 then set Area2 = Area
else if i = 3 then set Area3 = Area
else if i = 4 then set Area4 = Area
else if i = 5 then set Area5 = Area
else if i = 6 then set Area6 = Area
end repeat
end
---------------------------------------------------------------------
---------------------------------------------------------------------
--checks for the mouseloc during the playback head loop
--in the score, changes the cursor to allow user to click
--a choice or simply spin the discman
on CHECKMOUSELOC
global QTMovieSprite,area
global Area1,Area2,Area3,Area4,Area5,Area6
set rollPoint = point(the mouseH,the mouseV)
if inside(rollPoint,Area1) then CLICKCURSOR --now the pointer
else if inside(rollPoint,Area2) then CLICKCURSOR
else if inside(rollPoint,Area3) then CLICKCURSOR
else if inside(rollPoint,Area4) then CLICKCURSOR
else if inside(rollPoint,Area5) then CLICKCURSOR
else if inside(rollPoint,Area6) then CLICKCURSOR
else SPINCURSOR
end
---------------------------------------------------------------------
---------------------------------------------------------------------
--change to a clickable cursor for 3D discman
--initialize variable
on CLICKCURSOR
global gCursorState
--route 66 cursor
set Z = the number of cast "PointerCursor"
set ZZ = the number of cast "PointerCursor" + 1
set the cursor of sprite(20) to [Z,ZZ]
-- cursor 3
set gCursorState = true
end
---------------------------------------------------------------------
---------------------------------------------------------------------
--change to the spinning cursor for 3D discman
--initialize variable
on SPINCURSOR
global gCursorState
--open hand cursor
set Z = the number of cast "OpenHandCursor"
set ZZ = the number of cast "OpenHandCursor" + 1
set the cursor of sprite(20) to [Z,ZZ]
set gCursorState = false
end
---------------------------------------------------------------------
---------------------------------------------------------------------
--called from the mouseup on the 3D discman as the user selects
--a hotspot to call up info
on SHOWINFO
global WhatSide, gCursorState,gPopUpLoc
global Area1,Area2,Area3,Area4,Area5,Area6
set PopUp = the number of cast("PopUp" & "." & WhatSide)
if PopUp = the number of cast("PopUp.1") then
OPENANIM
exit
end if
updatestage
puppetsound "POP.AIFF"
updatestage
-- PlayQTSound "DryPop.MOV"
if inside(the clickLoc,Area1) then
puppetsprite(45), true
CHECKPOPUP PopUp
set the castNum of sprite(45) to cast PopUp
set the loc of sprite(45) to gPopUpLoc
set the visible of sprite(45) to true
updateStage
else if inside(the clickLoc,Area2) then
puppetsprite(45), true
set the castNum of sprite(45) to cast "PopUp.5B"
set the loc of sprite(45) to point(485,74)
set the visible of sprite(45) to true
updateStage
end if
end
---------------------------------------------------------------------
---------------------------------------------------------------------
--checks which popup then sets the stage point
on CHECKPOPUP PopUp
global gPopUpLoc
--pcmcia
if the name of cast PopUp contains "PopUp.2" then
set gPopUpLoc = point(416,49)
exit
end if
--control panel
if the name of cast PopUp contains "PopUp.3" then
set gPopUpLoc = point(342,337)
exit
end if
--battery
if the name of cast PopUp contains "PopUp.6" then
set gPopUpLoc = point(531,43)
exit
end if
--audio controls
if the name of cast PopUp contains "PopUp.5" then
set gPopUpLoc = point(547,166)
exit
end if
end
---------------------------------------------------------------------
---------------------------------------------------------------------
--initialize the popups
on SETPOPUP
set the castNum of sprite(45) to (the number of cast "PopUp.0")
set the loc of sprite(45) to point(619, 457)
set the visible of sprite(45) to false
end
---------------------------------------------------------------------
---------------------------------------------------------------------
--do the opening animation of the discman
on OPENANIM
--PLAY SOUND OF SITAR WHILE DISCMAN IS OPENING
PlayQTSound "SALLSIT2.MOV"
cursor 200 --no cursor
set the movierate of sprite(20) = 0
set the movietime of sprite(20) = 46 --inbetween to look like animating to position
updatestage
set the movietime of sprite(20) = 416
set the movierate of sprite(20) = 1
repeat while the movietime of sprite(20) < 464
updatestage
--wait for opening animation to finish
end repeat
cursor -1 -- regular cursor
repeat while the mousedown = false
nothing
end repeat
set the movietime of sprite(20) = 0
set the movierate of sprite(20) = 0
end