瀏覽代碼

Removed the Leap Toy

Peter Robinson 4 年之前
父節點
當前提交
552c4e6bca
共有 47 個文件被更改,包括 0 次插入2330 次删除
  1. 0 7
      toybox/LeapToy/1/assets/animations/Digital_ExplosionAnimation.asset.taml
  2. 0 5
      toybox/LeapToy/1/assets/animations/Projectile_Digital_StrikeAnimation.asset.taml
  3. 0 6
      toybox/LeapToy/1/assets/animations/blockAnim.asset.taml
  4. 0 6
      toybox/LeapToy/1/assets/animations/brickAnim.asset.taml
  5. 0 8
      toybox/LeapToy/1/assets/images/Digital_Explosion.asset.taml
  6. 二進制
      toybox/LeapToy/1/assets/images/Digital_Explosion.png
  7. 0 8
      toybox/LeapToy/1/assets/images/Projectile_Digital_Strike.asset.taml
  8. 二進制
      toybox/LeapToy/1/assets/images/Projectile_Digital_Strike.png
  9. 0 3
      toybox/LeapToy/1/assets/images/barrierWall.asset.taml
  10. 二進制
      toybox/LeapToy/1/assets/images/barrierWall.png
  11. 0 3
      toybox/LeapToy/1/assets/images/blockGlow.asset.taml
  12. 二進制
      toybox/LeapToy/1/assets/images/blockGlow.png
  13. 0 3
      toybox/LeapToy/1/assets/images/circleThree.asset.taml
  14. 二進制
      toybox/LeapToy/1/assets/images/circleThree.png
  15. 0 3
      toybox/LeapToy/1/assets/images/complexCircle.asset.taml
  16. 二進制
      toybox/LeapToy/1/assets/images/complexCircle.png
  17. 0 3
      toybox/LeapToy/1/assets/images/menuBackground.asset.taml
  18. 二進制
      toybox/LeapToy/1/assets/images/menuBackground.jpg
  19. 0 9
      toybox/LeapToy/1/assets/images/objectsBlocks.asset.taml
  20. 二進制
      toybox/LeapToy/1/assets/images/objectsBlocks.png
  21. 0 7
      toybox/LeapToy/1/assets/images/objectsBricks.asset.taml
  22. 二進制
      toybox/LeapToy/1/assets/images/objectsBricks.png
  23. 0 3
      toybox/LeapToy/1/assets/images/playerUfo.asset.taml
  24. 二進制
      toybox/LeapToy/1/assets/images/playerUfo.png
  25. 0 3
      toybox/LeapToy/1/assets/images/simpleCircle.asset.taml
  26. 二進制
      toybox/LeapToy/1/assets/images/simpleCircle.png
  27. 0 3
      toybox/LeapToy/1/assets/images/widgetBall.asset.taml
  28. 二進制
      toybox/LeapToy/1/assets/images/widgetBall.png
  29. 0 3
      toybox/LeapToy/1/assets/images/widgetFruit.asset.taml
  30. 二進制
      toybox/LeapToy/1/assets/images/widgetFruit.png
  31. 0 3
      toybox/LeapToy/1/assets/images/window.asset.taml
  32. 二進制
      toybox/LeapToy/1/assets/images/window.png
  33. 0 129
      toybox/LeapToy/1/assets/particles/blockFadeParticle.asset.taml
  34. 0 69
      toybox/LeapToy/1/assets/particles/digitalExplosion.asset.taml
  35. 0 79
      toybox/LeapToy/1/assets/particles/digitalFire.asset.taml
  36. 0 180
      toybox/LeapToy/1/main.cs
  37. 0 15
      toybox/LeapToy/1/module.taml
  38. 0 80
      toybox/LeapToy/1/scripts/DealsDamageBehavior.cs
  39. 0 59
      toybox/LeapToy/1/scripts/SwapImageOnCollision.cs
  40. 0 133
      toybox/LeapToy/1/scripts/TakesDamageBehavior.cs
  41. 0 198
      toybox/LeapToy/1/scripts/breakoutDemo.cs
  42. 0 286
      toybox/LeapToy/1/scripts/builderDemo.cs
  43. 0 112
      toybox/LeapToy/1/scripts/fingerDemo.cs
  44. 0 376
      toybox/LeapToy/1/scripts/gestureDemo.cs
  45. 0 88
      toybox/LeapToy/1/scripts/helpText.cs
  46. 0 315
      toybox/LeapToy/1/scripts/input.cs
  47. 0 125
      toybox/LeapToy/1/scripts/toy.cs

+ 0 - 7
toybox/LeapToy/1/assets/animations/Digital_ExplosionAnimation.asset.taml

@@ -1,7 +0,0 @@
-<AnimationAsset
-    AssetName="Digital_ExplosionAnimation"
-    Image="@asset=LeapToy:Digital_ExplosionSprite"
-    animationFrames="0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15"
-    animationTime="1"
-    animationCycle="0"
-     />

+ 0 - 5
toybox/LeapToy/1/assets/animations/Projectile_Digital_StrikeAnimation.asset.taml

@@ -1,5 +0,0 @@
-<AnimationAsset
-    AssetName="Projectile_Digital_StrikeAnimation"
-    Image="@asset=LeapToy:Projectile_Digital_StrikeSprite"
-    AnimationFrames="0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15"
-    AnimationTime="1" />

+ 0 - 6
toybox/LeapToy/1/assets/animations/blockAnim.asset.taml

@@ -1,6 +0,0 @@
-<AnimationAsset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../Torque2D.xsd"
-                AssetName="blockAnim"
-                Image="@asset=LeapToy:objectsBlocks"
-                AnimationCycle="1"
-                AnimationTime="2"
-                AnimationFrames="0 1 2 3 4 5 6 7"/>

+ 0 - 6
toybox/LeapToy/1/assets/animations/brickAnim.asset.taml

@@ -1,6 +0,0 @@
-<AnimationAsset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../Torque2D.xsd"
-                AssetName="brickAnim"
-                Image="@asset=LeapToy:objectsBricks"
-                AnimationCycle="1"
-                AnimationTime="2"
-                AnimationFrames="0 1 2 3 4 5 6 7 8 9 10 11"/>

+ 0 - 8
toybox/LeapToy/1/assets/images/Digital_Explosion.asset.taml

@@ -1,8 +0,0 @@
-<ImageAsset
-    AssetName="Digital_ExplosionSprite"
-    imageFile="Digital_Explosion.png"
-    cellCountX="4"
-    cellCountY="4"
-    cellWidth="128"
-    cellHeight="128"
-	 />

二進制
toybox/LeapToy/1/assets/images/Digital_Explosion.png


+ 0 - 8
toybox/LeapToy/1/assets/images/Projectile_Digital_Strike.asset.taml

@@ -1,8 +0,0 @@
-<ImageAsset
-    AssetName="Projectile_Digital_StrikeSprite"
-    imageFile="Projectile_Digital_Strike.png"
-    cellCountX="4"
-    cellCountY="4"
-    cellWidth="64"
-    cellHeight="96"
-	 />

二進制
toybox/LeapToy/1/assets/images/Projectile_Digital_Strike.png


+ 0 - 3
toybox/LeapToy/1/assets/images/barrierWall.asset.taml

@@ -1,3 +0,0 @@
-<ImageAsset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../Torque2D.xsd"
-            AssetName="barrierWall"
-            ImageFile="barrierWall.png"/>

二進制
toybox/LeapToy/1/assets/images/barrierWall.png


+ 0 - 3
toybox/LeapToy/1/assets/images/blockGlow.asset.taml

@@ -1,3 +0,0 @@
-<ImageAsset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../Torque2D.xsd"
-            AssetName="blockGlow"
-            ImageFile="blockGlow.png"/>

二進制
toybox/LeapToy/1/assets/images/blockGlow.png


+ 0 - 3
toybox/LeapToy/1/assets/images/circleThree.asset.taml

@@ -1,3 +0,0 @@
-<ImageAsset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../Torque2D.xsd"
-            AssetName="circleThree"
-            ImageFile="circleThree.png"/>

二進制
toybox/LeapToy/1/assets/images/circleThree.png


+ 0 - 3
toybox/LeapToy/1/assets/images/complexCircle.asset.taml

@@ -1,3 +0,0 @@
-<ImageAsset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../Torque2D.xsd"
-            AssetName="complexCircle"
-            ImageFile="complexCircle.png"/>

二進制
toybox/LeapToy/1/assets/images/complexCircle.png


+ 0 - 3
toybox/LeapToy/1/assets/images/menuBackground.asset.taml

@@ -1,3 +0,0 @@
-<ImageAsset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../Torque2D.xsd"
-            AssetName="menuBackground"
-            ImageFile="menuBackground.jpg"/>

二進制
toybox/LeapToy/1/assets/images/menuBackground.jpg


+ 0 - 9
toybox/LeapToy/1/assets/images/objectsBlocks.asset.taml

@@ -1,9 +0,0 @@
-<ImageAsset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../Torque2D.xsd"
-            AssetName="objectsBlocks"
-            ImageFile="objectsBlocks.png"
-            CellCountX="2"
-            CellCountY="4"
-            CellWidth="56"
-            CellHeight="55"
-            CellOffsetY="1"
-            CellOffsetX="1"/>

二進制
toybox/LeapToy/1/assets/images/objectsBlocks.png


+ 0 - 7
toybox/LeapToy/1/assets/images/objectsBricks.asset.taml

@@ -1,7 +0,0 @@
-<ImageAsset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../Torque2D.xsd"
-            AssetName="objectsBricks"
-            ImageFile="objectsBricks.png"
-            CellCountX="2"
-            CellCountY="6"
-            CellWidth="112"
-            CellHeight="64"/>

二進制
toybox/LeapToy/1/assets/images/objectsBricks.png


+ 0 - 3
toybox/LeapToy/1/assets/images/playerUfo.asset.taml

@@ -1,3 +0,0 @@
-<ImageAsset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../Torque2D.xsd"
-            AssetName="playerUfo"
-            ImageFile="playerUfo.png"/>

二進制
toybox/LeapToy/1/assets/images/playerUfo.png


+ 0 - 3
toybox/LeapToy/1/assets/images/simpleCircle.asset.taml

@@ -1,3 +0,0 @@
-<ImageAsset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../Torque2D.xsd"
-            AssetName="simpleCircle"
-            ImageFile="simpleCircle.png"/>

二進制
toybox/LeapToy/1/assets/images/simpleCircle.png


+ 0 - 3
toybox/LeapToy/1/assets/images/widgetBall.asset.taml

@@ -1,3 +0,0 @@
-<ImageAsset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../Torque2D.xsd"
-            AssetName="widgetBall"
-            ImageFile="widgetBall.png"/>

