Browse Source

udpated behavior (fish feeding) tutorial base. removed the modules TropicalAssets and AppCore as those should be grabbed from the main repo.

Charlie Patterson 12 years ago
parent
commit
4df1bef
53 changed files with 140 additions and 816 deletions
  1. 2 2
      templates/fishTutorialBase/main.cs
  2. 0 4
      templates/fishTutorialBase/modules/AppCore/1/fonts/.gitignore
  3. 0 54
      templates/fishTutorialBase/modules/AppCore/1/main.cs
  4. 0 7
      templates/fishTutorialBase/modules/AppCore/1/module.taml
  5. 0 133
      templates/fishTutorialBase/modules/AppCore/1/scripts/canvas.cs
  6. 0 51
      templates/fishTutorialBase/modules/AppCore/1/scripts/constants.cs
  7. 0 68
      templates/fishTutorialBase/modules/AppCore/1/scripts/defaultPreferences.cs
  8. 0 64
      templates/fishTutorialBase/modules/AppCore/1/scripts/openal.cs
  9. 26 35
      templates/fishTutorialBase/modules/DeadlyReef/main.cs
  10. 10 0
      templates/fishTutorialBase/modules/DeadlyReef/module.taml
  11. 102 0
      templates/fishTutorialBase/modules/DeadlyReef/scripts/behaviors/movement/shooterControls.cs
  12. 0 5
      templates/fishTutorialBase/modules/TropicalAssets/1/assets/animations/angelfish1Anim.asset.taml
  13. 0 5
      templates/fishTutorialBase/modules/TropicalAssets/1/assets/animations/angelfish2Anim.asset.taml
  14. 0 5
      templates/fishTutorialBase/modules/TropicalAssets/1/assets/animations/butterflyfishAnim.asset.taml
  15. 0 5
      templates/fishTutorialBase/modules/TropicalAssets/1/assets/animations/eelAnim.asset.taml
  16. 0 5
      templates/fishTutorialBase/modules/TropicalAssets/1/assets/animations/pufferfishAnim.asset.taml
  17. 0 5
      templates/fishTutorialBase/modules/TropicalAssets/1/assets/animations/rockfishAnim.asset.taml
  18. 0 5
      templates/fishTutorialBase/modules/TropicalAssets/1/assets/animations/seahorseAnim.asset.taml
  19. 0 5
      templates/fishTutorialBase/modules/TropicalAssets/1/assets/animations/triggerfish1Anim.asset.taml
  20. 0 5
      templates/fishTutorialBase/modules/TropicalAssets/1/assets/animations/triggerfish2Anim.asset.taml
  21. 0 7
      templates/fishTutorialBase/modules/TropicalAssets/1/assets/images/angelfish1.asset.taml
  22. BIN
      templates/fishTutorialBase/modules/TropicalAssets/1/assets/images/angelfish1.png
  23. 0 7
      templates/fishTutorialBase/modules/TropicalAssets/1/assets/images/angelfish2.asset.taml
  24. BIN
      templates/fishTutorialBase/modules/TropicalAssets/1/assets/images/angelfish2.png
  25. 0 3
      templates/fishTutorialBase/modules/TropicalAssets/1/assets/images/background.asset.taml
  26. BIN
      templates/fishTutorialBase/modules/TropicalAssets/1/assets/images/background.jpg
  27. 0 3
      templates/fishTutorialBase/modules/TropicalAssets/1/assets/images/beam.asset.taml
  28. BIN
      templates/fishTutorialBase/modules/TropicalAssets/1/assets/images/beam.png
  29. 0 3
      templates/fishTutorialBase/modules/TropicalAssets/1/assets/images/bubble.asset.taml
  30. BIN
      templates/fishTutorialBase/modules/TropicalAssets/1/assets/images/bubble.png
  31. 0 7
      templates/fishTutorialBase/modules/TropicalAssets/1/assets/images/butterflyfish.asset.taml
  32. BIN
      templates/fishTutorialBase/modules/TropicalAssets/1/assets/images/butterflyfish.png
  33. 0 7
      templates/fishTutorialBase/modules/TropicalAssets/1/assets/images/eel.asset.taml
  34. BIN
      templates/fishTutorialBase/modules/TropicalAssets/1/assets/images/eel.png
  35. 0 9
      templates/fishTutorialBase/modules/TropicalAssets/1/assets/images/font.asset.taml
  36. BIN
      templates/fishTutorialBase/modules/TropicalAssets/1/assets/images/font.png
  37. 0 7
      templates/fishTutorialBase/modules/TropicalAssets/1/assets/images/pufferfish.asset.taml
  38. BIN
      templates/fishTutorialBase/modules/TropicalAssets/1/assets/images/pufferfish.png
  39. 0 7
      templates/fishTutorialBase/modules/TropicalAssets/1/assets/images/rockfish.asset.taml
  40. BIN
      templates/fishTutorialBase/modules/TropicalAssets/1/assets/images/rockfish.png
  41. 0 3
      templates/fishTutorialBase/modules/TropicalAssets/1/assets/images/rocksfar.asset.taml
  42. BIN
      templates/fishTutorialBase/modules/TropicalAssets/1/assets/images/rocksfar.png
  43. 0 3
      templates/fishTutorialBase/modules/TropicalAssets/1/assets/images/rocksnear.asset.taml
  44. BIN
      templates/fishTutorialBase/modules/TropicalAssets/1/assets/images/rocksnear.png
  45. 0 7
      templates/fishTutorialBase/modules/TropicalAssets/1/assets/images/seahorse.asset.taml
  46. BIN
      templates/fishTutorialBase/modules/TropicalAssets/1/assets/images/seahorse.png
  47. 0 7
      templates/fishTutorialBase/modules/TropicalAssets/1/assets/images/triggerfish1.asset.taml
  48. BIN
      templates/fishTutorialBase/modules/TropicalAssets/1/assets/images/triggerfish1.png
  49. 0 3
      templates/fishTutorialBase/modules/TropicalAssets/1/assets/images/wave.asset.taml
  50. BIN
      templates/fishTutorialBase/modules/TropicalAssets/1/assets/images/wave.png
  51. 0 33
      templates/fishTutorialBase/modules/TropicalAssets/1/assets/particles/caustics.asset.taml
  52. 0 13
      templates/fishTutorialBase/modules/TropicalAssets/1/module.taml
  53. 0 224
      templates/fishTutorialBase/modules/TropicalAssets/1/scripts/aquarium.cs

