Browse Source

Merge pull request #37 from doodaddy64/development

Development
doodaddy64 12 years ago
parent
commit
9d1e296
67 changed files with 975 additions and 293 deletions
  1. 0 42
      modules/AquariumToy/1/assets/particles/bubbles.asset.taml
  2. 11 10
      modules/AquariumToy/1/main.cs
  3. 1 1
      modules/AquariumToy/1/module.taml
  4. 0 231
      modules/AquariumToy/1/scripts/aquarium.cs
  5. 80 0
      modules/AquariumToy/1/scripts/fish.cs
  6. 1 1
      modules/TropicalAssets/1/assets/animations/angelfish1Anim.asset.taml
  7. 1 1
      modules/TropicalAssets/1/assets/animations/angelfish2Anim.asset.taml
  8. 1 1
      modules/TropicalAssets/1/assets/animations/butterflyfishAnim.asset.taml
  9. 1 1
      modules/TropicalAssets/1/assets/animations/eelAnim.asset.taml
  10. 1 1
      modules/TropicalAssets/1/assets/animations/pufferfishAnim.asset.taml
  11. 1 1
      modules/TropicalAssets/1/assets/animations/rockfishAnim.asset.taml
  12. 1 1
      modules/TropicalAssets/1/assets/animations/seahorseAnim.asset.taml
  13. 1 1
      modules/TropicalAssets/1/assets/animations/triggerfish1Anim.asset.taml
  14. 1 1
      modules/TropicalAssets/1/assets/animations/triggerfish2Anim.asset.taml
  15. 0 0
      modules/TropicalAssets/1/assets/images/angelfish1.asset.taml
  16. 0 0
      modules/TropicalAssets/1/assets/images/angelfish1.png
  17. 0 0
      modules/TropicalAssets/1/assets/images/angelfish2.asset.taml
  18. 0 0
      modules/TropicalAssets/1/assets/images/angelfish2.png
  19. 0 0
      modules/TropicalAssets/1/assets/images/background.asset.taml
  20. 0 0
      modules/TropicalAssets/1/assets/images/background.jpg
  21. 0 0
      modules/TropicalAssets/1/assets/images/beam.asset.taml
  22. 0 0
      modules/TropicalAssets/1/assets/images/beam.png
  23. 0 0
      modules/TropicalAssets/1/assets/images/bubble.asset.taml
  24. 0 0
      modules/TropicalAssets/1/assets/images/bubble.png
  25. 0 0
      modules/TropicalAssets/1/assets/images/butterflyfish.asset.taml
  26. 0 0
      modules/TropicalAssets/1/assets/images/butterflyfish.png
  27. 0 0
      modules/TropicalAssets/1/assets/images/eel.asset.taml
  28. 0 0
      modules/TropicalAssets/1/assets/images/eel.png
  29. 9 0
      modules/TropicalAssets/1/assets/images/font.asset.taml
  30. BIN
      modules/TropicalAssets/1/assets/images/font.png
  31. 4 0
      modules/TropicalAssets/1/assets/images/mine.asset.taml
  32. BIN
      modules/TropicalAssets/1/assets/images/mine.png
  33. 0 0
      modules/TropicalAssets/1/assets/images/pufferfish.asset.taml
  34. 0 0
      modules/TropicalAssets/1/assets/images/pufferfish.png
  35. 0 0
      modules/TropicalAssets/1/assets/images/rockfish.asset.taml
  36. 0 0
      modules/TropicalAssets/1/assets/images/rockfish.png
  37. 0 0
      modules/TropicalAssets/1/assets/images/rocksfar.asset.taml
  38. 0 0
      modules/TropicalAssets/1/assets/images/rocksfar.png
  39. 0 0
      modules/TropicalAssets/1/assets/images/rocksnear.asset.taml
  40. 0 0
      modules/TropicalAssets/1/assets/images/rocksnear.png
  41. 0 0
      modules/TropicalAssets/1/assets/images/seahorse.asset.taml
  42. 0 0
      modules/TropicalAssets/1/assets/images/seahorse.png
  43. 0 0
      modules/TropicalAssets/1/assets/images/triggerfish1.asset.taml
  44. 0 0
      modules/TropicalAssets/1/assets/images/triggerfish1.png
  45. 0 0
      modules/TropicalAssets/1/assets/images/wave.asset.taml
  46. 0 0
      modules/TropicalAssets/1/assets/images/wave.png
  47. 0 0
      modules/TropicalAssets/1/assets/particles/caustics.asset.taml
  48. 32 0
      modules/TropicalAssets/1/main.cs
  49. 12 0
      modules/TropicalAssets/1/module.taml
  50. 235 0
      modules/TropicalAssets/1/scripts/aquarium.cs
  51. 62 0
      tutorials/fishTutorialBase/.gitignore
  52. 5 0
      tutorials/fishTutorialBase/README.txt
  53. 1 0
      tutorials/fishTutorialBase/cleandso.bat
  54. 34 0
      tutorials/fishTutorialBase/fishTutorial.torsion
  55. 35 0
      tutorials/fishTutorialBase/main.cs
  56. 82 0
      tutorials/fishTutorialBase/modules/DeadlyReef/main.cs
  57. 10 0
      tutorials/fishTutorialBase/modules/DeadlyReef/module.taml
  58. 102 0
      tutorials/fishTutorialBase/modules/DeadlyReef/scripts/behaviors/movement/shooterControls.cs
  59. 62 0
      tutorials/starterProject/.gitignore
  60. 24 0
      tutorials/starterProject/README - setup.md
  61. 1 0
      tutorials/starterProject/cleandso.bat
  62. 36 0
      tutorials/starterProject/main.cs
  63. 9 0
      tutorials/starterProject/modules/BlankGame/1/assets/images/font.asset.taml
  64. BIN
      tutorials/starterProject/modules/BlankGame/1/assets/images/font.png
  65. 72 0
      tutorials/starterProject/modules/BlankGame/1/main.cs
  66. 13 0
      tutorials/starterProject/modules/BlankGame/1/module.taml
  67. 34 0
      tutorials/starterProject/starterProject.torsion