二進制
toybox/LeapToy/1/assets/images/widgetBall.png


+ 0 - 3
toybox/LeapToy/1/assets/images/widgetFruit.asset.taml

@@ -1,3 +0,0 @@
-<ImageAsset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../Torque2D.xsd"
-            AssetName="widgetFruit"
-            ImageFile="widgetFruit.png"/>

二進制
toybox/LeapToy/1/assets/images/widgetFruit.png


+ 0 - 3
toybox/LeapToy/1/assets/images/window.asset.taml

@@ -1,3 +0,0 @@
-<ImageAsset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../Torque2D.xsd"
-            AssetName="window"
-            ImageFile="window.png"/>

二進制
toybox/LeapToy/1/assets/images/window.png


+ 0 - 129
toybox/LeapToy/1/assets/particles/blockFadeParticle.asset.taml

@@ -1,129 +0,0 @@
-<ParticleAsset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../Torque2D.xsd"
-    AssetName="blockFadeParticle"
-    Lifetime="1"
-    LifeMode="KILL">
-    <ParticleAssetEmitter
-        EmitterName="fade"
-        EmitterType="POINT"
-        EmitterSize="2 1"
-        OrientationType="FIXED"
-        FixedForceAngle="0"
-        FixedAspect="0"
-        IntenseParticles="1"
-        SingleParticle="1"
-        AttachPositionToEmitter="0"
-        AttachRotationToEmitter="0"
-        LinkEmissionRotation="0"
-        OldestInFront="0"
-        Image="@asset=LeapToy:blockGlow">
-      <ParticleAssetEmitter.Fields>
-        <Lifetime>
-          <Key Time="0.000000" Value="2.000000"/>
-        </Lifetime>
-        <LifetimeVariation>
-          <Key Time="0.000000" Value="0.000000"/>
-        </LifetimeVariation>
-        <Quantity>
-          <Key Time="0.000000" Value="10.000000"/>
-        </Quantity>
-        <QuantityVariation>
-          <Key Time="0.000000" Value="0.000000"/>
-        </QuantityVariation>
-        <SizeX>
-          <Key Time="0.000000" Value="3.398734"/>
-        </SizeX>
-        <SizeXVariation>
-          <Key Time="0.000000" Value="0.000000"/>
-        </SizeXVariation>
-        <SizeXLife>
-          <Key Time="0.000000" Value="1.000000"/>
-          <Key Time="0.126863" Value="1.141772"/>
-          <Key Time="0.437451" Value="0.946836"/>
-          <Key Time="0.786863" Value="0.556963"/>
-        </SizeXLife>
-        <SizeY>
-          <Key Time="0.000000" Value="1.977848"/>
-        </SizeY>
-        <SizeYVariation>
-          <Key Time="0.000000" Value="0.000000"/>
-        </SizeYVariation>
-        <SizeYLife>
-          <Key Time="0.000000" Value="1.000000"/>
-          <Key Time="0.217451" Value="0.751899"/>
-          <Key Time="0.584118" Value="-0.417721"/>
-          <Key Time="1.000000" Value="-3.202531"/>
-        </SizeYLife>
-        <Speed>
-          <Key Time="0.000000" Value="10.000000"/>
-        </Speed>
-        <SpeedVariation>
-          <Key Time="0.000000" Value="0.000000"/>
-        </SpeedVariation>
-        <SpeedLife>
-          <Key Time="0.000000" Value="1.000000"/>
-        </SpeedLife>
-        <Spin>
-          <Key Time="0.000000" Value="0.000000"/>
-        </Spin>
-        <SpinVariation>
-          <Key Time="0.000000" Value="26.582283"/>
-        </SpinVariation>
-        <SpinLife>
-          <Key Time="0.000000" Value="1.000000"/>
-        </SpinLife>
-        <FixedForce>
-          <Key Time="0.000000" Value="0.000000"/>
-        </FixedForce>
-        <FixedForceVariation>
-          <Key Time="0.000000" Value="0.000000"/>
-        </FixedForceVariation>
-        <FixedForceLife>
-          <Key Time="0.000000" Value="1.000000"/>
-        </FixedForceLife>
-        <RandomMotion>
-          <Key Time="0.000000" Value="0.000000"/>
-        </RandomMotion>
-        <RandomMotionVariation>
-          <Key Time="0.000000" Value="0.000000"/>
-        </RandomMotionVariation>
-        <RandomMotionLife>
-          <Key Time="0.000000" Value="1.000000"/>
-        </RandomMotionLife>
-        <EmissionForce>
-          <Key Time="0.000000" Value="5.000000"/>
-        </EmissionForce>
-        <EmissionForceVariation>
-          <Key Time="0.000000" Value="0.000000"/>
-        </EmissionForceVariation>
-        <EmissionAngle>
-          <Key Time="0.000000" Value="0.000000"/>
-        </EmissionAngle>
-        <EmissionAngleVariation>
-          <Key Time="0.000000" Value="0.000000"/>
-        </EmissionAngleVariation>
-        <EmissionArc>
-          <Key Time="0.000000" Value="360.000000"/>
-        </EmissionArc>
-        <EmissionArcVariation>
-          <Key Time="0.000000" Value="0.000000"/>
-        </EmissionArcVariation>
-        <RedChannel>
-          <Key Time="0.000000" Value="1.000000"/>
-          <Key Time="0.286471" Value="0.625316"/>
-        </RedChannel>
-        <GreenChannel>
-          <Key Time="0.000000" Value="0.799367"/>
-        </GreenChannel>
-        <BlueChannel>
-          <Key Time="0.000000" Value="0.736709"/>
-          <Key Time="0.195882" Value="1.000000"/>
-        </BlueChannel>
-        <AlphaChannel>
-          <Key Time="0.000000" Value="0.200633"/>
-          <Key Time="0.040588" Value="1.000000"/>
-          <Key Time="0.178627" Value="0.409494"/>
-          <Key Time="0.471961" Value="0.000000"/>
-        </AlphaChannel>
-      </ParticleAssetEmitter.Fields>
-    </ParticleAssetEmitter>
-</ParticleAsset>

+ 0 - 69
toybox/LeapToy/1/assets/particles/digitalExplosion.asset.taml

@@ -1,69 +0,0 @@
-<ParticleAsset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../Torque2D.xsd"
-    AssetName="digitalExplosion"
-    Lifetime="1"
-    LifeMode="KILL">
-    <ParticleAssetEmitter
-        EmitterName="debris"
-        EmitterType="BOX"
-        EmitterAngle="90"
-        EmitterSize="2 1"
-		AttachPositionToEmitter="1"
-		AttachRotationToEmitter="1"
-        FixedForceAngle="-90"
-        OldestInFront="1"
-        Image="@asset=ToyAssets:Asteroids"
-        RandomImageFrame="1">
-        <ParticleAssetEmitter.Fields>
-            <Quantity
-                Keys="0 250 0.1 150 0.11 0" />
-            <LifetimeVariation
-                Keys="0 1" />
-            <EmissionArc
-                Keys="0 90" />
-            <Speed
-                Keys="0 1.8" />
-            <SizeXVariation
-                Keys="0 2.1" />
-            <FixedForce
-                Keys="0 8" />
-            <SizeXLife
-                Keys="0 0 0.1 0.1" />
-            <RandomMotion
-                Keys="0 10" />
-            <FixedForceVariation
-                Keys="0 2" />
-            <SpinVariation
-                Keys="0 360" />
-            <SpeedVariation
-                Keys="0 0.3" />
-            <AlphaChannel
-                Keys="0 0 0.1 1 0.8 1 1 0" />
-            <EmissionAngle
-                Keys="0 90" />
-        </ParticleAssetEmitter.Fields>
-    </ParticleAssetEmitter>
-    <ParticleAssetEmitter
-        EmitterName="flames"
-        EmitterType="LINE"
-        EmitterSize="1 0"
-		AttachPositionToEmitter="1"
-		AttachRotationToEmitter="1"		
-        IntenseParticles="1"
-        OldestInFront="1"
-        Animation="@asset=LeapToy:Digital_ExplosionAnimation">
-        <ParticleAssetEmitter.Fields>
-            <Quantity
-                Keys="0 20 0.1 20 0.11 0" />
-            <Lifetime
-                Keys="0 1" />
-            <Speed
-                Keys="0 0" />
-            <SizeXVariation
-                Keys="0 2" />
-            <SizeXLife
-                Keys="0 0 0.1 3" />
-            <AlphaChannel
-                Keys="0 0 0.1 1 0.8 1 1 0" />
-        </ParticleAssetEmitter.Fields>
-    </ParticleAssetEmitter>
-</ParticleAsset>

+ 0 - 79
toybox/LeapToy/1/assets/particles/digitalFire.asset.taml

@@ -1,79 +0,0 @@
-<ParticleAsset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../Torque2D.xsd"
-    AssetName="digitalfire">
-    <ParticleAssetEmitter
-        EmitterName="smoke"
-		EmitterType="line"
-		EmitterSize="0.5 0"
-		EmitterOffset="0 1"
-        FixedForceAngle="90"
-        OldestInFront="1"
-        Image="@asset=ToyAssets:Particles4"
-        Frame="0">
-        <ParticleAssetEmitter.Fields>
-            <Quantity
-                Keys="0 10" />
-			<EmissionAngle
-				Keys="0 90" />								
-			<EmissionArc
-				Keys="0 0" />
-            <LifetimeVariation
-                Keys="0 1" />
-            <Speed
-                Keys="0 0.3" />
-            <SpeedVariation
-                Keys="0 0.1" />
-            <FixedForce
-				Keys="0 0" />				
-            <FixedForceVariation
-                Keys="0 0" />				
-            <SizeXLife>
-				<Key Time="0" Value="0"/>
-				<Key Time="0.2" Value="1"/>
-				<Key Time="0.5" Value="1"/>
-				<Key Time="0.9" Value="1"/>
-				<Key Time="1" Value="0"/>
-			</SizeXLife>
-            <SizeXVariation
-                Keys="0 0.3" />				
-            <SpinVariation
-                Keys="0 360" />				
-            <AlphaChannel
-                Keys="0 0 0.2 0.15 1 0" />
-        </ParticleAssetEmitter.Fields>
-    </ParticleAssetEmitter>		
-    <ParticleAssetEmitter
-        EmitterName="flames"
-        EmitterType="LINE"
-        EmitterSize="1 0"
-        FixedForceAngle="90"
-        IntenseParticles="1"
-        OldestInFront="1"
-        Animation="@asset=LeapToy:Projectile_Digital_StrikeAnimation">
-        <ParticleAssetEmitter.Fields>
-            <Quantity
-                Keys="0 20" />
-            <EmissionArc
-                Keys="0 30" />
-            <Lifetime
-                Keys="0 1" />
-            <Speed
-                Keys="0 0.1" />
-            <SizeXVariation
-                Keys="0 0.2" />
-            <FixedForce
-                Keys="0 30" />
-            <SizeXLife
-                Keys="0 0 0.1 0.5" />
-            <RandomMotion
-                Keys="0 10" />
-            <FixedForceVariation
-                Keys="0 10" />
-            <SpinVariation
-                Keys="0 360" />
-            <AlphaChannel
-                Keys="0 0 0.1 1 0.8 1 1 0" />
-            <EmissionAngle
-                Keys="0 90" />
-        </ParticleAssetEmitter.Fields>
-    </ParticleAssetEmitter>
-</ParticleAsset>