+ 2 - 2
templates/fishTutorialBase/main.cs

@@ -24,12 +24,12 @@ setLogMode(6);
 $Scripts::ignoreDSOs = true;
 
 ModuleDatabase.scanModules( "modules" );
-ModuleDatabase.LoadExplicit( "TropicalAssets" );
+ModuleDatabase.LoadGroup( "game" );
 
 //-----------------------------------------------------------------------------
 
 function onExit()
 {
-    ModuleDatabase.unloadExplicit( "TropicalAssets" );
+    ModuleDatabase.unloadGroup( "game" );
 }
 

+ 0 - 4
templates/fishTutorialBase/modules/AppCore/1/fonts/.gitignore

@@ -1,4 +0,0 @@
-# Ignore everything in this directory
-*
-# Except this file
-!.gitignore

+ 0 - 54
templates/fishTutorialBase/modules/AppCore/1/main.cs

@@ -1,54 +0,0 @@
-//-----------------------------------------------------------------------------
-// Copyright (c) 2013 GarageGames, LLC
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to
-// deal in the Software without restriction, including without limitation the
-// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-// sell copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-// IN THE SOFTWARE.
-//-----------------------------------------------------------------------------
-
-function AppCore::create( %this )
-{
-    // Load system scripts
-    exec("./scripts/constants.cs");
-    exec("./scripts/defaultPreferences.cs");
-    exec("./scripts/canvas.cs");
-    exec("./scripts/openal.cs");
-    
-    // Initialize the canvas
-    initializeCanvas("Torque 2D");
-    
-    // Set the canvas color
-    Canvas.BackgroundColor = "CornflowerBlue";
-    Canvas.UseBackgroundColor = true;
-    
-    // Initialize audio
-    initializeOpenAL();
-    
-    // This is one method of starting your game.
-    // Edit your "main" module(s) to have an attribute of Group="gameBase".
-    // Then uncomment the following line.
-    // Now the "AppCore" will go first and then start your game.
-    // ModuleDatabase.loadGroup("gameBase");
-}
-
-//-----------------------------------------------------------------------------
-
-function AppCore::destroy( %this )
-{
-
-}
-

+ 0 - 7
templates/fishTutorialBase/modules/AppCore/1/module.taml

@@ -1,7 +0,0 @@
-<ModuleDefinition
-	ModuleId="AppCore"
-	VersionId="1"
-	Description="Barebones startup module"
-	ScriptFile="main.cs"
-	CreateFunction="create"
-	DestroyFunction="destroy" />

+ 0 - 133
templates/fishTutorialBase/modules/AppCore/1/scripts/canvas.cs

@@ -1,133 +0,0 @@
-//-----------------------------------------------------------------------------
-// Copyright (c) 2013 GarageGames, LLC
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to
-// deal in the Software without restriction, including without limitation the
-// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-// sell copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-// IN THE SOFTWARE.
-//-----------------------------------------------------------------------------
-
-//------------------------------------------------------------------------------
-// initializeCanvas
-// Constructs and initializes the default canvas window.
-//------------------------------------------------------------------------------
-$canvasCreated = false;
-function initializeCanvas(%windowName)
-{
-    // Don't duplicate the canvas.
-    if($canvasCreated)
-    {
-        error("Cannot instantiate more than one canvas!");
-        return;
-    }
-
-    videoSetGammaCorrection($pref::OpenGL::gammaCorrection);
-
-    if ( !createCanvas(%windowName) )
-    {
-        error("Canvas creation failed. Shutting down.");
-        quit();
-    }
-
-    $pref::iOS::ScreenDepth = 32;
-
-    if ( $pref::iOS::DeviceType !$= "" )
-    {
-        %resolution = iOSResolutionFromSetting($pref::iOS::DeviceType, $pref::iOS::ScreenOrientation);
-    }
-    else
-    {
-        if ( $pref::Video::windowedRes !$= "" )
-            %resolution = $pref::Video::windowedRes;
-        else
-            %resolution = $pref::Video::defaultResolution;
-    }
-
-    if ($platform $= "windows" || $platform $= "macos")
-    {
-        setScreenMode( %resolution._0, %resolution._1, %resolution._2, $pref::Video::fullScreen );
-    }
-    else
-    {
-        setScreenMode( %resolution._0, %resolution._1, %resolution._2, false );
-    }
-
-    $canvasCreated = true;
-}
-
-//------------------------------------------------------------------------------
-// resetCanvas
-// Forces the canvas to redraw itself.
-//------------------------------------------------------------------------------
-function resetCanvas()
-{
-    if (isObject(Canvas))
-        Canvas.repaint();
-}
-
-//------------------------------------------------------------------------------
-// iOSResolutionFromSetting
-// Helper function that grabs resolution strings based on device type
-//------------------------------------------------------------------------------
-function iOSResolutionFromSetting( %deviceType, %deviceScreenOrientation )
-{
-    // A helper function to get a string based resolution from the settings given.
-    %x = 0;
-    %y = 0;
-    
-    %scaleFactor = $pref::iOS::RetinaEnabled ? 2 : 1;
-
-    switch(%deviceType)
-    {
-        case $iOS::constant::iPhone:
-            if(%deviceScreenOrientation == $iOS::constant::Landscape)
-            {
-                %x =  $iOS::constant::iPhoneWidth * %scaleFactor;
-                %y =  $iOS::constant::iPhoneHeight * %scaleFactor;
-            }
-            else
-            {
-                %x =  $iOS::constant::iPhoneHeight * %scaleFactor;
-                %y =  $iOS::constant::iPhoneWidth * %scaleFactor;
-            }
-
-        case $iOS::constant::iPad:
-            if(%deviceScreenOrientation == $iOS::constant::Landscape)
-            {
-                %x =  $iOS::constant::iPadWidth * %scaleFactor;
-                %y =  $iOS::constant::iPadHeight * %scaleFactor;
-            }
-            else
-            {
-                %x =  $iOS::constant::iPadHeight * %scaleFactor;
-                %y =  $iOS::constant::iPadWidth * %scaleFactor;
-            }
-
-        case $iOS::constant::iPhone5:
-            if(%deviceScreenOrientation == $iOS::constant::Landscape)
-            {
-                %x =  $iOS::constant::iPhone5Width;
-                %y =  $iOS::constant::iPhone5Height;
-            }
-            else
-            {
-                %x =  $iOS::constant::iPhone5Height;
-                %y =  $iOS::constant::iPhone5Width;
-            }
-    }
-   
-    return %x @ " " @ %y;
-}