+ 0 - 42
modules/AquariumToy/1/assets/particles/bubbles.asset.taml

@@ -1,42 +0,0 @@
-<ParticleAsset
-    AssetName="Bubbles">
-    <ParticleAssetEmitter
-        EmitterName="bubbles"
-		EmitterType="line"
-		EmitterSize="100 1"
-        FixedForceAngle="90"
-        OldestInFront="1"
-        Image="@asset=ToyAssets:Particles5"
-        Frame="2">
-        <ParticleAssetEmitter.Fields>
-            <Quantity
-                Keys="0 10" />
-			<EmissionArc
-				Keys="0 0" />
-			<EmissionAngle
-				Keys="0 90" />				
-            <Lifetime
-                Keys="0 5" />				
-            <LifetimeVariation
-                Keys="0 3" />
-            <Speed
-                Keys="0 1" />
-            <SpeedVariation
-                Keys="0 0.5" />				
-            <RandomMotion
-                Keys="0 45" />				
-            <FixedForce
-                Keys="0 1" />				
-            <FixedForceVariation
-                Keys="0 1.5" />
-            <SizeX
-                Keys="0 1" />				
-            <SizeXVariation
-                Keys="0 1" />
-            <SizeXLife
-                Keys="0 0 0.2 1 0.5 2 0.9 1 1 0" />				
-            <AlphaChannel
-                Keys="0 0 0.1 0.3 0.8 0.3 1 0" />
-        </ParticleAssetEmitter.Fields>
-    </ParticleAssetEmitter>
-</ParticleAsset>

+ 11 - 10
modules/AquariumToy/1/main.cs