+ 0 - 180
toybox/LeapToy/1/main.cs

@@ -1,180 +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 LeapToy::create( %this )
-{
-    // Execute toy scripts
-    exec("./scripts/input.cs");
-    exec("./scripts/toy.cs");
-    exec("./scripts/gestureDemo.cs");
-    exec("./scripts/breakoutDemo.cs");
-    exec("./scripts/fingerDemo.cs");
-    exec("./scripts/builderDemo.cs");
-    exec("./scripts/helpText.cs");
-    
-    exec("./scripts/DealsDamageBehavior.cs");
-    exec("./scripts/TakesDamageBehavior.cs");
-    exec("./scripts/SwapImageOnCollision.cs");
-
-    %this.handPosDeadzone = "-1.0 1.0";
-    %this.handRotDeadzone = "-1.0 1.0";
-    %this.fingerPosDeadzone = "-1.0 1.0";
-    %this.enableSwipeGesture = false;
-    %this.enableCircleGesture = false;
-    %this.enableScreenTapGesture = false;
-    %this.enableKeyTapGesture = false;
-    %this.enableHandRotation = false;
-    %this.enableFingerTracking = true;
-    %this.currentLevel = "Builder Demo";
-    
-    addFlagOption( "Enable Swipe Gesture", "setEnableSwipeGesture", LeapToy.enableSwipeGesture, false, "Turns on swipe gesture recognition" );
-    addFlagOption( "Enable Circle Gesture", "setEnableCircleGesture", LeapToy.enableCircleGesture, false, "Turns on circle gesture recognition" );
-    addFlagOption( "Enable Screen Tap Gesture", "setEnableScreenTapGesture", LeapToy.enableScreenTapGesture, false, "Turns on screen tap gesture recognition" );
-    addFlagOption( "Enable Key Tap Gesture", "setEnableKeyTapGesture", LeapToy.enableKeyTapGesture, false, "Turns on key tap gesture recognition" );
-    addFlagOption( "Enable Hand Rotation", "setEnableHandRotation", LeapToy.enableHandRotation, false, "Turns on tracking of hand rotation" );
-    addFlagOption( "Enable Finger Tracking", "setenableFingerTracking", LeapToy.enableFingerTracking, false, "Turns on tracking of finger position" );
-    
-    %options = "Gestures,Breakout,Finger Tracking,Builder Demo";
-    addSelectionOption(%options, "Level", 4, setLevel, true, "Choose which Leap Motion Demo to play");
-
-    // Set the sandbox drag mode availability.
-    Sandbox.allowManipulation( pull );
-    
-    // Configure the toy.
-    LeapToy.GroundWidth = 40;
-    LeapToy.BlockSize = 2;
-    LeapToy.BlockCount = 15;
-    LeapToy.BrickRows = 4;
-    LeapToy.BrickColumns = 9;
-    LeapToy.BrickSize = "3 1";
-    LeapToy.PaddleSpeed = 30;
-    LeapToy.maxBallSpeed = 20;
-    LeapToy.fingerCount = 0;
-    
-    // Initialize all bindings
-    %this.initializeInput();
-    
-    // Build the behaviors
-    %this.createDealsDamageBehavior();
-    %this.createTakesDamageBehavior();
-    %this.createSwapImageBehavior();
-    
-    %this.selectedObjects = new SimSet();
-    %this.add(%this.selectedObjects);
-    
-    // Reset the toy.
-    LeapToy.reset();
-}
-
-//-----------------------------------------------------------------------------
-
-function LeapToy::destroy( %this )
-{
-    // Turn off Leap driven cursor control, if it was activated
-    if (isLeapCursorControlled())
-        enableLeapMotionManager(false);
-    
-    %this.selectedObjects.clear();
-    %this.selectedObjects.delete();
-    // Clean up the help text
-    if (isObject(HelpTextScene))
-      HelpTextScene.delete();
-    // Clean up the ActionMaps
-    %this.destroyInput();
-}
-
-//-----------------------------------------------------------------------------
-
-function LeapToy::reset( %this )
-{
-    // Reset the input
-    FingerMap.pop();
-    GestureMap.pop();
-    BreakoutMap.pop();
-    BuilderMap.pop();
-    // Clean up the help text if there is one
-    %this.clearHelpTextScene();    
-      
-     // Clear the scene.
-    SandboxScene.clear();
-    
-    // Set the camera size.
-    SandboxWindow.setCameraSize( 40, 30 );
-
-    if (%this.currentLevel $= "Gestures")
-        %this.createGesturesLevel();
-    else if (%this.currentLevel $= "Breakout")
-        %this.createBreakoutLevel();
-    else if (%this.currentLevel $= "Finger Tracking")
-        %this.createFingerLevel();
-    else if (%this.currentLevel $= "Builder Demo")
-        %this.createBuilderLevel();
-}
-
-//-----------------------------------------------------------------------------
-
-function LeapToy::setLevel( %this, %value)
-{
-    %this.currentLevel = %value;
-}
-
-//-----------------------------------------------------------------------------
-
-function LeapToy::setEnableSwipeGesture( %this, %value )
-{
-    %this.enableSwipeGesture = %value;
-}
-
-//-----------------------------------------------------------------------------
-
-function LeapToy::setEnableCircleGesture( %this, %value )
-{
-    %this.enableCircleGesture = %value;
-}
-
-//-----------------------------------------------------------------------------
-
-function LeapToy::setEnableScreenTapGesture( %this, %value )
-{
-    %this.enableScreenTapGesture = %value;
-}
-
-//-----------------------------------------------------------------------------
-
-function LeapToy::setEnableKeyTapGesture( %this, %value )
-{
-    %this.enableKeyTapGesture = %value;
-}
-
-//-----------------------------------------------------------------------------
-
-function LeapToy::setEnableHandRotation( %this, %value )
-{
-    %this.enableHandRotation = %value;
-}
-
-//-----------------------------------------------------------------------------
-
-function LeapToy::setEnableFingerTracking( %this, %value )
-{
-    %this.enableFingerTracking = %value;
-}

+ 0 - 15
toybox/LeapToy/1/module.taml

@@ -1,15 +0,0 @@
-<ModuleDefinition
-	ModuleId="LeapToy"
-	VersionId="1"
-	Description="Demonstrates Leap Motion device support."
-	Dependencies="ToyAssets=1"
-	Type="toy"
-	ToyCategoryIndex="3"
-	ScriptFile="main.cs"
-	CreateFunction="create"
-	DestroyFunction="destroy">
-        <DeclaredAssets
-            Path="assets"
-            Extension="asset.taml"
-            Recurse="true"/>		
-</ModuleDefinition>

+ 0 - 80
toybox/LeapToy/1/scripts/DealsDamageBehavior.cs

@@ -1,80 +0,0 @@
-//-----------------------------------------------------------------------------
-// Torque
-// Copyright GarageGames, LLC 2013
-//-----------------------------------------------------------------------------
-
-function LeapToy::createDealsDamageBehavior( %this )
-{
-    if (!isObject(DealsDamageBehavior))
-    {
-        %this.DealsDamageBehavior = new BehaviorTemplate(DealsDamageBehavior);
-
-        %this.DealsDamageBehavior.friendlyName = "Deals Damage Advanced";
-        %this.DealsDamageBehavior.behaviorType = "Game";
-        %this.DealsDamageBehavior.description  = "Set the object to deal damage to TakesDamage objects it collides with";
-
-        %this.DealsDamageBehavior.addBehaviorField(strength, "The amount of damage the object deals", int, 10);
-        %this.DealsDamageBehavior.addBehaviorField(deleteOnHit, "Delete the object when it collides", bool, 1);
-        %this.DealsDamageBehavior.addBehaviorField(explodeEffect, "The particle effect to play on collision", asset, "", ParticleAsset);
-
-        %this.add(%this.DealsDamageBehavior);
-    }    
-}
-
-//-----------------------------------------------------------------------------
-
-function DealsDamageBehavior::initialize(%this, %strength, %deleteOnHit, %explodeEffect)
-{
-    %this.strength = %strength;
-    %this.deleteOnHit = %deleteOnHit;
-    %this.explodeEffect = %explodeEffect;
-}
-
-//-----------------------------------------------------------------------------
-
-function DealsDamageBehavior::onBehaviorAdd(%this)
-{
-    %this.owner.collisionCallback = true;
-    %this.owner.collisionActiveSend = true;
-}
-
-//-----------------------------------------------------------------------------
-
-function DealsDamageBehavior::dealDamage(%this, %amount, %victim)
-{
-    %takesDamage = %victim.getBehavior("TakesDamageBehavior");
-
-    if (!isObject(%takesDamage))
-        return;
-   
-    %takesDamage.takeDamage(%amount, %this);
-}
-
-//-----------------------------------------------------------------------------
-
-function DealsDamageBehavior::explode(%this, %position)
-{
-    if (%this.explodeEffect !$= "")
-    {
-        %particlePlayer = new ParticlePlayer();
-        %particlePlayer.BodyType = static;
-        %particlePlayer.SetPosition( %this.owner.getPosition() );
-        %particlePlayer.SceneLayer = %this.owner.getSceneLayer();
-        %particlePlayer.ParticleInterpolation = true;
-        %particlePlayer.Particle = %this.explodeEffect;
-        SandboxScene.add(%particlePlayer);
-    }
-}
-
-//-----------------------------------------------------------------------------
-
-function DealsDamageBehavior::onCollision(%this, %object, %collisionDetails)
-{
-    %this.dealDamage(%this.strength, %object);
-   
-    if (%this.deleteOnHit)
-    {
-        %this.explode(getWords(%contacts, 0, 1));
-        %this.owner.safeDelete();
-    }
-}

+ 0 - 59
toybox/LeapToy/1/scripts/SwapImageOnCollision.cs