+ 0 - 51
templates/fishTutorialBase/modules/AppCore/1/scripts/constants.cs

@@ -1,51 +0,0 @@
-//-----------------------------------------------------------------------------
-// Copyright (c) 2013 GarageGames, LLC
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to
-// deal in the Software without restriction, including without limitation the
-// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-// sell copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-// IN THE SOFTWARE.
-//-----------------------------------------------------------------------------
-
-$iOS::constant::iPhone = 0;
-$iOS::constant::iPad = 1;
-$iOS::constant::iPhone5 = 2;
-
-$iOS::constant::Landscape = 0;
-$iOS::constant::Portrait = 1;
-$iOS::constant::ResolutionFull = 0;
-$iOS::constant::ResolutionSmall = 1;
-
-$iOS::constant::iPhoneWidth = 480;
-$iOS::constant::iPhoneHeight = 320;
-
-$iOS::constant::iPhone4Width = 960;
-$iOS::constant::iPhone4Height = 640;
-
-$iOS::constant::iPadWidth = 1024;
-$iOS::constant::iPadHeight = 768;
-
-$iOS::constant::NewiPadWidth = 2048;
-$iOS::constant::NewiPadHeight = 1536;
-
-$iOS::constant::iPhone5Width = 1136;
-$iOS::constant::iPhone5Height = 640;
-
-$iOS::constant::OrientationUnknown = 0;
-$iOS::constant::OrientationLandscapeLeft = 1;
-$iOS::constant::OrientationLandscapeRight = 2;
-$iOS::constant::OrientationPortrait = 3;
-$iOS::constant::OrientationPortraitUpsideDown = 4;

+ 0 - 68
templates/fishTutorialBase/modules/AppCore/1/scripts/defaultPreferences.cs

@@ -1,68 +0,0 @@
-//-----------------------------------------------------------------------------
-// Copyright (c) 2013 GarageGames, LLC
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to
-// deal in the Software without restriction, including without limitation the
-// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-// sell copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-// IN THE SOFTWARE.
-//-----------------------------------------------------------------------------
-
-/// Game
-$Game::CompanyName              = "GarageGames LLC";
-$Game::ProductName              = "Torque 2D";
-
-/// iOS
-$pref::iOS::ScreenOrientation   = $iOS::constant::Landscape;
-$pref::iOS::ScreenDepth		    = 32;
-$pref::iOS::UseGameKit          = 0;
-$pref::iOS::UseMusic            = 0;
-$pref::iOS::UseMoviePlayer      = 0;
-$pref::iOS::UseAutoRotate       = 1;
-$pref::iOS::EnableOrientationRotation = 1;
-$pref::iOS::EnableOtherOrientationRotation = 1;   
-$pref::iOS::StatusBarType       = 0;
-
-/// Audio
-$pref::Audio::driver = "OpenAL";
-$pref::Audio::forceMaxDistanceUpdate = 0;
-$pref::Audio::environmentEnabled = 0;
-$pref::Audio::masterVolume   = 1.0;
-$pref::Audio::channelVolume1 = 1.0;
-$pref::Audio::channelVolume2 = 1.0;
-$pref::Audio::channelVolume3 = 1.0;
-$pref::Audio::sfxVolume = 1.0;
-$pref::Audio::musicVolume = 1.0;
-
-/// T2D
-$pref::T2D::ParticlePlayerEmissionRateScale = 1.0;
-$pref::T2D::ParticlePlayerSizeScale = 1.0;
-$pref::T2D::ParticlePlayerForceScale = 1.0;
-$pref::T2D::warnFileDeprecated = 1;
-$pref::T2D::warnSceneOccupancy = 1;
-$pref::T2D::imageAssetGlobalFilterMode = Bilinear;
-
-/// Video
-$pref::Video::appliedPref = 0;
-$pref::Video::disableVerticalSync = 1;
-$pref::Video::displayDevice = "OpenGL";
-$pref::Video::preferOpenGL = 1;
-$pref::Video::fullScreen = 0;
-$pref::Video::defaultResolution = "1024 768";
-$pref::Video::windowedRes = "1024 768 32";
-$pref::OpenGL::gammaCorrection = 0.5;
-
-/// Fonts.
-$Gui::fontCacheDirectory = expandPath( "^AppCore/fonts" );