@@ -22,12 +22,12 @@
 
 
 function AquariumToy::create( %this )
 function AquariumToy::create( %this )
 {
 {
-    exec("./scripts/aquarium.cs");
+    exec("./scripts/fish.cs");
 
 
     // Configure settings.
     // Configure settings.
     AquariumToy.maxFish = 10;
     AquariumToy.maxFish = 10;
     AquariumToy.currentFish = 0;
     AquariumToy.currentFish = 0;
-    AquariumToy.selectedAnimation = "AquariumToy:angelfish1Anim";
+    AquariumToy.selectedAnimation = "TropicalAssets:angelfish1Anim";
     
     
     // Set all the fish scene-layers to sort in "batch" mode
     // Set all the fish scene-layers to sort in "batch" mode
     // so that all the fish will be sorted into a batchable order to reduce draw calls.
     // so that all the fish will be sorted into a batchable order to reduce draw calls.
@@ -62,8 +62,8 @@ function AquariumToy::reset(%this)
     // Set the gravity.
     // Set the gravity.
     SandboxScene.setGravity(0, 0);
     SandboxScene.setGravity(0, 0);
 
 
-    buildAquarium();
-    createAquariumEffects();
+    buildAquarium(SandboxScene);
+    createAquariumEffects(SandboxScene);
 
 
     // Reset the ball count.
     // Reset the ball count.
     %this.currentFish = 0;
     %this.currentFish = 0;
@@ -80,23 +80,24 @@ function AquariumToy::spawnFish(%this)
     %index = getRandom(0, 5);
     %index = getRandom(0, 5);
     %anim = getUnit(getFishAnimationList(), %index, ",");
     %anim = getUnit(getFishAnimationList(), %index, ",");
 
 
-    %fishInfo = getFishSize(%anim);
+    %fishSize = getFishSize(%anim);
 
 
     %fish = new Sprite()
     %fish = new Sprite()
     {
     {
         Animation = %anim;
         Animation = %anim;
         class = "FishClass";
         class = "FishClass";
         position = %position;
         position = %position;
-        size = %fishInfo;
-        SceneLayer = "2";
+        size = %fishSize;
+        SceneLayer = "15";
         SceneGroup = "14";
         SceneGroup = "14";
         minSpeed = "5";
         minSpeed = "5";
         maxSpeed = "15";
         maxSpeed = "15";
         CollisionCallback = true;
         CollisionCallback = true;
     };
     };
-
-    %fish.setCollisionGroups( none );
-    %fish.createPolygonBoxCollisionShape( 15, 15);
+
+    // aquarium boundary triggers are in group 15.  See TropicalAssets/scripts/aquarium.cs
+    %fish.setCollisionGroups( 15 );
+    %fish.createPolygonBoxCollisionShape(%fishSize);
     %fish.setDefaultDensity( 1 );
     %fish.setDefaultDensity( 1 );
     SandboxScene.add( %fish );
     SandboxScene.add( %fish );
 
 

+ 1 - 1
modules/AquariumToy/1/module.taml

@@ -2,7 +2,7 @@
 	ModuleId="AquariumToy"
 	ModuleId="AquariumToy"
 	VersionId="1"
 	VersionId="1"
 	Description="A fun demonstration of an aquarium."
 	Description="A fun demonstration of an aquarium."
-	Dependencies="ToyAssets=1"
+	Dependencies="ToyAssets=1,TropicalAssets=1"
 	Type="toy"
 	Type="toy"
 	ToyCategoryIndex="5"
 	ToyCategoryIndex="5"
 	ScriptFile="main.cs"
 	ScriptFile="main.cs"

+ 0 - 231
modules/AquariumToy/1/scripts/aquarium.cs

@@ -1,231 +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 = "AquariumToy:angelfish1Anim" @ "," @ "AquariumToy:angelfish2Anim" @ "," @ "AquariumToy:butterflyfishAnim";
-   %list = %list @ "," @ "AquariumToy:pufferfishAnim" @ "," @ "AquariumToy:rockfishAnim" @ "," @ "AquariumToy:seahorseAnim";
-   %list = %list @ "," @ "AquariumToy:triggerfish1Anim" @ "," @ "AquariumToy:eelAnim";
-}
-
-//-----------------------------------------------------------------------------
-
-function getFishSize(%anim)
-{
-    switch$(%anim)
-    {
-        case "AquariumToy:angelfish1Anim":
-        %fishInfo = "15 15";
-
-        case "AquariumToy:angelfish2Anim":
-        %fishInfo = "15 15";
-        
-        case "AquariumToy:butterflyfishAnim":
-        %fishInfo = "15 15";
-        
-        case "AquariumToy:pufferfishAnim":
-        %fishInfo = "15 15";
-        
-        case "AquariumToy:rockfishAnim":
-        %fishInfo = "15 7.5";
-        
-        case "AquariumToy:seahorseAnim":
-        %fishInfo = "7.5 15";
-        
-        case "AquariumToy:triggerfish1Anim":
-        %fishInfo = "15 15";
-
-        case "AquariumToy:eelAnim":
-        %fishInfo = "7.5 3.75";
-    }
-
-    return %fishInfo;
-}
-
-//-----------------------------------------------------------------------------
-
-function buildAquarium()
-{
-    // Background
-    %background = new Sprite();
-    %background.setBodyType( "static" );
-    %background.setImage( "AquariumToy:background" );
-    %background.setSize( 100, 75 );
-    %background.setCollisionSuppress();
-    %background.setAwake( false );
-    %background.setActive( false );
-    %background.setSceneLayer(5);
-    SandboxScene.add( %background );
-    
-    // Far rocks
-    %farRocks = new Sprite();
-    %farRocks.setBodyType( "static" );
-    %farRocks.setPosition( 0, -7.5 );
-    %farRocks.setImage( "AquariumToy:rocksfar" );
-    %farRocks.setSize( 100, 75 );
-    %farRocks.setCollisionSuppress();
-    %farRocks.setAwake( false );
-    %farRocks.setActive( false );
-    %farRocks.setSceneLayer(4);
-    SandboxScene.add( %farRocks );
-    
-    // Near rocks
-    %nearRocks = new Sprite();
-    %nearRocks.setBodyType( "static" );
-    %nearRocks.setPosition( 0, -8.5 );
-    %nearRocks.setImage( "AquariumToy:rocksnear" );
-    %nearRocks.setSize( 100, 75 );
-    %nearRocks.setCollisionSuppress();
-    %nearRocks.setAwake( false );
-    %nearRocks.setActive( false );
-    %nearRocks.setSceneLayer(3);
-    SandboxScene.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);
-    SandboxScene.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);
-    SandboxScene.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( "AquariumToy: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 );
-    SandboxScene.add( %obj );
-
-    // Add the bubbles particle.
-    %bubbles= new ParticlePlayer();
-    %bubbles.Particle = "AquariumToy:Bubbles";
-    %bubbles.setPosition( 0, -38 );
-    %bubbles.setSceneLayer(4);
-    SandboxScene.add( %bubbles );   
-    
-    // Add the caustics particle.
-    %caustics = new ParticlePlayer();
-    %caustics.Particle = "AquariumToy:Caustics";
-    SandboxScene.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);
-}

+ 80 - 0
modules/AquariumToy/1/scripts/fish.cs

@@ -0,0 +1,80 @@
+//-----------------------------------------------------------------------------
+// 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 FishClass::onCollision(%this, %object, %collisionDetails)
+{
+    if (%object.class $= "AquariumBoundary")
+        %this.recycle(%object.side);
+}
+
+//-----------------------------------------------------------------------------
+
+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);
+}