@@ -1,59 +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 LeapToy::createSwapImageBehavior( %this )
-{
-    if (!isObject(SwapImageOnCollisionBehavior))
-    {
-        %this.SwapImageBehavior = new BehaviorTemplate(SwapImageOnCollisionBehavior);
-
-        %this.SwapImageBehavior.friendlyName = "Swap Image On Collision";
-        %this.SwapImageBehavior.behaviorType = "Effects";
-        %this.SwapImageBehavior.description  = "Switches the image of an object when it collides";
-
-        %this.SwapImageBehavior.addBehaviorField(image, "The image to swap to", asset, "", ImageAsset);
-        %this.SwapImageBehavior.addBehaviorField(frame, "The frame of the image to swap to", int, 0);
-        %this.add(%this.SwapImageBehavior);
-    }
-}
-
-//-----------------------------------------------------------------------------
-
-function SwapImageOnCollisionBehavior::initialize(%this, %image, %frame)
-{
-    %this.image = %image;
-    %this.frame = %frame;
-}
-
-//-----------------------------------------------------------------------------
-
-function SwapImageOnCollisionBehavior::onBehaviorAdd(%this)
-{
-   %this.owner.collisionCallback = true;
-}
-
-//-----------------------------------------------------------------------------
-
-function SwapImageOnCollisionBehavior::onCollision(%this, %object, %collisionDetails)
-{
-   %this.owner.setImage(%this.image, %this.frame);
-}

+ 0 - 133
toybox/LeapToy/1/scripts/TakesDamageBehavior.cs

@@ -1,133 +0,0 @@
-//-----------------------------------------------------------------------------
-// Torque
-// Copyright GarageGames, LLC 2013
-//-----------------------------------------------------------------------------
-
-function LeapToy::createTakesDamageBehavior( %this )
-{
-    if (!isObject(TakesDamageBehavior))
-    {
-        %this.TakesDamageBehavior = new BehaviorTemplate(TakesDamageBehavior);
-        
-        %this.TakesDamageBehavior.friendlyName = "Takes Damage Advanced";
-        %this.TakesDamageBehavior.behaviorType = "Game";
-        %this.TakesDamageBehavior.description  = "Set the object to take damage from DealsDamage objects that collide with it";
-
-        %this.TakesDamageBehavior.addBehaviorField(health, "The amount of health the object has", int, 10);
-        %this.TakesDamageBehavior.addBehaviorField(lives, "The number of times the object can lose all its health", int, 3);
-        %this.TakesDamageBehavior.addBehaviorField(respawnTime, "The time between death and respawn (seconds)", float, 2.0);
-        %this.TakesDamageBehavior.addBehaviorField(invincibleTime, "The time after spawning before damage is applied (seconds)", float, 1.0);
-        %this.TakesDamageBehavior.addBehaviorField(respawnEffect, "The particle effect to play on spawn", asset, "", ParticleAsset);
-        %this.TakesDamageBehavior.addBehaviorField(explodeEffect, "The particle effect to play on death", asset, "", ParticleAsset);
-        
-        %this.add(%this.TakesDamageBehavior);
-    }    
-}
-
-//-----------------------------------------------------------------------------
-
-function TakesDamageBehavior::initialize(%this, %health, %lives, %respawnTime, %invincibleTime, %respawnEffect, %explodeEffect, %startFrame)
-{
-    %this.health = %health;
-    %this.lives = %lives;
-    %this.respawnTime = %respawnTime;
-    %this.invincibleTime = %invincibleTime;
-    %this.respawnEffect = %respawnEffect;
-    %this.explodeEffect = %explodeEffect;
-    %this.startFrame = %startFrame;
-    %this.startHealth = %this.health;
-}
-
-//-----------------------------------------------------------------------------
-
-function TakesDamageBehavior::onBehaviorAdd( %this )
-{
-    %this.startHealth = %this.health;    
-    %this.owner.collisionCallback = true;
-    %this.spawn();
-}
-
-//-----------------------------------------------------------------------------
-
-function TakesDamageBehavior::takeDamage( %this, %amount, %assailant )
-{
-    if (%this.invincible)
-        return;
-   
-    %this.health -= %amount;
-    
-    if (%this.health <= 0)
-    {
-        // Explode and kill the object
-        %this.explode();
-        %this.kill();
-        return;
-    }
-}
-
-//-----------------------------------------------------------------------------
-
-function TakesDamageBehavior::kill( %this )
-{
-    %this.lives--;
-    
-    if (%this.lives <= 0)
-    {
-        %this.owner.safeDelete();
-        return;
-    }
-
-    %this.invincible = true;
-    %this.owner.visible = false;
-    %this.owner.setCollisionSuppress(true);
-    %this.owner.collisionActiveReceive = false;
-    %this.schedule(%this.respawnTime * 1000, "spawn");
-}
-
-//-----------------------------------------------------------------------------
-
-function TakesDamageBehavior::setVincible(%this)
-{
-    %this.invincible = false;
-}
-
-//-----------------------------------------------------------------------------
-
-function TakesDamageBehavior::spawn( %this )
-{
-    %this.owner.collisionActiveReceive = true;
-    %this.schedule(%this.invincibleTime * 1000, "setVincible");
-    %this.health = %this.startHealth;
-    %this.owner.visible = true;
-    %this.owner.setCollisionSuppress(false);
-    %this.owner.setImageFrame(%this.startFrame);
-    
-    if (%this.respawnEffect !$= "")
-    {
-        %particlePlayer = new ParticlePlayer();
-        %particlePlayer.BodyType = static;
-        %particlePlayer.Size = "10";
-        %particlePlayer.SetPosition( %this.owner.getPosition() );
-        %particlePlayer.SceneLayer = %this.owner.getSceneLayer();
-        %particlePlayer.ParticleInterpolation = true;
-        %particlePlayer.Particle = %this.respawnEffect;
-        SandboxScene.add(%particlePlayer);
-    }
-}
-
-//-----------------------------------------------------------------------------
-
-function TakesDamageBehavior::explode( %this )
-{
-    if (%this.explodeEffect !$= "")
-    {
-        %particlePlayer = new ParticlePlayer();
-        %particlePlayer.BodyType = static;
-        %particlePlayer.SetPosition( %this.owner.getPosition() );
-        %particlePlayer.SceneLayer = %this.owner.getSceneLayer();
-        %particlePlayer.ParticleInterpolation = true;
-        %particlePlayer.Particle = %this.explodeEffect;
-        %particlePlayer.SizeScale = 0.8;
-        SandboxScene.add(%particlePlayer);
-    }
-}

+ 0 - 198
toybox/LeapToy/1/scripts/breakoutDemo.cs

@@ -1,198 +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 LeapToy::createBreakoutLevel( %this )
-{    
-    // Create background.
-    %this.createBackground();
-    
-    // Create the ground.
-    %this.createGround();
-    
-    // Create the breakable bricks
-    %this.createBricks();
-    
-    %this.createPaddle();
-    
-    %this.createBreakOutBall();    
-    
-    // Se the gravity.
-    SandboxScene.setGravity( 0, 0);
-    
-    // Set the manipulation mode.
-    Sandbox.useManipulation( off );
-
-    // Swap action maps
-    GestureMap.pop();
-    FingerMap.pop();
-    BreakoutMap.push();
-    
-    // Create the help text scene
-    %helpText = new SimSet();
-    %helpText.add(new ScriptObject() { Text = "Roll your hand back and forth to control the paddle"; });
-    %helpText.add(new ScriptObject() { Text = " "; });
-    %helpText.add(new ScriptObject() { Text = "When a block is hit twice, it will be destroyed"; });
-    %helpText.add(new ScriptObject() { Text = " "; });
-    %helpText.add(new ScriptObject() { Text = "Press H to return to the demo."; });
-    %this.createHelpTextScene(%helpText);
-    %helpText.delete();
-}
-
-//-----------------------------------------------------------------------------
-
-function LeapToy::createBricks( %this )
-{
-    // Fetch the block count.
-    %brickCount = LeapToy.BrickRows;
-    %brickColumsn = LeapToy.BrickColumns;
-
-    // Sanity!
-    if ( %brickCount < 1 )
-    {
-        echo( "Cannot have a brick count count less than one." );
-        return;
-    }
-
-    // Set the block size.
-    %brickSize = LeapToy.BrickSize;
-
-    // Calculate a block building position.
-    %posx = %brickCount * %brickSize._0 * -1;
-    %posy = 3 + (%brickSize._1 * 0.5) + 3;
-
-    // Build the stack of blocks.
-    for( %stack = 0; %stack < %brickCount; %stack++ )
-    {
-        // Calculate the stack position.
-        %stackIndexCount = %brickCount;
-        
-        %stackX = %posX + ( %stack * %brickSize._0 );
-        %stackY = %posY + ( %stack * %brickSize._1 );
-
-        // Build the stack.
-        for ( %stackIndex = 0; %stackIndex < LeapToy.BrickColumns; %stackIndex++ )
-        {
-            // Calculate the block position.
-            %brickX = (%stackIndex*%brickSize._0)+%posx;
-            %brickY = %stackY;
-            %brickFrames = "0 2 4 6 8 10";
-            %randomNumber = getRandom(0, 5);
-            %frame = getWord(%brickFrames, %randomNumber);
-            
-            // Create the sprite.
-            %obj = new Sprite()
-            {
-                class = "Brick";
-            };            
-            
-            %obj.setPosition( %brickX, %brickY );
-            %obj.setSize( %brickSize );
-            %obj.setBodyType("Kinematic");
-            %obj.setImage( "LeapToy:objectsBricks", %frame );
-            %obj.setDefaultFriction( 1.0 );
-            %obj.createPolygonBoxCollisionShape( %brickSize );
-            %obj.CollisionCallback = true;
-            
-            %takesDamage = %this.TakesDamageBehavior.createInstance();
-            %takesDamage.initialize(20, 100, 10, 0, "", "LeapToy:blockFadeParticle", %frame);
-            
-            %obj.addBehavior(%takesDamage);
-            
-            %swapImage = %this.SwapImageBehavior.createInstance();
-            %swapImage.initialize("LeapToy:objectsBricks", %frame+1);
-            %obj.addBehavior(%swapImage);
-            
-            // Add to the scene.
-            SandboxScene.add( %obj );
-        }
-    }
-}
-
-//-----------------------------------------------------------------------------
-
-function LeapToy::createPaddle(%this)
-{
-    // Create the player paddle
-    %obj = new Sprite();
-    
-    %obj.setPosition( 0, -8);
-    %obj.setSize( 5, 2.5 );
-    %obj.setImage( "LeapToy:playerUfo");
-    %obj.setDefaultFriction( 0 );
-    %obj.createPolygonBoxCollisionShape( 4.8, 2.3);
-    %obj.CollisionCallback = true;
-    %obj.setFixedAngle( true );
-    %this.paddle = %obj;
-    
-    SandboxScene.add(%obj);
-}
-
-//-----------------------------------------------------------------------------
-
-function LeapToy::createBreakoutBall(%this)
-{
-    // Create the ball.
-    %ball = new Sprite()
-    {
-        class = "Ball";
-    };
-    
-    %ball.Position = "5 5";
-    %ball.Size = 2;
-    %ball.Image = "LeapToy:widgetBall";        
-    %ball.setDefaultDensity( 1 );
-    %ball.setDefaultRestitution( 1.0 );
-    %ball.setDefaultFriction(0);
-    %ball.createCircleCollisionShape( 0.8 );
-    %ball.CollisionCallback = true;
-    %ball.setLinearVelocity(-5, 20);
-    %ball.setPosition(-5, -5);
-    
-    %dealsDamage = %this.DealsDamageBehavior.createInstance();
-    %dealsDamage.initialize(10, false, "");
-    %ball.addBehavior(%dealsDamage);    
-    
-    %this.breakoutBall = %ball;
-    
-    // Add to the scene.
-    SandboxScene.add( %ball );
-}
-
-//-----------------------------------------------------------------------------
-
-function Ball::onCollision(%this, %object, %collisionDetails)
-{
-    %xVelocity = %this.getLinearVelocity()._0;
-    %yVelocity = %this.getLinearVelocity()._1;
-    
-    %newXVelocity = mClamp(%xVelocity, (LeapToy.maxBallSpeed*-1), LeapToy.maxBallSpeed);
-    %newYVelocity = mClamp(%yVelocity, (LeapToy.maxBallSpeed*-1), LeapToy.maxBallSpeed);
-    
-    %this.setLinearVelocity(%newXVelocity, %newYVelocity);
-}
-
-//-----------------------------------------------------------------------------
-
-function LeapToy::movePaddle(%this, %speed)
-{
-    %this.paddle.setLinearVelocity(%speed, 0);
-}