+ 0 - 64
templates/fishTutorialBase/modules/AppCore/1/scripts/openal.cs

@@ -1,64 +0,0 @@
-//-----------------------------------------------------------------------------
-// Copyright (c) 2013 GarageGames, LLC
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to
-// deal in the Software without restriction, including without limitation the
-// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-// sell copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-// IN THE SOFTWARE.
-//-----------------------------------------------------------------------------
-
-//------------------------------------------------------------------------------
-// Audio channel descriptions.
-//------------------------------------------------------------------------------
-$musicAudioType = 1;
-$effectsAudioType = 2;
-
-//------------------------------------------------------------------------------
-// initializeOpenAL
-// Starts up the OpenAL driver.
-//------------------------------------------------------------------------------
-function initializeOpenAL()
-{
-    // Just in case it is already started.
-    shutdownOpenAL();
-
-    echo("OpenAL Driver Init");
-
-    if (!OpenALInitDriver())
-    {
-        echo("OpenALInitDriver() failed");
-        $Audio::initFailed = true;
-    }
-    else
-    {
-        // Set the master volume.
-        alxListenerf(AL_GAIN_LINEAR, $pref::Audio::masterVolume);
-
-        // Set the channel volumes.
-        for (%channel = 1; %channel <= 3; %channel++)
-            alxSetChannelVolume(%channel, $pref::Audio::channelVolume[%channel]);
-
-        echo("OpenAL Driver Init Success");
-    }
-}
-
-//------------------------------------------------------------------------------
-// shutdownOpenAL
-//------------------------------------------------------------------------------
-function shutdownOpenAL()
-{
-    OpenALShutdownDriver();
-}

+ 26 - 35
templates/fishTutorialBase/modules/TropicalAssets/1/main.cs → templates/fishTutorialBase/modules/DeadlyReef/main.cs

@@ -20,7 +20,7 @@
 // IN THE SOFTWARE.
 //-----------------------------------------------------------------------------
 
-function TropicalAssets::create( %this )
+function DeadlyReef::create( %this )
 {
     // We need a main "Scene" we can use as our game world.  The place where sceneObjects play.
     // Give it a global name "mainScene" since we may want to access it directly in our scripts.
@@ -44,48 +44,39 @@ function TropicalAssets::create( %this )
     // load some scripts and variables
     // exec("./scripts/someScript.cs");
 
-
-    exec("./scripts/aquarium.cs");
-
-    buildAquarium();
-    createAquariumEffects();
-    TropicalAssets.spawnFish(10);
+    buildAquarium(mainScene);
+    createAquariumEffects(mainScene);
+    DeadlyReef.spawnPlayerFish();
 }
 
 //-----------------------------------------------------------------------------
 
-function TropicalAssets::destroy( %this )
+function DeadlyReef::destroy( %this )
 {
 }
 
 //-----------------------------------------------------------------------------
 
-function TropicalAssets::spawnFish(%this, %amount)
+function DeadlyReef::spawnPlayerFish(%this)
 {
-    for (%i = 0; %i < %amount; %i++) {
-        %position = getRandom(-55, 55) SPC getRandom(-20, 20);
-        %index = getRandom(0, 5);
-        %anim = getUnit(getFishAnimationList(), %index, ",");
-        
-        %fishInfo = getFishSize(%anim);
-        
-        %fish = new Sprite()
-        {
-            Animation = %anim;
-            class = "FishClass";
-            position = %position;
-            size = %fishInfo;
-            SceneLayer = "2";
-            SceneGroup = "14";
-            minSpeed = "5";
-            maxSpeed = "15";
-            CollisionCallback = true;
-        };
-        
-        %fish.createPolygonBoxCollisionShape( 15, 15);
-        %fish.setCollisionGroups( 15 );
-        mainScene.add( %fish );        
-    }
-}
+    %anim = "TropicalAssets:seahorseAnim";    
+    %size = getFishSize(%anim);
 
-//-----------------------------------------------------------------------------
+    %fish = new Sprite()
+    {
+        Animation = %anim;
+        // class = "FishClass";
+        position = "0 0";
+        size = %size;
+        SceneLayer = "15";
+        SceneGroup = "14";
+        minSpeed = "5";
+        maxSpeed = "15";
+        CollisionCallback = true;
+    };
+
+    %fish.createPolygonBoxCollisionShape(%size);
+    %fish.setCollisionGroups( "15" );
+    %fish.FixedAngle = true;
+    mainScene.add( %fish ); 
+}

+ 10 - 0
templates/fishTutorialBase/modules/DeadlyReef/module.taml

@@ -0,0 +1,10 @@
+<ModuleDefinition
+	ModuleId="DeadlyReef"
+	VersionId="1"
+	Description="Feeding fish in a post-apocalyptic world (wouldn't that be cool?!)"
+	Dependencies="TropicalAssets,AppCore"
+	Group="game"
+	ScriptFile="main.cs"
+	CreateFunction="create"
+	DestroyFunction="destroy">
+</ModuleDefinition>

+ 102 - 0
templates/fishTutorialBase/modules/DeadlyReef/scripts/behaviors/movement/shooterControls.cs

