- <things version="1">
-
- <template name="Enemy">
-
- <component type="com.pblabs.box2D.Box2DSpatialComponent" name="Spatial">
-
- <canMove>true</canMove>
- <canSleep>false</canSleep>
- <canRotate>false</canRotate>
- <manager componentReference="SpatialDB"/>
-
- <collidesWithTypes childType="String">
- <_0>Player</_0>
- <_1>PlayerBullet</_1>
- <_2>Player</_2>
- </collidesWithTypes>
-
- <collisionShapes childType="com.pblabs.box2D.CollisionShape">
- <_0 type="com.pblabs.box2D.PolygonCollisionShape">
- <vertices childType="flash.geom.Point">
- <_0 type="">
- <x>-1</x>
- <y>-1</y>
- </_0>
- <_1 type="">
- <x>1</x>
- <y>-1</y>
- </_1>
- <_2 type="">
- <x>1</x>
- <y>1</y>
- </_2>
- <_3 type="">
- <x>-1</x>
- <y>1</y>
- </_3>
- </vertices>
- </_0>
- </collisionShapes>
-
- <collisionType childType="String">
- <_0>Enemy</_0>
- <_1>Renderable</_1>
- </collisionType>
-
- <size type="">
- <x>16</x>
- <y>16</y>
- </size>
-
- </component>
-
- <component type="com.pblabs.rendering2D.SpriteRenderComponent" name="Render">
- <positionReference>@Spatial.position</positionReference>
- <rotationReference>@Spatial.rotation</rotationReference>
- <sizeReference>@Spatial.size</sizeReference>
- </component>
-
- <component type="com.pblabs.rendering2D.AnimationController" name="Animation">
- <spriteSheetReference>@Render.spriteSheet</spriteSheetReference>
- <currentFrameReference>@Render.spriteIndex</currentFrameReference>
- <defaultAnimation>Idle</defaultAnimation>
- <animations childType="com.pblabs.rendering2D.AnimationControllerInfo">
- <Idle type="">
- <frameRate>4</frameRate>
- <maxFrameDelay>250</maxFrameDelay>
- <loop>true</loop>
- <spriteSheet componentReference="Enemy1SpriteSheet"/>
- </Idle>
- </animations>
- </component>
-
- <component type="com.pblabs.components.basic.HealthComponent" name="Health">
- <maxHealth>1</maxHealth>
- </component>
-
- <component type="DeathHandlerComponent" name="DeathHandler">
- <PositionReference>@Spatial.position</PositionReference>
- <entityToCreateOnDeath>Explosion</entityToCreateOnDeath>
- </component>
-
- <component type="EnemyControllerComponent" name="EnemyController">
- <PositionReference>@Spatial.position</PositionReference>
- <VelocityReference>@Spatial.linearVelocity</VelocityReference>
- </component>
-
- <component type="DeathOnContactComponent" name="DeathOnContact">
- <deathCollisionTypes childType="String">
- <_0>Player</_0>
- </deathCollisionTypes>
- </component>
-
- </template>
-
- <template name="Player">
-
- <component type="com.pblabs.box2D.Box2DSpatialComponent" name="Spatial">
-
- <canMove>true</canMove>
- <canSleep>false</canSleep>
- <canRotate>false</canRotate>
- <manager componentReference="SpatialDB"/>
-
- <collidesWithTypes childType="String">
- <_0>Enemy</_0>
- </collidesWithTypes>
-
- <collisionShapes childType="com.pblabs.box2D.CollisionShape">
- <_0 type="com.pblabs.box2D.PolygonCollisionShape">
- <vertices childType="flash.geom.Point">
- <_0 type="">
- <x>-1</x>
- <y>-1</y>
- </_0>
- <_1 type="">
- <x>1</x>
- <y>-1</y>
- </_1>
- <_2 type="">
- <x>1</x>
- <y>1</y>
- </_2>
- <_3 type="">
- <x>-1</x>
- <y>1</y>
- </_3>
- </vertices>
- </_0>
- </collisionShapes>
-
- <collisionType childType="String">
- <_0>Player</_0>
- <_1>Renderable</_1>
- </collisionType>
-
- <position>
- <x>240</x>
- <y>352</y>
- </position>
-
- <size type="">
- <x>28</x>
- <y>16</y>
- </size>
-
- </component>
-
- <component type="com.pblabs.rendering2D.SpriteRenderComponent" name="Render">
- <positionReference>@Spatial.position</positionReference>
- <rotationReference>@Spatial.rotation</rotationReference>
- <sizeReference>@Spatial.size</sizeReference>
- <spriteSheet componentReference="PlayerSpriteSheet"/>
- </component>
-
- <component type="PlayerControllerComponent" name="PlayerController">
- <velocityReference>@Spatial.linearVelocity</velocityReference>
- <positionReference>@Spatial.position</positionReference>
- <screenWidth>480</screenWidth>
- <bulletEntityName>PlayerBullet</bulletEntityName>
- <timeBetweenShots>0.5</timeBetweenShots>
- </component>
-
- <component type="DeathOnContactComponent" name="DeathOnContact">
- <deathCollisionTypes childType="String">
- <_0>Enemy</_0>
- </deathCollisionTypes>
- </component>
-
- <component type="DeathHandlerComponent" name="DeathHandler">
- <PositionReference>@Spatial.position</PositionReference>
- <entityToCreateOnDeath>PlayerExplosion</entityToCreateOnDeath>
- </component>
-
- </template>
-
- <template name="Bullet">
-
- <component type="com.pblabs.box2D.Box2DSpatialComponent" name="Spatial">
-
- <canMove>true</canMove>
- <canSleep>false</canSleep>
- <canRotate>false</canRotate>
- <manager componentReference="SpatialDB"/>
-
- <collisionShapes childType="com.pblabs.box2D.CollisionShape">
- <_0 type="com.pblabs.box2D.PolygonCollisionShape">
- <vertices childType="flash.geom.Point">
- <_0 type="">
- <x>-1</x>
- <y>-1</y>
- </_0>
- <_1 type="">
- <x>1</x>
- <y>-1</y>
- </_1>
- <_2 type="">
- <x>1</x>
- <y>1</y>
- </_2>
- <_3 type="">
- <x>-1</x>
- <y>1</y>
- </_3>
- </vertices>
- </_0>
- </collisionShapes>
-
- <size type="">
- <x>6</x>
- <y>14</y>
- </size>
-
- </component>
-
- <component type="com.pblabs.rendering2D.SpriteRenderComponent" name="Render">
- <positionReference>@Spatial.position</positionReference>
- <rotationReference>@Spatial.rotation</rotationReference>
- <sizeReference>@Spatial.size</sizeReference>
- </component>
-
- <component type="com.pblabs.rendering2D.AnimationController" name="Animation">
- <spriteSheetReference>@Render.spriteSheet</spriteSheetReference>
- <currentFrameReference>@Render.spriteIndex</currentFrameReference>
- <defaultAnimation>Idle</defaultAnimation>
- <animations childType="com.pblabs.rendering2D.AnimationControllerInfo">
- <Idle type="">
- <frameRate>6</frameRate>
- <maxFrameDelay>1000</maxFrameDelay>
- <loop>true</loop>
- <spriteSheet componentReference="BulletSpriteSheet"/>
- </Idle>
- </animations>
- </component>
-
- <component type="DestroyIfOffScreenComponent" name="DestroyIfOffScreen">
- <positionReference>@Spatial.position</positionReference>
- <screenWidth>480</screenWidth>
- <screenHeight>384</screenHeight>
- </component>
-
- <component type="DamageOnContactConponent" name="DamageOnContact">
- <damage>1</damage>
- </component>
-
- </template>
-
- <template name="PlayerBullet" template="Bullet">
-
- <component name="Spatial">
-
- <collisionType childType="String">
- <_0>Renderable</_0>
- <_0>PlayerBullet</_0>
- </collisionType>
-
- <collidesWithTypes childType="String">
- <_0>Enemy</_0>
- </collidesWithTypes>
-
- </component>
-
- </template>
-
- <template name="Explosion">
-
- <component type="com.pblabs.rendering2D.SimpleSpatialComponent" name="Spatial">
-
- <spatialManager componentReference="SpatialDB"/>
-
- <objectMask childType="String">
- <_0>Renderable</_0>
- </objectMask>
-
- </component>
-
- <component type="com.pblabs.rendering2D.SpriteRenderComponent" name="Render">
- <positionReference>@Spatial.position</positionReference>
- </component>
-
- <component type="com.pblabs.rendering2D.AnimationController" name="Animation">
- <spriteSheetReference>@Render.spriteSheet</spriteSheetReference>
- <currentFrameReference>@Render.spriteIndex</currentFrameReference>
- <defaultAnimation>Idle</defaultAnimation>
- <animations childType="com.pblabs.rendering2D.AnimationControllerInfo">
- <Idle type="">
- <frameRate>6</frameRate>
- <maxFrameDelay>1000</maxFrameDelay>
- <loop>false</loop>
- <spriteSheet componentReference="ExplosionSpriteSheet"/>
- <startEvent>ExplosionStart</startEvent>
- <completeEvent>ExplosionComplete</completeEvent>
- </Idle>
- </animations>
- </component>
-
- <component type="DestroyAfterCountdownComponent" name="DestroyAfterCountdown">
- <TimeToLive>0.5</TimeToLive>
- </component>
-
- </template>
-
- <template name="PlayerExplosion">
-
- <component type="com.pblabs.rendering2D.SimpleSpatialComponent" name="Spatial">
-
- <spatialManager componentReference="SpatialDB"/>
-
- <objectMask childType="String">
- <_0>Renderable</_0>
- </objectMask>
-
- </component>
-
- <component type="com.pblabs.rendering2D.SpriteRenderComponent" name="Render">
- <positionReference>@Spatial.position</positionReference>
- </component>
-
- <component type="com.pblabs.rendering2D.AnimationController" name="Animation">
- <spriteSheetReference>@Render.spriteSheet</spriteSheetReference>
- <currentFrameReference>@Render.spriteIndex</currentFrameReference>
- <defaultAnimation>Idle</defaultAnimation>
- <animations childType="com.pblabs.rendering2D.AnimationControllerInfo">
- <Idle type="">
- <frameRate>6</frameRate>
- <maxFrameDelay>1000</maxFrameDelay>
- <loop>false</loop>
- <spriteSheet componentReference="PlayerExplosionSpriteSheet"/>
- <startEvent>ExplosionStart</startEvent>
- <completeEvent>ExplosionComplete</completeEvent>
- </Idle>
- </animations>
- </component>
-
- <component type="DestroyAfterCountdownComponent" name="DestroyAfterCountdown">
- <TimeToLive>0.5</TimeToLive>
- </component>
-
- </template>
-
- </things>