+ 0 - 286
toybox/LeapToy/1/scripts/builderDemo.cs

@@ -1,286 +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 LeapToy::createBuilderLevel( %this )
-{
-    // Create background.
-    %this.createBackground();
-
-    // Create the ground.
-    %this.createGround();
-
-    // Create the pyramid.
-    %this.createPyramid();
-
-    // Create circle gesture visual.
-    %this.createCircleSprite();
-
-    // Create circle gesture visual.
-    %this.createBuilderFingers();    
-
-    // Set the gravity.
-    SandboxScene.setGravity( 0, -9.8 );
-
-    // Set the manipulation mode.
-    Sandbox.useManipulation( off );
-
-    // Create the help text scene
-    %helpText = new SimSet();
-    %helpText.add(new ScriptObject() { Text = "Press TAB to toggle between Cursor and Finger control."; });
-    %helpText.add(new ScriptObject() { Text = " "; });
-    %helpText.add(new ScriptObject() { Text = "Finger Control: "; });
-    %helpText.add(new ScriptObject() { Text = "   Reach in to enable finger collision."; });
-    %helpText.add(new ScriptObject() { Text = "   Fingers will turn yellow when collision is enabled."; });
-    %helpText.add(new ScriptObject() { Text = " "; });
-    %helpText.add(new ScriptObject() { Text = "Cursor Control: "; });
-    %helpText.add(new ScriptObject() { Text = "   Key tap creates a new block."; });
-    %helpText.add(new ScriptObject() { Text = "   Circle Gesture selects blocks within the circle."; });
-    %helpText.add(new ScriptObject() { Text = "   Screen Tap deletes the selected blocks."; });
-    %helpText.add(new ScriptObject() { Text = " "; });
-    %helpText.add(new ScriptObject() { Text = "Press H to return to the demo."; });
-    %this.createHelpTextScene(%helpText);
-    %helpText.delete();
-
-    %this.CenterZ = 125;
-
-    // Swap action maps
-    FingerMap.pop();
-    BreakoutMap.pop();
-    GestureMap.pop();
-
-    // Enable builder map
-    BuilderMap.push();
-}
-
-function LeapToy::createBuilderBlock(%this, %position)
-{
-    // Set the block size.
-    %blockSize = LeapToy.BlockSize;
-
-    %blockFrames = "0 2 4 6";
-    %randomNumber = getRandom(0, 4);
-
-    // Create the sprite.
-    %obj = new Sprite()
-    {
-        class = "Block";
-        flipped = false;
-    };
-
-    %obj.setSceneLayer(3);
-    %obj.setPosition( %position.x, %position.y );
-    %obj.setSize( %blockSize );
-    %obj.setImage( "LeapToy:objectsBlocks" );
-    %obj.setImageFrame( getWord(%blockFrames, %randomNumber) );
-    %obj.setDefaultFriction( 1.0 );
-    %obj.createPolygonBoxCollisionShape( %blockSize, %blockSize );
-
-    // Add to the scene.
-    SandboxScene.add( %obj );
-}
-
-
-
-//-----------------------------------------------------------------------------
-// Called when the user makes a circle with their finger(s)
-//
-// %id - Finger ID, based on the order the finger was added to the tracking
-// %progress - How much of the circle has been completed
-// %radius - Radius of the circle created by the user's motion
-// %isClockwise - Toggle based on the direction the user made the circle
-// %state - State of the gesture progress: 1: Started, 2: Updated, 3: Stopped
-function LeapToy::reactToCircleBuilder(%this, %id, %progress, %radius, %isClockwise, %state)
-{
-    if (!%this.enableCircleGesture)
-        return;
-
-    if (isLeapCursorControlled())
-    {
-        if (%progress > 0 && %state == 3)
-        {
-            %this.grabObjectsInCircle();
-            %this.schedule(300, "hideCircleSprite");
-        }
-        else if (%progress > 0 && %state != 3)
-        {
-            %this.showCircleSprite(%radius/5, %isClockwise);
-        }
-    }
-}
-
-//-----------------------------------------------------------------------------
-// Called when the user makes a swipe with their finger(s)
-//
-// %id - Finger ID, based on the order the finger was added to the tracking
-// %state - State of the gesture progress: 1: Started, 2: Updated, 3: Stopped
-// %direction - 3 point vector based on the direction the finger swiped
-// %speed - How fast the user's finger moved. Values will be quite large
-function LeapToy::reactToSwipeBuilder(%this, %id, %state, %direction, %speed)
-{
-    if (!%this.enableSwipeGesture)
-        return;
-}
-
-//-----------------------------------------------------------------------------
-// Called when the user makes a screen tap gesture with their finger(s)
-//
-// %id - Finger ID, based on the order the finger was added to the tracking
-// %position - 3 point vector based on where the finger was located in "Leap Space"
-// %direction - 3 point vector based on the direction the finger motion
-function LeapToy::reactToScreenTapBuilder(%this, %id, %position, %direction)
-{
-    if (!%this.enableScreenTapGesture)
-        return;        
-    
-    %this.deleteSelectedObjects();
-}
-
-//-----------------------------------------------------------------------------
-// Called when the user makes a key tap gesture with their finger(s)
-//
-// %id - Finger ID, based on the order the finger was added to the tracking
-// %position - 3 point vector based on where the finger was located in "Leap Space"
-// %direction - 3 point vector based on the direction the finger tap
-function LeapToy::reactToKeyTapBuilder(%this, %id, %position, %direction)
-{
-    if (!%this.enableKeyTapGesture)
-        return;
-
-    if (isLeapCursorControlled())
-    {       
-       %worldPosition = SandboxWindow.getWorldPoint(Canvas.getCursorPos());
-       %this.createBuilderBlock(%worldPosition);
-    }
-}
-
-//-----------------------------------------------------------------------------
-// Constantly polling callback based on the finger position on a hand
-// %id - Ordered hand ID based on when it was added to the tracking device
-// %position - 3 point vector based on where the finger is located in "Leap Space"
-function LeapToy::trackFingerPosBuilder(%this, %ids, %fingersX, %fingersY, %fingersZ)
-{
-    if (!%this.enableFingerTracking)
-        return;
-
-    for(%i = 0; %i < getWordCount(%ids); %i++)
-    {
-        %id = getWord(%ids, %i);
-        
-        // The next two lines of code use projection. To use intersection
-        // comment out both lines, then uncomment the getPointFromIntersection call.
-        %position = getWord(%fingersX, %i) SPC getWord(%fingersY, %i) SPC getWord(%fingersZ, %i);
-        %screenPosition = getPointFromProjection(%position);
-        
-        // This uses intersection
-        //%screenPosition = getPointFromIntersection(%id);        
-
-        %worldPosition = SandboxWindow.getWorldPoint(%screenPosition);
-        %this.showFingerBuilder(%id, %worldPosition, %position.z);
-    }
-}
-
-//-----------------------------------------------------------------------------
-
-function LeapToy::showFingerBuilder(%this, %id, %worldPosition, %zpos)
-{
-    echo("Finger " SPC %id SPC ":" SPC %worldPosition);
-    
-    %finger = %this.fingers[%id];
-    
-    if (!isObject(%finger))
-        return;
-        
-    if (!%finger.visible)
-    {
-        %finger.visible = true;
-        %finger.setPosition(%worldPosition);
-        %this.movePosition[%id] = %worldPosition;
-    }
-    else
-    {
-       %distance = VectorSub(%finger.getPosition(), %worldPosition);
-       %finger.moveTo(%worldPosition, VectorLen(%distance) * 10, true, false);
-       %this.movePosition[%id] = %worldPosition;
-    }
-    
-    %size = 2;
-    if( %zpos > LeapToy.CenterZ )
-    {
-       %finger.setCollisionSuppress(true);
-       // set the size to be bigger to give the illusion it is in front of the play area
-       %size = (%zpos/LeapToy.CenterZ) * 2;
-       %finger.setBlendColor(1.0, 1.0, 1.0, 0.5);
-    }
-    else
-    {
-       %finger.setCollisionSuppress(false);
-       %finger.setBlendColor("Yellow");
-    }
-    
-    %finger.setSize(%size, %size);
-    %this.schedule(200, "checkFingerBuilder", %id, %worldPosition);
-}
-
-//-----------------------------------------------------------------------------
-
-function LeapToy::checkFingerBuilder(%this, %id, %worldPosition)
-{
-    %finger = %this.fingers[%id];
-    
-    // Likely no activity, since the device is sensitive
-    if (%this.movePosition[%id] $= %worldPosition)
-    {
-        %finger.visible = false;
-        %finger.setCollisionSuppress(true);
-    }
-}
-
-//-----------------------------------------------------------------------------
-
-function LeapToy::createBuilderFingers(%this)
-{
-    for (%i = 0; %i < 10; %i++)
-    {
-        %name = "Finger" @ %i;
-        
-        // Create the circle.
-        %finger = new Sprite();        
-        %finger.setName(%name);
-        %finger.Position = "-10 5";
-        
-        %finger.Size = 2;
-        %finger.Image = "LeapToy:circleThree";
-        %finger.Visible = false; 
-        %finger.createCircleCollisionShape(1.0, "0 0");  
-        %finger.FixedAngle = true;
-        %finger.setDefaultFriction(1.0, true);    
-        %finger.CollisionSuppress = true;
-        %finger.setSceneLayer(0);
-        %finger.setCollisionLayers("1 2 3 4 5");       
-        
-        %this.fingers[%i] = %finger;
-        
-        // Add to the scene.
-        SandboxScene.add( %finger );
-    }
-}
-