@@ -0,0 +1,102 @@
+//-----------------------------------------------------------------------------
+// Copyright (c) 2013 GarageGames, LLC
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+
+if (!isObject(ShooterControlsBehavior))
+{
+    %template = new BehaviorTemplate(ShooterControlsBehavior);
+
+    %template.friendlyName = "Shooter Controls";
+    %template.behaviorType = "Input";
+    %template.description  = "Shooter style movement control";
+
+    %template.addBehaviorField(upKey, "Key to bind to upward movement", keybind, "keyboard up");
+    %template.addBehaviorField(downKey, "Key to bind to downward movement", keybind, "keyboard down");
+    %template.addBehaviorField(leftKey, "Key to bind to left movement", keybind, "keyboard left");
+    %template.addBehaviorField(rightKey, "Key to bind to right movement", keybind, "keyboard right");
+
+    %template.addBehaviorField(verticalSpeed, "Speed when moving vertically", float, 20.0);
+    %template.addBehaviorField(horizontalSpeed, "Speed when moving horizontally", float, 20.0);
+}
+
+function ShooterControlsBehavior::onBehaviorAdd(%this)
+{
+    if (!isObject(GlobalActionMap))
+       return;
+
+    GlobalActionMap.bindObj(getWord(%this.upKey, 0), getWord(%this.upKey, 1), "moveUp", %this);
+    GlobalActionMap.bindObj(getWord(%this.downKey, 0), getWord(%this.downKey, 1), "moveDown", %this);
+    GlobalActionMap.bindObj(getWord(%this.leftKey, 0), getWord(%this.leftKey, 1), "moveLeft", %this);
+    GlobalActionMap.bindObj(getWord(%this.rightKey, 0), getWord(%this.rightKey, 1), "moveRight", %this);
+
+    %this.up = 0;
+    %this.down = 0;
+    %this.left = 0;
+    %this.right = 0;
+}
+
+function ShooterControlsBehavior::onBehaviorRemove(%this)
+{
+    if (!isObject(GlobalActionMap))
+       return;
+
+    %this.owner.disableUpdateCallback();
+
+    GlobalActionMap.unbindObj(getWord(%this.upKey, 0), getWord(%this.upKey, 1), %this);
+    GlobalActionMap.unbindObj(getWord(%this.downKey, 0), getWord(%this.downKey, 1), %this);
+    GlobalActionMap.unbindObj(getWord(%this.leftKey, 0), getWord(%this.leftKey, 1), %this);
+    GlobalActionMap.unbindObj(getWord(%this.rightKey, 0), getWord(%this.rightKey, 1), %this);
+
+    %this.up = 0;
+    %this.down = 0;
+    %this.left = 0;
+    %this.right = 0;
+}
+
+function ShooterControlsBehavior::updateMovement(%this)
+{
+    %this.owner.setLinearVelocityX((%this.right - %this.left) * %this.horizontalSpeed);
+    %this.owner.setLinearVelocityY((%this.up - %this.down) * %this.verticalSpeed);
+}
+
+function ShooterControlsBehavior::moveUp(%this, %val)
+{
+    %this.up = %val;
+    %this.updateMovement();
+}
+
+function ShooterControlsBehavior::moveDown(%this, %val)
+{
+    %this.down = %val;
+    %this.updateMovement();
+}
+
+function ShooterControlsBehavior::moveLeft(%this, %val)
+{
+    %this.left = %val;
+    %this.updateMovement();
+}
+
+function ShooterControlsBehavior::moveRight(%this, %val)
+{
+    %this.right = %val;
+    %this.updateMovement();
+}

+ 0 - 5
templates/fishTutorialBase/modules/TropicalAssets/1/assets/animations/angelfish1Anim.asset.taml

@@ -1,5 +0,0 @@
-<AnimationAsset
-    AssetName="angelfish1Anim"
-    Image="@asset=TropicalAssets:angelFishImage"
-    AnimationFrames="0 1 2 3 3 2 1 0"
-    AnimationTime="0.4" />

+ 0 - 5
templates/fishTutorialBase/modules/TropicalAssets/1/assets/animations/angelfish2Anim.asset.taml

@@ -1,5 +0,0 @@
-<AnimationAsset
-    AssetName="angelfish2Anim"
-    Image="@asset=TropicalAssets:angelfish2"
-    AnimationFrames="0 1 2 3 3 2 1 0"
-    AnimationTime="0.4" />

+ 0 - 5
templates/fishTutorialBase/modules/TropicalAssets/1/assets/animations/butterflyfishAnim.asset.taml

@@ -1,5 +0,0 @@
-<AnimationAsset
-    AssetName="butterflyfishAnim"
-    Image="@asset=TropicalAssets:butterflyfish"
-    AnimationFrames="0 1 2 3 3 2 1 0"
-    AnimationTime="0.4" />

+ 0 - 5
templates/fishTutorialBase/modules/TropicalAssets/1/assets/animations/eelAnim.asset.taml

@@ -1,5 +0,0 @@
-<AnimationAsset
-    AssetName="eelAnim"
-    Image="@asset=TropicalAssets:eel"
-    AnimationFrames="0 1 2 3 3 2 1 0"
-    AnimationTime="0.3" />

+ 0 - 5
templates/fishTutorialBase/modules/TropicalAssets/1/assets/animations/pufferfishAnim.asset.taml

@@ -1,5 +0,0 @@
-<AnimationAsset
-    AssetName="pufferfishAnim"
-    Image="@asset=TropicalAssets:pufferfish"
-    AnimationFrames="0 1 2 3 3 2 1 0"
-    AnimationTime="0.4" />

+ 0 - 5
templates/fishTutorialBase/modules/TropicalAssets/1/assets/animations/rockfishAnim.asset.taml

@@ -1,5 +0,0 @@
-<AnimationAsset
-    AssetName="rockfishAnim"
-    Image="@asset=TropicalAssets:rockfish"
-    AnimationFrames="0 1 2 3 3 2 1 0"
-    AnimationTime="0.4" />

+ 0 - 5
templates/fishTutorialBase/modules/TropicalAssets/1/assets/animations/seahorseAnim.asset.taml

@@ -1,5 +0,0 @@
-<AnimationAsset
-    AssetName="seahorseAnim"
-    Image="@asset=TropicalAssets:seahorse"
-    AnimationFrames="0 1 2 3 3 2 1 0"
-    AnimationTime="0.8" />