+ 1 - 1
modules/AquariumToy/1/assets/animations/angelfish1Anim.asset.taml → modules/TropicalAssets/1/assets/animations/angelfish1Anim.asset.taml

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

+ 1 - 1
modules/AquariumToy/1/assets/animations/angelfish2Anim.asset.taml → modules/TropicalAssets/1/assets/animations/angelfish2Anim.asset.taml

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

+ 1 - 1
modules/AquariumToy/1/assets/animations/butterflyfishAnim.asset.taml → modules/TropicalAssets/1/assets/animations/butterflyfishAnim.asset.taml

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

+ 1 - 1
modules/AquariumToy/1/assets/animations/eelAnim.asset.taml → modules/TropicalAssets/1/assets/animations/eelAnim.asset.taml

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

+ 1 - 1
modules/AquariumToy/1/assets/animations/pufferfishAnim.asset.taml → modules/TropicalAssets/1/assets/animations/pufferfishAnim.asset.taml

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

+ 1 - 1
modules/AquariumToy/1/assets/animations/rockfishAnim.asset.taml → modules/TropicalAssets/1/assets/animations/rockfishAnim.asset.taml

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

+ 1 - 1
modules/AquariumToy/1/assets/animations/seahorseAnim.asset.taml → modules/TropicalAssets/1/assets/animations/seahorseAnim.asset.taml

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

+ 1 - 1
modules/AquariumToy/1/assets/animations/triggerfish1Anim.asset.taml → modules/TropicalAssets/1/assets/animations/triggerfish1Anim.asset.taml

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

+ 1 - 1
modules/AquariumToy/1/assets/animations/triggerfish2Anim.asset.taml → modules/TropicalAssets/1/assets/animations/triggerfish2Anim.asset.taml

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

+ 0 - 0
modules/AquariumToy/1/assets/images/angelfish1.asset.taml → modules/TropicalAssets/1/assets/images/angelfish1.asset.taml


+ 0 - 0
modules/AquariumToy/1/assets/images/angelfish1.png → modules/TropicalAssets/1/assets/images/angelfish1.png


+ 0 - 0
modules/AquariumToy/1/assets/images/angelfish2.asset.taml → modules/TropicalAssets/1/assets/images/angelfish2.asset.taml


+ 0 - 0
modules/AquariumToy/1/assets/images/angelfish2.png → modules/TropicalAssets/1/assets/images/angelfish2.png


+ 0 - 0
modules/AquariumToy/1/assets/images/background.asset.taml → modules/TropicalAssets/1/assets/images/background.asset.taml


+ 0 - 0
modules/AquariumToy/1/assets/images/background.jpg → modules/TropicalAssets/1/assets/images/background.jpg


+ 0 - 0
modules/AquariumToy/1/assets/images/beam.asset.taml → modules/TropicalAssets/1/assets/images/beam.asset.taml


+ 0 - 0
modules/AquariumToy/1/assets/images/beam.png → modules/TropicalAssets/1/assets/images/beam.png


+ 0 - 0
modules/AquariumToy/1/assets/images/bubble.asset.taml → modules/TropicalAssets/1/assets/images/bubble.asset.taml


+ 0 - 0
modules/AquariumToy/1/assets/images/bubble.png → modules/TropicalAssets/1/assets/images/bubble.png


+ 0 - 0
modules/AquariumToy/1/assets/images/butterflyfish.asset.taml → modules/TropicalAssets/1/assets/images/butterflyfish.asset.taml


+ 0 - 0
modules/AquariumToy/1/assets/images/butterflyfish.png → modules/TropicalAssets/1/assets/images/butterflyfish.png


+ 0 - 0
modules/AquariumToy/1/assets/images/eel.asset.taml → modules/TropicalAssets/1/assets/images/eel.asset.taml


+ 0 - 0
modules/AquariumToy/1/assets/images/eel.png → modules/TropicalAssets/1/assets/images/eel.png


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

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

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


+ 4 - 0
modules/TropicalAssets/1/assets/images/mine.asset.taml

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

BIN
modules/TropicalAssets/1/assets/images/mine.png


+ 0 - 0
modules/AquariumToy/1/assets/images/pufferfish.asset.taml → modules/TropicalAssets/1/assets/images/pufferfish.asset.taml


+ 0 - 0
modules/AquariumToy/1/assets/images/pufferfish.png → modules/TropicalAssets/1/assets/images/pufferfish.png


+ 0 - 0
modules/AquariumToy/1/assets/images/rockfish.asset.taml → modules/TropicalAssets/1/assets/images/rockfish.asset.taml


+ 0 - 0
modules/AquariumToy/1/assets/images/rockfish.png → modules/TropicalAssets/1/assets/images/rockfish.png


+ 0 - 0
modules/AquariumToy/1/assets/images/rocksfar.asset.taml → modules/TropicalAssets/1/assets/images/rocksfar.asset.taml


+ 0 - 0
modules/AquariumToy/1/assets/images/rocksfar.png → modules/TropicalAssets/1/assets/images/rocksfar.png


+ 0 - 0
modules/AquariumToy/1/assets/images/rocksnear.asset.taml → modules/TropicalAssets/1/assets/images/rocksnear.asset.taml