+ 0 - 112
toybox/LeapToy/1/scripts/fingerDemo.cs

@@ -1,112 +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 LeapToy::createFingerLevel( %this )
-{
-    // Create background.
-    %this.createBackground();
-    
-    // Create the ground.
-    %this.createGround();
-
-    // Create circles that will track the fingers    
-    %this.createFingerCircles();
-    
-    // Set the gravity.
-    SandboxScene.setGravity( 0, 0);
-    
-    // Set the manipulation mode.
-    Sandbox.useManipulation( off );
-
-    // Swap action maps
-    // Swap action maps
-    GestureMap.pop();
-    BreakoutMap.pop();
-    FingerMap.push();
-    
-    // Create the help text scene
-    %helpText = new SimSet();
-    %helpText.add(new ScriptObject() { Text = "This demo will track pointables."; });
-    %helpText.add(new ScriptObject() { Text = " "; });
-    %helpText.add(new ScriptObject() { Text = "Whenever the Leap Motion device detects a finger"; });    
-    %helpText.add(new ScriptObject() { Text = "or tool, a circle will appear on screen."; });
-    %helpText.add(new ScriptObject() { Text = " "; });
-    %helpText.add(new ScriptObject() { Text = "Press H to return to the demo."; });
-    %this.createHelpTextScene(%helpText);
-    %helpText.delete();
-}
-
-//-----------------------------------------------------------------------------
-
-function LeapToy::createFingerCircles(%this)
-{
-    for (%i = 0; %i < 10; %i++)
-    {
-        %name = "Finger" @ %i;
-        
-        // Create the circle.
-        %circle = new Sprite();        
-        %circle.setName(%name);
-        %circle.Position = "-10 5";
-        %circle.setBodyType("Kinematic");
-        %circle.Size = 5;
-        %circle.Image = "LeapToy:circleThree";
-        %circle.Visible = false;
-        %circle.AngularVelocity = 180;
-        
-        %this.fingers[%i] = %circle;
-        
-        // Add to the scene.
-        SandboxScene.add( %circle );
-    }
-}
-
-//-----------------------------------------------------------------------------
-
-function LeapToy::showFingerCircle(%this, %id, %worldPosition)
-{
-    echo("Finger " SPC %id SPC ":" SPC %worldPosition);
-    
-    %finger = %this.fingers[%id];
-    
-    if (!isObject(%finger))
-        return;
-        
-    if (!%finger.visible)
-    {
-        %finger.visible = true;
-    }
-    
-    %finger.setPosition(%worldPosition);
-    %this.schedule(100, "checkFingerActivity", %id, %worldPosition);
-}
-
-//-----------------------------------------------------------------------------
-
-function LeapToy::checkFingerActivity(%this, %id, %worldPosition)
-{
-    %finger = %this.fingers[%id];
-    
-    // Likely no activity, since the device is sensitive
-    if (%finger.position $= %worldPosition)
-        %finger.visible = false;
-}

+ 0 - 376
toybox/LeapToy/1/scripts/gestureDemo.cs

@@ -1,376 +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 LeapToy::createGesturesLevel( %this )
-{
-    // Create background.
-    %this.createBackground();
-    
-    // Create the ground.
-    %this.createGround();
-
-    // Create the pyramid.
-    %this.createPyramid();
-
-    // Create a ball.
-    %this.createBall();
-
-    // Create circle gesture visual.
-    %this.createCircleSprite();
-    
-    // Make sure no objects are still selected
-    %this.selectedObjects.clear();
-    
-    // Se the gravity.
-    SandboxScene.setGravity( 0, -9.8 );
-        
-    // Set the manipulation mode.
-    Sandbox.useManipulation( pull );
-    
-    // Swap action maps
-    FingerMap.pop();
-    BreakoutMap.pop();
-    GestureMap.push();
-}
-
-//-----------------------------------------------------------------------------
-
-function LeapToy::createPyramid( %this )
-{
-    // Fetch the block count.
-    %blockCount = LeapToy.BlockCount;
-
-    // Sanity!
-    if ( %blockCount < 2 )
-    {
-        echo( "Cannot have a pyramid block count less than two." );
-        return;
-    }
-
-    // Set the block size.
-    %blockSize = LeapToy.BlockSize;
-
-    // Calculate a block building position.
-    %posx = %blockCount * -0.5 * %blockSize;
-    %posy = -8.8 + (%blockSize * 0.5);
-
-    // Build the stack of blocks.
-    for( %stack = 0; %stack < %blockCount; %stack++ )
-    {
-        // Calculate the stack position.
-        %stackIndexCount = %blockCount - (%stack*2);
-        %stackX = %posX + ( %stack * %blockSize );
-        %stackY = %posY + ( %stack * %blockSize );
-
-        // Build the stack.
-        for ( %stackIndex = 0; %stackIndex < %stackIndexCount; %stackIndex++ )
-        {
-            // Calculate the block position.
-            %blockX = %stackX + (%stackIndex*%blockSize);
-            %blockY = %stackY;
-            %blockFrames = "0 2 4 6";
-            %randomNumber = getRandom(0, 4);
-            
-            // Create the sprite.
-            %obj = new Sprite()
-            {
-                class = "Block";
-                flipped = false;
-            };
-            
-            %obj.setSceneLayer(3);
-            %obj.setPosition( %blockX, %blockY );
-            %obj.setSize( %blockSize );
-            %obj.setImage( "LeapToy:objectsBlocks" );
-            %obj.setImageFrame( getWord(%blockFrames, %randomNumber) );
-            %obj.setDefaultFriction( 1.0 );
-            %obj.createPolygonBoxCollisionShape( %blockSize, %blockSize );
-            
-            // Add to the scene.
-            SandboxScene.add( %obj );
-        }
-    }
-}
-
-//-----------------------------------------------------------------------------
-
-function LeapToy::createBall( %this )
-{
-    // Create the ball.
-    %ball = new Sprite();
-    %ball.Position = "5 5";
-    %ball.Size = 4;
-    %ball.Image = "LeapToy:widgetBall";        
-    %ball.setDefaultDensity( 1 );
-    %ball.setDefaultRestitution( 0.5 );
-    %ball.createCircleCollisionShape( 1.8 );
-    %ball.CollisionCallback = true;
-    %this.ball = %ball;
-
-    // Add to the scene.
-    SandboxScene.add( %ball );
-}
-
-//-----------------------------------------------------------------------------
-
-function LeapToy::createCircleSprite( %this )
-{
-    // Create the circle.
-    %circle = new Sprite();
-    %circle.Position = "-10 5";
-    %circle.setBodyType("Kinematic");
-    %circle.Size = 5;
-    %circle.Image = "LeapToy:circleThree";
-    %circle.Visible = false;
-    %circle.AngularVelocity = 180;
-    %this.circleSprite = %circle;
-
-    // Add to the scene.
-    SandboxScene.add( %circle );
-}
-
-//-----------------------------------------------------------------------------
-// This will be callsed when the user makes a circle gesture with a Leap Motion
-//
-// %radius - How large the circle gesture was
-// %isClockwise - True if the motion was clockwise
-function LeapToy::showCircleSprite( %this, %radius, %isClockwise )
-{
-    // If it isn't currently visible, show it
-    if (!%this.circleSprite.visible)
-    {
-        %this.circleSprite.visible = true;
-        
-        // Find out where the cursor is currenty location
-        %worldPosition = SandboxWindow.getWorldPoint(Canvas.getCursorPos());
-        
-        // Move the circle to that spot. This should be where the circle
-        // gesture first started
-        %this.circleSprite.position = %worldPosition;
-    }
-        
-    // Resize the circle based on how big the radius was
-    %this.circleSprite.size = %radius;
-    
-    // Rotate to the right if the circle is clockwise, left otherwise
-    if (%isClockwise)
-        %this.circleSprite.AngularVelocity = -180;
-    else
-        %this.circleSprite.AngularVelocity = 180;
-}
-
-//-----------------------------------------------------------------------------
-// This will be called when the user stops making a circle gesture
-function LeapToy::hideCircleSprite( %this )
-{
-    // Hide the sprite
-    %this.circleSprite.visible = 0;
-}
-
-//-----------------------------------------------------------------------------
-// This will be called when either the hand position or hand rotation is being tracked
-//
-// %horizontalSpeed - How fast to move in the X-axis
-// %verticalSpeed - How fast to move in the Y-axis
-// %angularSpeed - How fast to rotate on the Z-axis
-function LeapToy::accelerateBall( %this, %horizontalSpeed, %verticalSpeed )
-{
-    %this.ball.setLinearVelocity(%horizontalSpeed, %verticalSpeed);
-}
-
-//-----------------------------------------------------------------------------
-// This is called when a user makes a swipe gesture with the Leap Motion
-//
-// %position - Where to spawn the asteroid
-// %direction - 3 point vector based on the direction the finger swiped
-// %speed - How fast the user's finger moved. Values will be quite large
-function LeapToy::createAsteroid( %this, %position, %direction, %speed )
-{
-    // Size of the asteroid.
-    %size = 3;
-    
-    // Reduce the speed of the swipe so it can be used for a reasonable
-    // velocity in T2D.
-    %reducedSpeed = mClamp((%speed / 8), 0, 55);
-    %velocity = vectorScale(%direction, %reducedSpeed);
-
-    // Create an asteroid.
-    %object = new Sprite()
-    {
-        class = "Asteroid";
-    };
-
-    %object.Position = %position;
-    %object.CollisionCallback = true;
-    %object.Size = %size;
-    %object.SceneLayer = 7;
-    %object.Image = "LeapToy:widgetFruit";
-    %object.setDefaultDensity( 3 );
-    %object.createCircleCollisionShape( %size * 0.4 );
-    %object.setLinearVelocity( %velocity._0, %velocity._1 );
-    %object.setAngularVelocity( getRandom(-90,90) );
-    %object.setLifetime( 10 );
-    SandboxScene.add( %object );
-
-    // Create fire trail.
-    %player = new ParticlePlayer();
-    %player.Particle = "LeapToy:digitalFire";
-    %player.Position = %object.Position;
-    %player.EmissionRateScale = 3;
-    %player.SizeScale = 2;
-    %player.SceneLayer = 0;
-    %player.setLifetime( 10 );
-    SandboxScene.add( %player );
-    %jointId = SandboxScene.createRevoluteJoint( %object, %player );
-    SandboxScene.setRevoluteJointLimit( %jointId, 0, 0 );
-
-    // Assign the trail to the asteroid, used for cleanup later
-    %object.Trail = %player;
-}
-
-//-----------------------------------------------------------------------------
-// Called when an object with a class of "Asteroid" collides with another body.
-// In this toy, it will delete the asteroid and create an explosion
-//
-// %object - What the asteroid collided with
-// %collisionDetails - Information about the collision
-function Asteroid::onCollision( %this, %object, %collisionDetails )
-{
-    // Create explosion.
-    %player = new ParticlePlayer();
-    %player.BodyType = static;
-    %player.Particle = "LeapToy:digitalExplosion";
-    %player.Position = %this.Position;
-    %player.SceneLayer = 0;
-    SandboxScene.add( %player );
-
-    %controller = new PointForceController();
-    %controller.setControlLayers( 3 ); // Only affect blocks.
-    %controller.Radius = 5;
-    %controller.Force = -65;
-    %controller.NonLinear = true;
-    %controller.LinearDrag = 0.1;
-    %controller.AngularDrag = 0;
-    SandboxScene.Controllers.add( %controller );
-
-    %controller.Position = %this.Position;
-    %id = %controller.getID();
-
-    // Delete the asteroid.
-    %this.Trail.LinearVelocity = 0;
-    %this.Trail.AngularVelocity = 0;
-    %this.Trail.safeDelete();
-    %this.safeDelete();
-
-    LeapToy.schedule(500, "deleteController", %controller);
-}
-
-//-----------------------------------------------------------------------------
-
-function LeapToy::deleteController(%this, %controller)
-{
-    SandboxScene.Controllers.remove(%controller);
-    %controller.delete();
-}
-
-//-----------------------------------------------------------------------------
-
-function LeapToy::grabObjectsInCircle( %this )
-{
-    %worldPosition = %this.circleSprite.getPosition();
-    %size = %this.circleSprite.getSize();
-
-    %radius = (%size._0 * 0.5);
-    echo("Radius:" SPC %radius);
-
-    %picked = SandboxScene.pickCircle(%worldPosition, %radius);
-
-    // Finish if nothing picked.
-    if ( %picked $= "" )
-        return;
-
-    // Fetch the pick count.
-    %pickCount = %picked.Count;
-
-    for( %n = 0; %n < %pickCount; %n++ )
-    {
-        // Fetch the picked object.
-        %pickedObject = getWord( %picked, %n );
-
-        // Skip if the object is static.
-        if ( %pickedObject.getBodyType() $= "static" || %pickedObject.getBodyType() $= "kinematic")
-            continue;
-        
-        if (%pickedObject.class $= "block")
-            %pickedObject.flipFrame();
-    }
-}
-
-//-----------------------------------------------------------------------------
-
-function Block::flipFrame( %this )
-{
-    %currentFrame = %this.getImageFrame();
-    
-    if (%this.flipped == true)
-    {
-        %newFrame = %currentFrame - 1;
-        %this.flipped = false;
-        LeapToy.selectedObjects.remove(%this);
-    }
-    else
-    {
-        %newFrame = %currentFrame + 1;
-        %this.flipped = true;
-        LeapToy.selectedObjects.add(%this);
-    }
-
-    %this.setImageFrame(%newFrame);
-    
-}
-
-//-----------------------------------------------------------------------------
-
-function LeapToy::createNewBlock( %this )
-{
-    %worldPosition = SandboxWindow.getWorldPoint(Canvas.getCursorPos());
-
-    // Create the sprite.
-    %obj = new Sprite();
-    %obj.setPosition( %worldPosition );
-    %obj.setSize( LeapToy.blockSize );
-    %obj.setImage( "ToyAssets:blocks" );
-    %obj.setImageFrame( getRandom(0,55) );
-    %obj.setDefaultFriction( 1.0 );
-    %obj.createPolygonBoxCollisionShape( LeapToy.blockSize, LeapToy.blockSize );
-
-    // Add to the scene.
-    SandboxScene.add( %obj );
-}
-
-//-----------------------------------------------------------------------------
-
-function LeapToy::deleteSelectedObjects( %this )
-{
-    while (%this.selectedObjects.getCount() > 0)
-        %this.selectedObjects.getObject(0).delete();
-}

