the cutting room mirror

Disney's Winnie the Pooh: Preschool (Windows)

This article has a talk page!This article has a talk page!
view on tcrf.net

A game for Preschoolers featuring Winnie the Pooh if that wasn't obvious.

Source Code#

To do:
There's more comments and unused code.

TXT files featuring the source code can be found on the disc.

Comments#

2tt/GuiObjectSkeleton.txt#

-- GUI component skeleton behavior

----
-- Use this class as a skeleton on which to add to, in order to create/develop GUI components.  It uses a
-- layer above director to call the "action" handlers defined in this script.  This layer exists to ensure that events
-- will arrive in the right order (or at least a consistent order) which Director doesn't seem to guarantee on it's own. 

-- Expected behavior of the layer (in brief):
----
-- Pretty much as you would expect it to work... that is, you get mouseEnterAction()/mouseLeaveAction() when
-- you enter/leave the sprite hotspot you attach this behavior to. You get mouseUpAction()/mouseDownAction()
-- when you click up/down while inside the sprite hotspot.  And you get a mouseUpOutsideAction() when you
-- mouseUp outside of the sprite hotspot you mouseDown'ed on.  

-- Expected behavior of the layer (more detail):
----
-- Both mouseDownAction() and mouseUpAction() will only be allowed to happen AFTER a mouseEnterAction(),
-- and  BEFORE a paired mouseLeaveAction().
-- A mouseUpAction() may not necessarily require a previous mouseDownAction() on the sprite (eg: you could
-- mouseDown on sprite A, drag over & mouseUp on sprite B and you would still get the mouseUpAction() for 
-- sprite B.  Note however that (as far as I can tell) you will always get the mouseUpOutsideAction() from sprite A
-- before you get the mouseUpAction() for sprite B).
-- In order to get a mouseUpOutsideAction(), you must have first recieved a mouseEnterAction(), a mouseDownAction() 
-- without a paired mouseUpAction(), and a mouseLeaveAction().  When the mouse button is released, it will result
-- in a mouseUpOutsideAction().

-- Do NOT...
----
-- Important !!!: Do not define any of the following handlers in this script (or anywhere for that matter!):
--  mouseEnter(), mouseLeave(), mouseDown(), mouseUp(), mouseUpOutside()
-- They are already defined in the ancestor which determines when these events are valid and should
-- cause an action to happen.  Instead, modify the mouseEnterAction, mouseDownAction, etc... handlers
-- listed below.

-- GUI Object properties and handlers (from the ancestor)
----
-- property pEnabled                -- TRUE, FALSE
-- property pDepressed           -- TRUE if a mouseDown() has been recieved without a mouseUp() or mouseUpOutside()
-- property pOver                        -- TRUE if a mouseEnter() has been recieved without a mouseLeave() or mouseUpOutside()
-- property pChannelNumber  -- the # of the channel that the button/clickable resides in
-- property pParentID                 -- the ID of the parent of this object

-- Enable(GuiObject) 
-- Disable(GuiObject)