+ 0 - 0
modules/AquariumToy/1/assets/images/rocksnear.png → modules/TropicalAssets/1/assets/images/rocksnear.png


+ 0 - 0
modules/AquariumToy/1/assets/images/seahorse.asset.taml → modules/TropicalAssets/1/assets/images/seahorse.asset.taml


+ 0 - 0
modules/AquariumToy/1/assets/images/seahorse.png → modules/TropicalAssets/1/assets/images/seahorse.png


+ 0 - 0
modules/AquariumToy/1/assets/images/triggerfish1.asset.taml → modules/TropicalAssets/1/assets/images/triggerfish1.asset.taml


+ 0 - 0
modules/AquariumToy/1/assets/images/triggerfish1.png → modules/TropicalAssets/1/assets/images/triggerfish1.png


+ 0 - 0
modules/AquariumToy/1/assets/images/wave.asset.taml → modules/TropicalAssets/1/assets/images/wave.asset.taml


+ 0 - 0
modules/AquariumToy/1/assets/images/wave.png → modules/TropicalAssets/1/assets/images/wave.png


+ 0 - 0
modules/AquariumToy/1/assets/particles/caustics.asset.taml → modules/TropicalAssets/1/assets/particles/caustics.asset.taml


+ 32 - 0
modules/TropicalAssets/1/main.cs

@@ -0,0 +1,32 @@
+//-----------------------------------------------------------------------------
+// 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 TropicalAssets::create( %this )
+{
+    exec("./scripts/aquarium.cs");
+}
+
+//-----------------------------------------------------------------------------
+
+function TropicalAssets::destroy( %this )
+{
+}

+ 12 - 0
modules/TropicalAssets/1/module.taml

@@ -0,0 +1,12 @@
+<ModuleDefinition
+	ModuleId="TropicalAssets"
+	VersionId="1"
+	Description="Tropical Fish Assets.  Particularly useful for the AquariumToy"
+	ScriptFile="main.cs"
+	CreateFunction="create"
+	DestroyFunction="destroy">
+		<DeclaredAssets
+			Path="assets"
+			Extension="asset.taml"
+			Recurse="true"/>
+</ModuleDefinition>

+ 235 - 0
modules/TropicalAssets/1/scripts/aquarium.cs