+ 0 - 5
templates/fishTutorialBase/modules/TropicalAssets/1/assets/animations/triggerfish1Anim.asset.taml

@@ -1,5 +0,0 @@
-<AnimationAsset
-    AssetName="triggerfish1Anim"
-    Image="@asset=TropicalAssets:triggerfish1"
-    AnimationFrames="0 1 2 3 3 2 1 0"
-    AnimationTime="0.4" />

+ 0 - 5
templates/fishTutorialBase/modules/TropicalAssets/1/assets/animations/triggerfish2Anim.asset.taml

@@ -1,5 +0,0 @@
-<AnimationAsset
-    AssetName="triggerfish2Anim"
-    Image="@asset=TropicalAssets:triggerfish2"
-    AnimationFrames="0 1 2 3 3 2 1 0"
-    AnimationTime="0.4" />

+ 0 - 7
templates/fishTutorialBase/modules/TropicalAssets/1/assets/images/angelfish1.asset.taml

@@ -1,7 +0,0 @@
-<ImageAsset
-    AssetName="angelFishImage"
-    ImageFile="angelfish1.png"
-    CellCountX="2"
-    CellCountY="2"
-    CellWidth="256"
-    CellHeight="256" />

BIN
templates/fishTutorialBase/modules/TropicalAssets/1/assets/images/angelfish1.png


+ 0 - 7
templates/fishTutorialBase/modules/TropicalAssets/1/assets/images/angelfish2.asset.taml

@@ -1,7 +0,0 @@
-<ImageAsset
-    AssetName="angelfish2"
-    ImageFile="angelfish2.png"
-    CellCountX="2"
-    CellCountY="2"
-    CellWidth="256"
-    CellHeight="256" />

BIN
templates/fishTutorialBase/modules/TropicalAssets/1/assets/images/angelfish2.png


+ 0 - 3
templates/fishTutorialBase/modules/TropicalAssets/1/assets/images/background.asset.taml

@@ -1,3 +0,0 @@
-<ImageAsset
-    AssetName="background"
-    ImageFile="background.jpg" />

BIN
templates/fishTutorialBase/modules/TropicalAssets/1/assets/images/background.jpg


+ 0 - 3
templates/fishTutorialBase/modules/TropicalAssets/1/assets/images/beam.asset.taml

@@ -1,3 +0,0 @@
-<ImageAsset
-    AssetName="beam"
-    ImageFile="beam.png" />

BIN
templates/fishTutorialBase/modules/TropicalAssets/1/assets/images/beam.png


+ 0 - 3
templates/fishTutorialBase/modules/TropicalAssets/1/assets/images/bubble.asset.taml

@@ -1,3 +0,0 @@
-<ImageAsset
-    AssetName="bubble"
-    ImageFile="bubble.png" />

BIN
templates/fishTutorialBase/modules/TropicalAssets/1/assets/images/bubble.png


+ 0 - 7
templates/fishTutorialBase/modules/TropicalAssets/1/assets/images/butterflyfish.asset.taml

@@ -1,7 +0,0 @@
-<ImageAsset
-    AssetName="butterflyfish"
-    ImageFile="butterflyfish.png"
-    CellCountX="2"
-    CellCountY="2"
-    CellWidth="256"
-    CellHeight="256" />

BIN
templates/fishTutorialBase/modules/TropicalAssets/1/assets/images/butterflyfish.png


+ 0 - 7
templates/fishTutorialBase/modules/TropicalAssets/1/assets/images/eel.asset.taml

@@ -1,7 +0,0 @@
-<ImageAsset
-    AssetName="eel"
-    ImageFile="eel.png"
-    CellCountX="1"
-    CellCountY="4"
-    CellWidth="256"
-    CellHeight="64" />

BIN
templates/fishTutorialBase/modules/TropicalAssets/1/assets/images/eel.png


+ 0 - 9
templates/fishTutorialBase/modules/TropicalAssets/1/assets/images/font.asset.taml

@@ -1,9 +0,0 @@
-<ImageAsset
-    AssetName="font"
-    ImageFile="font.png"
-	CellOffsetY="1"
-	CellStrideY="16"
-    CellCountX="16"
-    CellCountY="6"
-    CellWidth="16"
-    CellHeight="14" />

BIN
templates/fishTutorialBase/modules/TropicalAssets/1/assets/images/font.png


+ 0 - 7
templates/fishTutorialBase/modules/TropicalAssets/1/assets/images/pufferfish.asset.taml

@@ -1,7 +0,0 @@
-<ImageAsset
-    AssetName="pufferfish"
-    ImageFile="pufferfish.png"
-    CellCountX="2"
-    CellCountY="2"
-    CellWidth="256"
-    CellHeight="256" />

BIN
templates/fishTutorialBase/modules/TropicalAssets/1/assets/images/pufferfish.png


+ 0 - 7
templates/fishTutorialBase/modules/TropicalAssets/1/assets/images/rockfish.asset.taml

@@ -1,7 +0,0 @@
-<ImageAsset
-    AssetName="rockfish"
-    ImageFile="rockfish.png"
-    CellCountX="2"
-    CellCountY="2"
-    CellWidth="256"
-    CellHeight="128" />

BIN
templates/fishTutorialBase/modules/TropicalAssets/1/assets/images/rockfish.png


+ 0 - 3
templates/fishTutorialBase/modules/TropicalAssets/1/assets/images/rocksfar.asset.taml

@@ -1,3 +0,0 @@
-<ImageAsset
-    AssetName="rocksfar"
-    ImageFile="rocksfar.png" />

BIN
templates/fishTutorialBase/modules/TropicalAssets/1/assets/images/rocksfar.png