+ 0 - 88
toybox/LeapToy/1/scripts/helpText.cs

@@ -1,88 +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 LeapToy::createHelpTextScene(%this, %helptext)
-{
-    %this.clearHelpTextScene();
-      
-    %this.helpTextScene = new Scene(HelpTextScene);
-
-    // Create the background
-    %background = new Sprite();
-    %background.setSize( 40, 30 );
-    %background.setImage("ToyAssets:skyBackground");
-    %background.setSceneLayer(20);
-    HelpTextScene.add(%background);
-    
-    // Check if we have text
-    if (%helptext.getCount() > 0)
-    {
-        %startingy = 0 + ((%helptext.getCount()/2) *0.6);
-        %spacing = 0.75;
-        %textsize = 0.6;
-        
-        // Iterate through the text lines
-        for (%x = 0; %x < %helptext.getCount(); %x++)
-        {                  
-            %object = new ImageFont();         
-            %object.Image = "ToyAssets:Font";
-            %object.FontSize = %textsize SPC %textsize;
-            %object.TextAlignment = "Left";
-            %positiony = %startingy - (%x * %spacing);
-            %object.Position = "-17" SPC %positiony;
-            %object.Text = %helptext.getObject(%x).Text;
-            HelpTextScene.add(%object);
-        }
-        
-        // Since we had text let's put up the help prompt.
-        %helpPrompt = new ImageFont();       
-        %helpPrompt.Image = "ToyAssets:Font";
-        %helpPrompt.FontSize = "0.7 0.7";
-        %helpPrompt.TextAlignment = "Center";      
-        %helpPrompt.Position = "0 -12";
-        %helpPrompt.Text = "Press H for help";
-        SandboxScene.add(%helpPrompt);      
-    }   
-}
-
-function LeapToy::toggleHelpTextScene(%this, %val)
-{
-    if (!isObject(HelpTextScene) || !%val)
-        return;
-
-    if (SandboxWindow.getScene() $= %this.helpTextScene)
-        SandboxWindow.setScene(SandboxScene);    
-    else
-        SandboxWindow.setScene(HelpTextScene);    
-}
-
-function LeapToy::clearHelpTextScene(%this)
-{
-    if (!isObject(HelpTextScene))
-        return;
-
-    if (SandboxWindow.getScene() $= %this.helpTextScene)
-        SandboxWindow.setScene(SandboxScene);    
-
-    HelpTextScene.clear();
-    HelpTextScene.delete();
-}

+ 0 - 315
toybox/LeapToy/1/scripts/input.cs