-- Enabling/Disabling GUI Objects:
----
-- There are 3 ways to turn a GUI object off/on.  
-- (1) Enable() and Disable() will turn one specific GUI object on/off.
-- (2) GuiDisable() will turn all GUI objects off.  GuiEnable() will turn them all on again (except for objects that have
-- been disabled specifically (using Disable() see(1)).
-- (3) Enabling Autoplay will disable mouse action events created by the physical mouse,but will still process
-- the events sent by the autoplayer.
-- (Note: when a GUI object is in a disabled state, you position the mouse over it, and then you enable it, the object
-- will recieve a mouseEnterAction()).

----

2tt/movieHandlers.txt#

-- THIS SCRIPT CONTAINS ALL THE GLOBAL MOVIE HANDLERS THAT THE FRAMEWORK NEEDS ALONG
-- WITH ANY HANDLERS THAT MAY BE CALLED FROM ANYWHERE IN THIS SCENE.
  -- TELL POOH TO SAY GOODBYE
  -- SINCE WE HAVE A CRITICAL EVENT ON THIS STREAMED SOUND, GIVE IT A TIMEOUT OF THE
  -- LENGTH OF THE LONGEST VO TO PLAY.  THIS WAY EVEN IF THE SS EVENT IS LOST (MISSED),
  -- THE TIMEOUT WILL FORCE THE EVENT TO HAPPEN.  THE WORST THAT WILL HAPPEN IS IT
  -- WILL WAIT MAYBE 3 SECONDS AFTER THE SHORTEST VO FINISHES BEFORE TRANSITIONING.

2tt/RandomList.txt#

-- RandomList object script
-- On new, takes a linear list and shuffles it
-- GetNext() gets the next randomized element form the list
-- When end of list is reached, it's re-randomized, making sure there's no repeats
-- SetAt() forces the specified element at the specified position done by swapping
--
-- Don't pass it in a list of 1 element!  It'll gack!

2tt/SoundSequencer.txt#

-- Sound Sequencer (gSS)


-- Public Handlers
----
-- New()          -- called by framework
-- Terminate()    -- called by framework

-- Start()
-- Stop()
-- Finish()
-- GetPriority()
-- IsActive()
--@@@@@@@@@@@@@@@@@@@@@@
--@ 
--@  Public Handlers 
--@ 
--@@@@@@@@@@@@@@@@@@@@@@
----
-- New
-- Sets up a Sound Sequencer Object
-- Constraint: Currently there is meant to be only one instantiation of this 
-- object in the Project: gSS.  It gets new'd (how lewd) on a project framework
-- level in ProjectInitialize.  So it is available to be used by scene programmers
-- at any time. 
----
----
-- Terminate
-- Shuts down a Sound Sequencer Object
-- Constraint: Currently there is meant to be only one instantiation of this 
-- object in the Project: gSS.  Sol this Terminate() only gets called in 
-- ProjectTerminate()
----
----
-- Start
-- Starts a sound or a sequence of sounds playing.  Includes optional flags 
-- which allow you to give the sound a priority, and/or make it interruptable.
-- Includes optional finish event parameter.
-- Sounds may be specified directly by filename (in which case they will be streamed),
-- or by the sound object instance in place of the filename (which allows you to 
-- preload the sound object ahead of time).

-- Eg.1:  gss.Start(["beep"])
-- Stream the file "beep" from disk (defaults: #priority:1, #interruptable:FALSE, no finish event)

-- Eg.2   gss.Start(["beep", pHonkSound], [#priority:5])
-- Stream the file "beep" and then play the sound object pHonkSound (which can be preloaded ahead of time),
-- and attach to this sequence a priority of 5 (which means if you subsequently start a higher priority
-- sound with the gSS, it will interrupt the priority 5 sequence and send off it's finish event if it has one)
-- Note: If 2 Start()s are done with the same priority level at the same time, the second one will be ignored
-- (only higher priorities will interrupt a previously playing sequence).

-- Eg.2: gss.Start(["beep", pHonkSound, "beep"], [#interruptable:TRUE, priority:3], #FinishedNoise, objID, p1...)
-- Play the 3 specified sounds in a row, make the sequence interruptable, priority 3, and when
-- it either Finishes, or gets interupted (either by a higher priority sound, or whatever key the interrupt
-- trigger has been assigned to) run the FinishedNoise() handler (and specify objID and optional parameters
-- as you would with an Event object)

-- Constraint: soundList must contain valid filenames or sound objects, 
-- If you want to specity a finish Event, the second parameter must be a property list for flags (even if it is empty)
----
----
-- Timeout
-- Stop the sequence.  Does not send off a finish event.
-- Constraint: none
----
----
-- Stop
-- Stop the sequence.  Does not send off a finish event.
-- Constraint: none
----
----
-- GetPriority
-- Returns the priority of the sequence currently playing, returns #none if 
-- nothing is playing.
-- Constraint: none.
----
----
-- IsActive
-- Returns TRUE if Sequencer is currently playing a sound, FALSE otherwise.
-- Constraint: 
----
----
-- Finish
-- The Finish() handler is called automatically when the end of the sound sequence
-- is hit, or when the sound sequence is interrupted, or when a higher priority 
-- sound is told to play over a lower priority sound.  It can also be called from 
-- your scene code, but there is a WARNING below you must read if you intend to 
-- use it this way.

-- The actual code for the sound sequencer's Finish() handler is defined in the 
-- sequence ancestor (in the API), but because SoundSequencer inherits from the
-- sequence ancestor, it can be called as if it were defined here. 

-- Functionality: Finish() will Stop the seqence and send off it's finish event
-- (if there was one). 

-- WARNING: Finish() does not Clear() the finish Event, so theoretically you could
-- call Finish() twice in a  row and it would send off the same finish Event 2 times.
-- This is not the intended functionality (calling finish 2X in a row), and won't 
-- happen unless you try to do it explicitly.
-- The reason it doesn't get cleared is in case the code in one finish Event tells
-- the sound sequencer to Start() another sound with a new finish Event.  If you 
-- cleared, then when the new sound finished your event would be void rather than
-- having the second finish event handler called when the second sequence finished.

-- Constraint: Do not explicitly call Finish twice in a row (it won't assert,
-- but it will send off the event twice)  Don't take advantage of this!
----
--on Finish me
--end
--@@@@@@@@@@@@@@@@@@@@@@
--@ 
--@  Private Handlers 
--@ 
--@@@@@@@@@@@@@@@@@@@@@@
----
-- _IsValidSoundList
-- #PRIVATE
-- Ensure soundList passed to Start() is valid (contained in an assert)
-- Constraint: #PRIVATE routine (called by Start() )
----
----
-- DoStepAction
-- #PRIVATE
-- Constraint: #PRIVATE, called by SequenceAncestor
----
----
-- DoneStepAction
-- #PRIVATE
-- Constraint: #PRIVATE, called by SequenceAncestor.
----

Unused Code#

2tt/movieHandlers.txt#

--on setrelreg offsetPoint
--  repeat with x = 36 to 51
--    
--    set myPoint =  the regpoint of member x of castlib "2tt_art"
--    set the regpoint of member x of castlib "2tt_art" = myPoint + offsetPoint
--  end repeat  
--end


--on test
--  global pickedList
--  set pickedList = [99,99,99]  
--  set a = new(script "RandomList", [1,2,3,4,5,6], 3)
--  repeat with x = 1 to 1125
--    set b = GetNext(a)
--    if( b = getat(pickedList,1) or b = getAt(PickedList,2)  or b = getAt(pickedList,3) ) then
--      put "FOUND DUPLICATES"
--    end if
--    
--    put b
--    addAt(pickedList, 1, b)        
--  end repeat  
--end



on keydown 
  --  put "Key down"    
  --  put the key
  --  if (the key = TAB ) then
  --    put "tab pressed"
  --  end if
  
  --  set timeToScroll = FALSE
  --  
  --  
  --  case( the key ) of
  --    "l":
  --      set timeToScroll = TRUE    
  --      set direction = #left
  --    "r":
  --      set timeToScroll = TRUE    
  --      set direction = #right
  --      
  --  end case
  --  
  --  --  if( timeToScroll ) then
  --  --    PrepareOffscreenChestsForScroll( the p_oChestManager of gScene, direction )      
  --  --    PrepareOffscreenToys( the p_oToyManager of gScene, GetChestPictureList(the p_oChestManager of gScene, #offscreen), direction )     
  --  --    MakeOnscreenChestsScrollable( the p_oChestManager of gScene, direction )
  --  --    Scroll( the p_oBackgroundScroller of gScene, direction)    
  --  --  end if
  
end

Unused Graphics#

Calliope#

In 2PS.dcr is a calliope that does not appear.

Palettes#

Color palettes can be found in numerous .dcr files.