+ 0 - 3
templates/fishTutorialBase/modules/TropicalAssets/1/assets/images/rocksnear.asset.taml

@@ -1,3 +0,0 @@
-<ImageAsset
-    AssetName="rocksnear"
-    ImageFile="rocksnear.png" />

BIN
templates/fishTutorialBase/modules/TropicalAssets/1/assets/images/rocksnear.png


+ 0 - 7
templates/fishTutorialBase/modules/TropicalAssets/1/assets/images/seahorse.asset.taml

@@ -1,7 +0,0 @@
-<ImageAsset
-    AssetName="seahorse"
-    ImageFile="seahorse.png"
-    CellCountX="4"
-    CellCountY="1"
-    CellWidth="128"
-    CellHeight="256" />

BIN
templates/fishTutorialBase/modules/TropicalAssets/1/assets/images/seahorse.png


+ 0 - 7
templates/fishTutorialBase/modules/TropicalAssets/1/assets/images/triggerfish1.asset.taml

@@ -1,7 +0,0 @@
-<ImageAsset
-    AssetName="triggerfish1"
-    ImageFile="triggerfish1.png"
-    CellCountX="2"
-    CellCountY="2"
-    CellWidth="256"
-    CellHeight="256" />

BIN
templates/fishTutorialBase/modules/TropicalAssets/1/assets/images/triggerfish1.png


+ 0 - 3
templates/fishTutorialBase/modules/TropicalAssets/1/assets/images/wave.asset.taml

@@ -1,3 +0,0 @@
-<ImageAsset
-    AssetName="wave"
-    ImageFile="wave.png" />

BIN
templates/fishTutorialBase/modules/TropicalAssets/1/assets/images/wave.png


+ 0 - 33
templates/fishTutorialBase/modules/TropicalAssets/1/assets/particles/caustics.asset.taml

@@ -1,33 +0,0 @@
-<ParticleAsset
-    AssetName="Caustics">
-    <ParticleAssetEmitter
-        EmitterName="caustics"
-		EmitterType="line"
-		EmitterSize="100 1"
-		FixedAspect="false"
-        OldestInFront="1"
-        Image="@asset=AquariumToy:Beam">
-        <ParticleAssetEmitter.Fields>
-            <Quantity
-                Keys="0 1" />
-            <QuantityVariation
-                Keys="0 1" />				
-            <Lifetime
-                Keys="0 4" />				
-            <LifetimeVariation
-                Keys="0 2" />
-            <Speed
-                Keys="0 0" />
-            <RandomMotion
-                Keys="0 45" />				
-            <SizeX
-                Keys="0 50" />				
-            <SizeXVariation
-                Keys="0 40" />
-            <SizeY
-                Keys="0 75" />								
-            <AlphaChannel
-                Keys="0 0 0.5 0.3 0.8 0.3 1 0" />
-        </ParticleAssetEmitter.Fields>
-    </ParticleAssetEmitter>
-</ParticleAsset>

+ 0 - 13
templates/fishTutorialBase/modules/TropicalAssets/1/module.taml

@@ -1,13 +0,0 @@
-<ModuleDefinition
-	ModuleId="TropicalAssets"
-	VersionId="1"
-	Description="Tropical Fish Assets."
-	Dependencies="AppCore=1"
-	ScriptFile="main.cs"
-	CreateFunction="create"
-	DestroyFunction="destroy">
-		<DeclaredAssets
-			Path="assets"
-			Extension="asset.taml"
-			Recurse="true"/>
-</ModuleDefinition>

+ 0 - 224
templates/fishTutorialBase/modules/TropicalAssets/1/scripts/aquarium.cs