@@ -1,315 +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 LeapToy::initializeInput( %this )
-{
-    // General toy action map
-    new ActionMap(ToyMap);
-    
-    // Gesture action map for sandbox
-    new ActionMap(GestureMap);
-    
-    // Absolute palm rotation/pos action map for breakout game
-    new ActionMap(BreakoutMap);
-    
-    // Absolute finger positioning for finger demo
-    new ActionMap(FingerMap);
-    
-    // action map for the builder demo game
-    new ActionMap(BuilderMap);
-    
-    // Create keyboard bindings
-    ToyMap.bindObj(keyboard, tab, toggleCursorMode, %this);
-    ToyMap.bindObj(keyboard, escape, showToolBox, %this);
-    // Help text binding
-    ToyMap.bindObj(keyboard, h, toggleHelpTextScene, %this);
-
-    // Debugging keybinds
-    ToyMap.bindObj(keyboard, space, simulateCircle, %this);
-    ToyMap.bindObj(keyboard, x, simulateKeytap, %this);
-    ToyMap.bindObj(keyboard, z, showParticle, %this);    
-    ToyMap.bindObj(keyboard, a, movePaddleLeft, %this);    
-    ToyMap.bindObj(keyboard, d, movePaddleRight, %this);    
-    
-    // Create Leap Motion gesture bindings
-    GestureMap.bindObj(leapdevice, circleGesture, reactToCircleGesture, %this);
-    GestureMap.bindObj(leapdevice, screenTapGesture, reactToScreenTapGesture, %this);
-    GestureMap.bindObj(leapdevice, swipeGesture, reactToSwipeGesture, %this);
-    GestureMap.bindObj(leapdevice, keyTapGesture, reactToKeyTapGesture, %this);
-    
-    // Create the Leap Motion hand/finger bindings
-    BreakoutMap.bindObj(leapdevice, leapHandRot, "D", %this.handRotDeadzone, trackHandRotation, %this);
-    FingerMap.bindObj(leapdevice, leapFingerPos, trackFingerPos, %this);
-    
-   // Create Leap Motion Builder Demo bindings
-    BuilderMap.bindObj(leapdevice, circleGesture, reactToCircleBuilder, %this);
-    BuilderMap.bindObj(leapdevice, screenTapGesture, reactToScreenTapBuilder, %this);
-    BuilderMap.bindObj(leapdevice, swipeGesture, reactToSwipeBuilder, %this);
-    BuilderMap.bindObj(leapdevice, keyTapGesture, reactToKeyTapBuilder, %this);
-    BuilderMap.bindObj(leapdevice, leapFingerPos, trackFingerPosBuilder, %this);
-
-    // Push the LeapMap to the stack, making it active
-    ToyMap.push();
-    
-    // Initialize the Leap Motion manager
-    initLeapMotionManager();
-    enableLeapMotionManager(true);
-    enableLeapCursorControl(true);
-    
-    configureLeapGesture("Gesture.Circle.MinProgress", 1);
-    configureLeapGesture("Gesture.ScreenTap.MinForwardVelocity", 0.1);
-    configureLeapGesture("Gesture.ScreenTap.MinDistance", 0.1);
-    configureLeapGesture("Gesture.KeyTap.MinDownVelocity", 20);
-    configureLeapGesture("Gesture.KeyTap.MinDistance", 1.0);
-}
-
-//-----------------------------------------------------------------------------
-
-function LeapToy::destroyInput(%this)
-{
-    FingerMap.pop();
-    FingerMap.delete();
-    
-    BreakoutMap.pop();
-    BreakoutMap.delete();
-    
-    GestureMap.pop();
-    GestureMap.delete();
-    
-    ToyMap.pop();
-    ToyMap.delete();
-    
-    BuilderMap.pop();
-    BuilderMap.delete();
-}
-
-//-----------------------------------------------------------------------------
-// Called when the user makes a circle with their finger(s)
-//
-// %id - Finger ID, based on the order the finger was added to the tracking
-// %progress - How much of the circle has been completed
-// %radius - Radius of the circle created by the user's motion
-// %isClockwise - Toggle based on the direction the user made the circle
-// %state - State of the gesture progress: 1: Started, 2: Updated, 3: Stopped
-function LeapToy::reactToCircleGesture(%this, %id, %progress, %radius, %isClockwise, %state)
-{
-    if (!%this.enableCircleGesture)
-        return;
-
-    if (%progress > 0 && %state == 3)
-    {
-        %this.grabObjectsInCircle();
-	    %this.schedule(300, "hideCircleSprite");
-    }
-    else if (%progress > 0 && %state != 3)
-    {
-        %this.showCircleSprite(%radius/5, %isClockwise);
-    }
-}
-
-//-----------------------------------------------------------------------------
-// Called when the user makes a swipe with their finger(s)
-//
-// %id - Finger ID, based on the order the finger was added to the tracking
-// %state - State of the gesture progress: 1: Started, 2: Updated, 3: Stopped
-// %direction - 3 point vector based on the direction the finger swiped
-// %speed - How fast the user's finger moved. Values will be quite large
-function LeapToy::reactToSwipeGesture(%this, %id, %state, %direction, %speed)
-{
-    if (!%this.enableSwipeGesture)
-        return;
-
-    %worldPosition = SandboxWindow.getWorldPoint(Canvas.getCursorPos());
-
-    if (isLeapCursorControlled())
-        %worldPosition = "0 0";
-
-    %this.createAsteroid(%worldPosition, %direction, %speed);
-}
-
-//-----------------------------------------------------------------------------
-// Called when the user makes a screen tap gesture with their finger(s)
-//
-// %id - Finger ID, based on the order the finger was added to the tracking
-// %position - 3 point vector based on where the finger was located in "Leap Space"
-// %direction - 3 point vector based on the direction the finger motion
-function LeapToy::reactToScreenTapGesture(%this, %id, %position, %direction)
-{
-    if (!%this.enableScreenTapGesture)
-        return;
-
-    %control = Canvas.getMouseControl();
-    %control.performClick();
-}
-
-//-----------------------------------------------------------------------------
-// Called when the user makes a key tap gesture with their finger(s)
-//
-// %id - Finger ID, based on the order the finger was added to the tracking
-// %position - 3 point vector based on where the finger was located in "Leap Space"
-// %direction - 3 point vector based on the direction the finger tap
-function LeapToy::reactToKeyTapGesture(%this, %id, %position, %direction)
-{
-    if (!%this.enableKeyTapGesture)
-        return;
-
-    %this.deleteSelectedObjects();
-}
-
-//-----------------------------------------------------------------------------
-// Constantly polling callback based on the palm position of a hand
-//
-// %id - Ordered hand ID based on when it was added to the tracking device
-// %position - 3 point vector based on where the hand is located in "Leap Space"
-function LeapToy::trackHandPosition(%this, %id, %position)
-{
-    echo("Hand " @ %id @ " - x:" SPC %position._0 SPC "y:" SPC %position._1 SPC "z:" SPC %position._2);
-}
-
-//-----------------------------------------------------------------------------
-// Constantly polling callback based on the palm rotation of a hand
-//
-// %id - Ordered hand ID based on when it was added to the tracking device
-// %rotation - 3 point vector based on the hand's rotation: "yaw pitch roll"
-function LeapToy::trackHandRotation(%this, %id, %rotation)
-{
-    if (isLeapCursorControlled() || !%this.enableHandRotation)
-        return;
-
-    // Grab the values. Only going to use roll in this demo
-    %roll = %rotation._2;
-
-    %this.movePaddle(%roll*-1);
-}
-
-//-----------------------------------------------------------------------------
-// Constantly polling callback based on the finger position on a hand
-// %id - Ordered hand ID based on when it was added to the tracking device
-// %position - 3 point vector based on where the finger is located in "Leap Space"
-function LeapToy::trackFingerPos(%this, %ids, %fingersX, %fingersY, %fingersZ)
-{
-    if (!%this.enableFingerTracking)
-        return;
-
-    for(%i = 0; %i < getWordCount(%ids); %i++)
-    {
-        %id = getWord(%ids, %i);
-
-        %position = getWord(%fingersX, %i) SPC getWord(%fingersY, %i) SPC getWord(%fingersZ, %i);
-        %screenPosition = getPointFromProjection(%position);
-        //%screenPosition = getPointFromIntersection(%id);
-
-        %worldPosition = SandboxWindow.getWorldPoint(%screenPosition);
-        %this.showFingerCircle(%id, %worldPosition);        
-    }
-}
-
-//-----------------------------------------------------------------------------
-// Flips a switch to activate/deactivate cursor control by the Leap Motion Manager
-function LeapToy::toggleCursorMode( %this, %val )
-{
-    if (!%val)
-        return;
-        
-    if (isLeapCursorControlled())
-        enableLeapCursorControl(false);
-    else
-        enableLeapCursorControl(true);
-}
-
-//-----------------------------------------------------------------------------
-// Shows the Sandbox tool box
-function LeapToy::showToolBox( %this, %val )
-{
-    if (%val)
-        toggleToolbox(true);
-}
-
-//-----------------------------------------------------------------------------
-// DEBUGGING FUNCTIONS
-function LeapToy::simulateCircle( %this, %val)
-{
-    if (%val)
-    {
-        %this.grabObjectsInCircle(2);
-    }
-}
-function LeapToy::simulateKeyTap( %this, %val )
-{
-    if (%val)
-    {
-        %this.deleteSelectedObjects();
-    }
-}
-
-function LeapToy::showParticle(%this)
-{
-    %worldPosition = SandboxWindow.getWorldPoint(Canvas.getCursorPos());
-    
-    %particlePlayer = new ParticlePlayer();
-    %particlePlayer.BodyType = static;
-    %particlePlayer.SetPosition( %worldPosition );
-    %particlePlayer.SceneLayer = 0;
-    %particlePlayer.ParticleInterpolation = true;
-    %particlePlayer.Particle = "LeapToy:blockFadeParticle";
-    %particlePlayer.SizeScale = 1;
-    SandboxScene.add( %particlePlayer ); 
-    %particlePlayer.setLifeTime(3);
-}
-
-function LeapToy::movePaddleLeft(%this, %val)
-{
-    if (%val)
-    {
-        %this.paddle.setLinearVelocity(%this.PaddleSpeed*-1, 0);
-    }
-    else
-    {
-        %this.paddle.setLinearVelocity(0, 0);
-    }
-}
-
-function LeapToy::movePaddleRight(%this, %val)
-{
-    if (%val)
-    {
-        %this.paddle.setLinearVelocity(%this.PaddleSpeed, 0);
-    }
-    else
-    {
-        %this.paddle.setLinearVelocity(0, 0);
-    }
-}
-
-function LeapToy::simulateFingerPositions(%this)
-{
-    %numFingers = getRandom(0, 9);
-    setRandomSeed(-1);
-    %randomPosition = getRandom(-10, 10) SPC getRandom(-10, 10);
-    for (%i = 0; %i < %numFingers; %i++)
-    {
-        %this.showFingerCircle(%i, %randomPosition);
-    }
-}
-
-// DEBUGGING FUNCTIONS
-//-----------------------------------------------------------------------------

+ 0 - 125
toybox/LeapToy/1/scripts/toy.cs

@@ -1,125 +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 LeapToy::createBackground( %this )
-{    
-    // Create the sprite.
-    %background = new Sprite();
-    
-    // Set the sprite as "static" so it is not affected by gravity.
-    %background.setBodyType( static );
-       
-    // Set the position.
-    %background.Position = "0 0";
-
-    // Set the size.        
-    %background.Size = "40 30";
-    
-    // Set to the furthest background layer.
-    %background.SceneLayer = 31;
-    
-    // Set an image.
-    %background.Image = "LeapToy:menuBackground";
-
-    %background.createEdgeCollisionShape( -20, -15, -20, 15 );
-    %background.createEdgeCollisionShape( 20, -15, 20, 15 );
-    %background.createEdgeCollisionShape( -20, 15, 20, 15 );
-
-    // Add the sprite to the scene.
-    SandboxScene.add( %background );
-    
-    %this.createCircles();
-}
-
-//-----------------------------------------------------------------------------
-
-function LeapToy::createCircles( %this )
-{
-    // Create the sprite.
-    %circleOne = new Sprite();
-    %circleTwo = new Sprite();
-    
-    // Set the sprite as "static" so it is not affected by gravity.
-    %circleOne.BodyType = "Kinematic";
-    %circleTwo.BodyType = "Kinematic";
-       
-    // Set the position.
-    %circleOne.Position = "15 10";
-    %circleTwo.Position = "15 10";
-    
-    // Set the size.        
-    %circleOne.Size = "15 15";
-    %circleTwo.Size = "15 15";
-    
-    // Set to the furthest background layer.
-    %circleOne.SceneLayer = 30;
-    %circleTwo.SceneLayer = 30;
-    
-    // Set an image.
-    %circleOne.Image = "LeapToy:complexCircle";
-    %circleTwo.Image = "LeapToy:simpleCircle";
-    
-    %circleOne.AngularVelocity = 15;
-    %circleTwo.AngularVelocity = -15;
-    
-    // Add the sprite to the scene.
-    SandboxScene.add( %circleOne );
-    SandboxScene.add( %circleTwo );
-}
-
-//-----------------------------------------------------------------------------
-
-function LeapToy::createGround( %this )
-{
-    // Create the ground
-    %ground = new Scroller();
-    %ground.setBodyType("static");
-    %ground.Image = "LeapToy:window";
-    %ground.setPosition(0, -12);
-    %ground.SceneLayer = 11;
-    %ground.setSize(LeapToy.GroundWidth, 6);
-    %ground.setRepeatX(LeapToy.GroundWidth / 40);   
-    %ground.createEdgeCollisionShape(LeapToy.GroundWidth/-2, 3, LeapToy.GroundWidth/2, 3);
-    SandboxScene.add(%ground);    
-}
-
-//-----------------------------------------------------------------------------
-// This will be called when the user presses the spacebar
-//
-// %val - Will be true if the event is down, false if it was released
-function LeapToy::pickSprite( %this, %val )
-{
-    // Find out where the cursor is located, then convert to world coordinates
-    %cursorPosition = Canvas.getCursorPos();
-    %worldPosition = SandboxWindow.getWorldPoint(%cursorPosition);
-    
-    // If true, force an onTouchDown for the Sandbox input listener
-    // If false, force an onTouchUp for the Sandbox input listener    
-    if (%val)
-    {
-        Sandbox.InputController.onTouchDown(0, %worldPosition);
-    }
-    else
-    {
-        Sandbox.InputController.onTouchUp(0, %worldPosition);
-    }
-}