@@ -0,0 +1,235 @@
+//-----------------------------------------------------------------------------
+// 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(%scene)
+{
+    // A pre-built aquarium of size 100x75, with blue water, some haze, and some nice rocks.
+    // Triggers will be provide around the edges, kind of like an electric fence,
+    // with a call to addAquariumBoundaries.
+
+    // 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(30);
+    %scene.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(20);
+    %scene.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(10);
+    %scene.add( %nearRocks );
+    
+    addAquariumBoundaries( %scene, 100, 75 );
+}
+
+function addAquariumBoundaries(%scene, %width, %height)
+{
+    // add boundaries on all sides of the aquarium a bit outside of the border of the tank.
+    // The triggers allow for onCollision to be sent to any fish or other object that touch the edges.
+    // The triggers are far enough outside the tank so that objects will most likely be just out of view
+    // before they are sent the onCollision callback.  This will they can adjust "off stage".
+
+    // Calculate a width and height to use for the bounds.
+    // They should be bigger than the aquarium itself.
+    %wrapWidth = %width * 1.5;
+    %wrapHeight = %height * 1.5;
+
+    // Left trigger
+    %leftTrigger = new SceneObject() { class = "AquariumBoundary"; };
+    
+    %leftTrigger.side = "left";
+    // make the bound as tall as the tank
+    %leftTrigger.setSize( 5, %wrapHeight );
+    // put the bounds 50% further out than the edge of the tank
+    %leftTrigger.setPosition( -%wrapWidth/2, 0 );
+    %leftTrigger.setSceneLayer( 1 );
+    %leftTrigger.createPolygonBoxCollisionShape( 5, %wrapHeight );
+    %leftTrigger.setDefaultDensity( 1 );
+    %leftTrigger.setDefaultFriction( 1.0 );        
+    %leftTrigger.setAwake( true );
+    %leftTrigger.setActive( true );
+    // the objects that collide with us should handle any callbacks.
+    // remember to set those scene objects to collide with scene group 15 (which is our group)!
+    %leftTrigger.setSceneGroup( 15 );
+    %leftTrigger.setCollisionCallback(false);
+    %leftTrigger.setBodyType( "static" );
+    %leftTrigger.setCollisionShapeIsSensor(0, true);
+    %scene.add( %leftTrigger );
+    
+    // Right trigger
+    %rightTrigger = new SceneObject() { class = "AquariumBoundary"; };
+    
+    // make the bound as tall as the tank
+    %rightTrigger.setSize( 5, %wrapHeight );
+    %rightTrigger.side = "right";
+    // put the bounds 50% further out than the edge of the tank
+    %rightTrigger.setPosition( %wrapWidth/2, 0 );
+    %rightTrigger.setSceneLayer( 1 );
+    %rightTrigger.createPolygonBoxCollisionShape( 5, %wrapHeight );
+    %rightTrigger.setDefaultDensity( 1 );
+    %rightTrigger.setDefaultFriction( 1.0 );    
+    %rightTrigger.setAwake( true );
+    %rightTrigger.setActive( true );
+    // the objects that collide with us should handle any callbacks.
+    // remember to set those scene objects to collide with scene group 15 (which is our group)!
+    %rightTrigger.setSceneGroup( 15 );
+    %rightTrigger.setCollisionCallback(false);
+    %rightTrigger.setBodyType( "static" );
+    %rightTrigger.setCollisionShapeIsSensor(0, true);
+    %scene.add( %rightTrigger );    
+
+    // Left trigger
+    %topTrigger = new SceneObject() { class = "AquariumBoundary"; };
+    
+    %topTrigger.side = "top";
+    // make the bound as wide as the tank
+    %topTrigger.setSize( %wrapWidth, 5 );
+    // put the bounds 50% further out than the edge of the tank
+    %topTrigger.setPosition( 0, -%wrapHeight/2 );
+    %topTrigger.setSceneLayer( 1 );
+    %topTrigger.createPolygonBoxCollisionShape( %wrapWidth, 5 );
+    %topTrigger.setDefaultDensity( 1 );
+    %topTrigger.setDefaultFriction( 1.0 );        
+    %topTrigger.setAwake( true );
+    %topTrigger.setActive( true );
+    // the objects that collide with us should handle any callbacks.
+    // remember to set those scene objects to collide with scene group 15 (which is our group)!
+    %topTrigger.setSceneGroup( 15 );
+    %topTrigger.setCollisionCallback(false);
+    %topTrigger.setBodyType( "static" );
+    %topTrigger.setCollisionShapeIsSensor(0, true);
+    %scene.add( %topTrigger );
+    
+    // Right trigger
+    %bottomTrigger = new SceneObject() { class = "AquariumBoundary"; };
+    
+    // make the bound as wide as the tank
+    %bottomTrigger.setSize( %wrapWidth, 5 );
+    %bottomTrigger.side = "bottom";
+    // put the bounds 50% further out than the edge of the tank
+    %bottomTrigger.setPosition( 0, %wrapHeight/2 );
+    %bottomTrigger.setSceneLayer( 1 );
+    %bottomTrigger.createPolygonBoxCollisionShape( %wrapWidth, 5 );
+    %bottomTrigger.setDefaultDensity( 1 );
+    %bottomTrigger.setDefaultFriction( 1.0 );    
+    %bottomTrigger.setAwake( true );
+    %bottomTrigger.setActive( true );
+    // the objects that collide with us should handle any callbacks.
+    // remember to set those scene objects to collide with scene group 15 (which is our group)!
+    %bottomTrigger.setSceneGroup( 15 );
+    %bottomTrigger.setCollisionCallback(false);
+    %bottomTrigger.setBodyType( "static" );
+    %bottomTrigger.setCollisionShapeIsSensor(0, true);
+    %scene.add( %bottomTrigger );
+}
+
+//-----------------------------------------------------------------------------
+
+function createAquariumEffects(%scene)
+{
+    %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 );
+    %scene.add( %obj );
+    
+    // Add the caustics particle.
+    %caustics = new ParticlePlayer();
+    %caustics.Particle = "TropicalAssets:Caustics";
+    %scene.add( %caustics ); 
+}
+
+//-----------------------------------------------------------------------------

+ 62 - 0
tutorials/fishTutorialBase/.gitignore