@@ -1,224 +0,0 @@
-//-----------------------------------------------------------------------------
-// Copyright (c) 2013 GarageGames, LLC
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to
-// deal in the Software without restriction, including without limitation the
-// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-// sell copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-// IN THE SOFTWARE.
-//-----------------------------------------------------------------------------
-
-function getFishAnimationList()
-{
-   %list = "TropicalAssets:angelfish1Anim" @ "," @ "TropicalAssets:angelfish2Anim" @ "," @ "TropicalAssets:butterflyfishAnim";
-   %list = %list @ "," @ "TropicalAssets:pufferfishAnim" @ "," @ "TropicalAssets:rockfishAnim" @ "," @ "TropicalAssets:seahorseAnim";
-   %list = %list @ "," @ "TropicalAssets:triggerfish1Anim" @ "," @ "TropicalAssets:eelAnim";
-}
-
-//-----------------------------------------------------------------------------
-
-function getFishSize(%anim)
-{
-    switch$(%anim)
-    {
-        case "TropicalAssets:angelfish1Anim":
-        %fishInfo = "15 15";
-
-        case "TropicalAssets:angelfish2Anim":
-        %fishInfo = "15 15";
-        
-        case "TropicalAssets:butterflyfishAnim":
-        %fishInfo = "15 15";
-        
-        case "TropicalAssets:pufferfishAnim":
-        %fishInfo = "15 15";
-        
-        case "TropicalAssets:rockfishAnim":
-        %fishInfo = "15 7.5";
-        
-        case "TropicalAssets:seahorseAnim":
-        %fishInfo = "7.5 15";
-        
-        case "TropicalAssets:triggerfish1Anim":
-        %fishInfo = "15 15";
-
-        case "TropicalAssets:eelAnim":
-        %fishInfo = "7.5 3.75";
-    }
-
-    return %fishInfo;
-}
-
-//-----------------------------------------------------------------------------
-
-function buildAquarium()
-{
-    // Background
-    %background = new Sprite();
-    %background.setBodyType( "static" );
-    %background.setImage( "TropicalAssets:background" );
-    %background.setSize( 100, 75 );
-    %background.setCollisionSuppress();
-    %background.setAwake( false );
-    %background.setActive( false );
-    %background.setSceneLayer(5);
-    mainScene.add( %background );
-    
-    // Far rocks
-    %farRocks = new Sprite();
-    %farRocks.setBodyType( "static" );
-    %farRocks.setPosition( 0, -7.5 );
-    %farRocks.setImage( "TropicalAssets:rocksfar" );
-    %farRocks.setSize( 100, 75 );
-    %farRocks.setCollisionSuppress();
-    %farRocks.setAwake( false );
-    %farRocks.setActive( false );
-    %farRocks.setSceneLayer(4);
-    mainScene.add( %farRocks );
-    
-    // Near rocks
-    %nearRocks = new Sprite();
-    %nearRocks.setBodyType( "static" );
-    %nearRocks.setPosition( 0, -8.5 );
-    %nearRocks.setImage( "TropicalAssets:rocksnear" );
-    %nearRocks.setSize( 100, 75 );
-    %nearRocks.setCollisionSuppress();
-    %nearRocks.setAwake( false );
-    %nearRocks.setActive( false );
-    %nearRocks.setSceneLayer(3);
-    mainScene.add( %nearRocks );
-    
-    // Left trigger
-    %leftTrigger = new SceneObject() { class = "AquariumBoundary"; };
-    
-    %leftTrigger.side = "left";
-    %leftTrigger.setSize( 5, 400 );
-    %leftTrigger.setPosition( -85, 0);
-    %leftTrigger.setSceneLayer( 1 );
-    %leftTrigger.setSceneGroup( 15 );
-    %leftTrigger.setCollisionGroups( 14 );
-    %leftTrigger.createPolygonBoxCollisionShape( 5, 400);
-    %leftTrigger.setDefaultDensity( 1 );
-    %leftTrigger.setDefaultFriction( 1.0 );        
-    %leftTrigger.setAwake( true );
-    %leftTrigger.setActive( true );
-    %leftTrigger.setCollisionCallback(true);
-    %leftTrigger.setBodyType( "static" );
-    %leftTrigger.setCollisionShapeIsSensor(0, true);
-    mainScene.add( %leftTrigger );
-    
-    // Right trigger
-    %rightTrigger = new SceneObject() { class = "AquariumBoundary"; };
-    
-    %rightTrigger.setSize( 5, 400 );
-    %rightTrigger.side = "right";
-    %rightTrigger.setPosition( 85, 0);
-    %rightTrigger.setSceneLayer( 1 );
-    %rightTrigger.setSceneGroup( 15 );
-    %rightTrigger.setCollisionGroups( 14 );
-    %rightTrigger.createPolygonBoxCollisionShape( 5, 400);
-    %rightTrigger.setDefaultDensity( 1 );
-    %rightTrigger.setDefaultFriction( 1.0 );    
-    %rightTrigger.setAwake( true );
-    %rightTrigger.setActive( true );
-    %rightTrigger.setCollisionCallback(true);
-    %rightTrigger.setBodyType( "static" );
-    %rightTrigger.setCollisionShapeIsSensor(0, true);
-    mainScene.add( %rightTrigger );    
-}
-
-//-----------------------------------------------------------------------------
-
-function AquariumBoundary::onCollision(%this, %object, %collisionDetails)
-{
-    if (%object.class $= "FishClass")
-        %object.recycle(%this.side);
-}
-
-//-----------------------------------------------------------------------------
-
-function createAquariumEffects()
-{
-    %obj = new Scroller();
-    %obj.setBodyType( "static" );
-    %obj.setImage( "TropicalAssets:wave" );
-    %obj.setPosition( 0, 0 );
-    %obj.setScrollX(2);
-    %obj.setSize( 100, 75 );
-    %obj.setRepeatX( 0.2 );   
-    %obj.setSceneLayer( 0 );
-    %obj.setSceneGroup( 0 );
-    %obj.setCollisionSuppress();
-    %obj.setAwake( false );
-    %obj.setActive( false );
-    mainScene.add( %obj );
-    
-    // Add the caustics particle.
-    %caustics = new ParticlePlayer();
-    %caustics.Particle = "TropicalAssets:Caustics";
-    mainScene.add( %caustics ); 
-}
-
-//-----------------------------------------------------------------------------
-
-function FishClass::onAdd(%this)
-{
-    // Set a random speed for the fish
-    %this.setSpeed();
-   
-    if (getRandom(0, 10) > 5)
-    {
-        %this.setLinearVelocityX(%this.speed);
-        %this.setFlipX(false);
-    }
-    else
-    {
-        %this.setLinearVelocityX(-%this.speed);
-        %this.setFlipX(true);
-    }
-}
-
-//-----------------------------------------------------------------------------
-
-function FishClass::recycle(%this, %side)
-{
-    // Fish has turned around, so set a new random speed
-    %this.setSpeed();
-    %layer = getRandom(0, 5);
-    %this.setLinearVelocityY(getRandom(-3, 3));
-    %this.setPositionY(getRandom(-15, 15));
-    %this.setSceneLayer(%layer);
-
-    if (%side $= "left")
-    {
-        %this.setLinearVelocityX(%this.speed);
-        %this.setFlipX(false);
-    }
-    else if (%side $= "right")
-    {
-        %this.setLinearVelocityX(-%this.speed);
-        %this.setFlipX(true);
-    }
-}
-
-//-----------------------------------------------------------------------------
-
-function FishClass::setSpeed(%this)
-{
-   // Speed is a dynamic variable created when this function is first called
-   // Every other time after the first call will simply modify the variable
-   // .minSpeed and .maxSpeed are declared in the Dynamic Fields rollout of the editor
-   %this.speed = getRandom(%this.minSpeed, %this.maxSpeed);
-}