@@ -0,0 +1,62 @@
+# Dev Files #
+###################
+*.xcworkspace
+*.xcuserdatad
+.LSOverride
+/tmp/*
+/preferences.cs
+*.dso
+*.edso
+*.user
+*.sdf
+*.suo
+*.dir
+*.opensdf
+*.idea
+*.dSYM
+*.res
+*.cache
+*.exports
+*.opt
+*.tmp
+Torque2D.app
+Torque2D_DEBUG.app
+Torque2D.exe
+Torque2D_DEBUG.exe
+Torque2DGame.app
+Torque2DGame_Debug.app
+linkmap.txt
+    
+# Compiled source #
+###################
+*.com
+*.class
+*.o
+*.a
+*.so
+*.obj
+*.lib
+*.idb
+*.pdb
+*.ilk
+*.ipch
+*.lastbuildstate
+*.unsuccessfulbuild
+*.manifest
+*.tlog
+
+# Logs and databases #
+######################
+*.log
+*.sql
+
+# OS generated files #
+######################
+.DS_Store
+.DS_Store?
+._*
+.Spotlight-V100
+.Trashes
+Icon?
+ehthumbs.db
+Thumbs.db

+ 5 - 0
tutorials/fishTutorialBase/README.txt

@@ -0,0 +1,5 @@
+fishTutorialBase is the starting point for the Fish Tutorial
+
+See the tutorial for how to begin with this template.  It is most likely located at https://github.com/GarageGames/Torque2D/wiki.
+
+

+ 1 - 0
tutorials/fishTutorialBase/cleandso.bat

@@ -0,0 +1 @@
+del /s *.dso

+ 34 - 0
tutorials/fishTutorialBase/fishTutorial.torsion

@@ -0,0 +1,34 @@
+<TorsionProject>
+<Name>fishTutorial</Name>
+<WorkingDir/>
+<EntryScript>main.cs</EntryScript>
+<DebugHook>dbgSetParameters( #port#, "#password#", true );</DebugHook>
+<Mods>
+<Folder>modules</Folder>
+</Mods>
+<ScannerExts>cs; gui</ScannerExts>
+<Configs>
+<Config>
+<Name>Release</Name>
+<Executable>Torque2D.exe</Executable>
+<Arguments/>
+<HasExports>true</HasExports>
+<Precompile>false</Precompile>
+<InjectDebugger>true</InjectDebugger>
+<UseSetModPaths>false</UseSetModPaths>
+</Config>
+<Config>
+<Name>Debug</Name>
+<Executable>Torque2D_DEBUG.exe</Executable>
+<Arguments/>
+<HasExports>false</HasExports>
+<Precompile>false</Precompile>
+<InjectDebugger>true</InjectDebugger>
+<UseSetModPaths>false</UseSetModPaths>
+</Config>
+</Configs>
+<SearchURL/>
+<SearchProduct>fishTutorial</SearchProduct>
+<SearchVersion>HEAD</SearchVersion>
+<ExecModifiedScripts>true</ExecModifiedScripts>
+</TorsionProject>

+ 35 - 0
tutorials/fishTutorialBase/main.cs

@@ -0,0 +1,35 @@
+//-----------------------------------------------------------------------------
+// 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.
+//-----------------------------------------------------------------------------
+
+setLogMode(6);
+$Scripts::ignoreDSOs = true;
+
+ModuleDatabase.scanModules( "modules" );
+ModuleDatabase.LoadGroup( "game" );
+
+//-----------------------------------------------------------------------------
+
+function onExit()
+{
+    ModuleDatabase.unloadGroup( "game" );
+}
+

+ 82 - 0
tutorials/fishTutorialBase/modules/DeadlyReef/main.cs

@@ -0,0 +1,82 @@
+//-----------------------------------------------------------------------------
+// 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 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.
+    new Scene(mainScene);
+
+    // Without a system window or "Canvas", we can't see or interact with our scene.
+    // AppCore initialized the Canvas already
+
+    // Now that we have a Canvas, we need a viewport into the scene.
+    // Give it a global name "mainWindow" since we may want to access it directly in our scripts.
+    new SceneWindow(mainWindow);
+    mainWindow.profile = new GuiControlProfile();
+    Canvas.setContent(mainWindow);
+
+    // Finally, connect our scene into the viewport (or sceneWindow).
+    // Note that a viewport comes with a camera built-in.
+    mainWindow.setScene(mainScene);
+    mainWindow.setCameraPosition( 0, 0 );
+    mainWindow.setCameraSize( 100, 75 );
+
+    // load some scripts and variables
+    // exec("./scripts/someScript.cs");
+
+    buildAquarium(mainScene);
+    createAquariumEffects(mainScene);
+    DeadlyReef.spawnPlayerFish();
+}
+
+//-----------------------------------------------------------------------------
+
+function DeadlyReef::destroy( %this )
+{
+}
+
+//-----------------------------------------------------------------------------
+
+function DeadlyReef::spawnPlayerFish(%this)
+{
+    %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
tutorials/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
tutorials/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();
+}

+ 62 - 0
tutorials/starterProject/.gitignore

@@ -0,0 +1,62 @@
+# Dev Files #
+###################
+*.xcworkspace
+*.xcuserdatad
+.LSOverride
+/tmp/*
+/preferences.cs
+*.dso
+*.edso
+*.user
+*.sdf
+*.suo
+*.dir
+*.opensdf
+*.idea
+*.dSYM
+*.res
+*.cache
+*.exports
+*.opt
+*.tmp
+Torque2D.app
+Torque2D_DEBUG.app
+Torque2D.exe
+Torque2D_DEBUG.exe
+Torque2DGame.app
+Torque2DGame_Debug.app
+linkmap.txt
+    
+# Compiled source #
+###################
+*.com
+*.class
+*.o
+*.a
+*.so
+*.obj
+*.lib
+*.idb
+*.pdb
+*.ilk
+*.ipch
+*.lastbuildstate
+*.unsuccessfulbuild
+*.manifest
+*.tlog
+
+# Logs and databases #
+######################
+*.log
+*.sql
+
+# OS generated files #
+######################
+.DS_Store
+.DS_Store?
+._*
+.Spotlight-V100
+.Trashes
+Icon?
+ehthumbs.db
+Thumbs.db

+ 24 - 0
tutorials/starterProject/README - setup.md

@@ -0,0 +1,24 @@
+## What Is This `StarterProject` Directory
+
+`starterProject` is a template project for starting a Torque2D game from scratch.  You don't have to start here, but it should be easy to do so.
+
+## What Does a Torque2D Game Project Consist Of?
+
+In its simplest form, a project consists of a top-level directory with the following contents:
+
+* the Torque2D game engine
+* a `main.cs` script file, which the engine runs when it starts
+* almost certainly a `modules` directory containing one or more modules of game assets and scripts
+* almost certainly a bootstrap module, such as `AppCore`, to setup common variables and other required bits for the engine.
+
+## How To Start With This `starterProject`
+
+1. If you do not have a copy of the Torque2D binary, obtain or compile one.
+2. Copy this "startProject" directory to wherever you want to create the project.  This becomes the main project directory.
+3. If you are running Windows, copy the following files from your Torque2D original to this directory:
+  * Torque2D.app
+  * OpenAL32.dll
+	* unicows.dll
+4. If you are running OSX, copy the following files from your Torque2D original to this directory:
+  * Torque2D(.app)
+5. Go to your Torque2D original and copy the modules/AppCore directory to this projects modules/ directory.

+ 1 - 0
tutorials/starterProject/cleandso.bat

@@ -0,0 +1 @@
+del /s *.dso

+ 36 - 0
tutorials/starterProject/main.cs

@@ -0,0 +1,36 @@
+//-----------------------------------------------------------------------------
+// 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.
+//-----------------------------------------------------------------------------
+
+// debug amounts of log output
+setLogMode(6);
+// run game from the script files.  don't compile them first
+$Scripts::ignoreDSOs = true;
+
+ModuleDatabase.scanModules( "modules" );
+ModuleDatabase.LoadExplicit( "BlankGame" );
+
+//-----------------------------------------------------------------------------
+
+function onExit()
+{
+    ModuleDatabase.unloadExplicit( "BlankGame" );
+}

+ 9 - 0
tutorials/starterProject/modules/BlankGame/1/assets/images/font.asset.taml

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

BIN
tutorials/starterProject/modules/BlankGame/1/assets/images/font.png


+ 72 - 0
tutorials/starterProject/modules/BlankGame/1/main.cs

@@ -0,0 +1,72 @@
+//-----------------------------------------------------------------------------
+// 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 BlankGame::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.
+    new Scene(mainScene);
+
+    // Without a system window or "Canvas", we can't see or interact with our scene.
+    // AppCore initialized the Canvas already
+
+    // Now that we have a Canvas, we need a viewport into the scene.
+    // Give it a global name "mainWindow" since we may want to access it directly in our scripts.
+    new SceneWindow(mainWindow);
+    mainWindow.profile = new GuiControlProfile();
+    Canvas.setContent(mainWindow);
+
+    // Finally, connect our scene into the viewport (or sceneWindow).
+    // Note that a viewport comes with a camera built-in.
+    mainWindow.setScene(mainScene);
+    mainWindow.setCameraPosition( 0, 0 );
+    mainWindow.setCameraSize( 100, 75 );
+
+    // load some scripts and variables
+    // exec("./scripts/someScript.cs");
+
+    // let's do a little something to make sure we are up and running.
+    // write "hello world!"  :)
+    %this.sayHello();
+}
+
+//-----------------------------------------------------------------------------
+
+function BlankGame::destroy( %this )
+{
+}
+
+//-----------------------------------------------------------------------------
+
+
+function BlankGame::sayHello( %this )
+{
+    %phrase = new ImageFont();
+    %phrase.Image = "BlankGame:Font";
+       
+    // Set the font size in both axis.  This is in world-units and not typicaly font "points".
+    %phrase.FontSize = "2 2";
+    
+    %phrase.TextAlignment = "Center";
+    %phrase.Text = "Hello, World!";
+    mainScene.add( %phrase );    
+}

+ 13 - 0
tutorials/starterProject/modules/BlankGame/1/module.taml

@@ -0,0 +1,13 @@
+<ModuleDefinition
+	ModuleId="blankGame"
+	VersionId="1"
+	Description="Blank Project as a Template.  You should probably rename this module!"
+	Dependencies="AppCore=1"
+	ScriptFile="main.cs"
+	CreateFunction="create"
+	DestroyFunction="destroy">
+		<DeclaredAssets
+			Path="assets"
+			Extension="asset.taml"
+			Recurse="true"/>
+</ModuleDefinition>

+ 34 - 0
tutorials/starterProject/starterProject.torsion

@@ -0,0 +1,34 @@
+<TorsionProject>
+<Name>starterProject</Name>
+<WorkingDir/>
+<EntryScript>main.cs</EntryScript>
+<DebugHook>dbgSetParameters( #port#, "#password#", true );</DebugHook>
+<Mods>
+<Folder>modules</Folder>
+</Mods>
+<ScannerExts>cs; gui</ScannerExts>
+<Configs>
+<Config>
+<Name>Release</Name>
+<Executable>Torque2D.exe</Executable>
+<Arguments/>
+<HasExports>true</HasExports>
+<Precompile>false</Precompile>
+<InjectDebugger>true</InjectDebugger>
+<UseSetModPaths>false</UseSetModPaths>
+</Config>
+<Config>
+<Name>Debug</Name>
+<Executable>Torque2D_DEBUG.exe</Executable>
+<Arguments/>
+<HasExports>false</HasExports>
+<Precompile>false</Precompile>
+<InjectDebugger>true</InjectDebugger>
+<UseSetModPaths>false</UseSetModPaths>
+</Config>
+</Configs>
+<SearchURL/>
+<SearchProduct>baseProject</SearchProduct>
+<SearchVersion>HEAD</SearchVersion>
+<ExecModifiedScripts>true</ExecModifiedScripts>
+</TorsionProject>