1. <things version="1">
  2.  
  3. <template name="Enemy">
  4.  
  5. <component type="com.pblabs.box2D.Box2DSpatialComponent" name="Spatial">
  6.  
  7. <canMove>false</canMove>
  8. <canRotate>false</canRotate>
  9. <manager componentReference="SpatialDB"/>
  10.  
  11. <collidesWithTypes childType="String">
  12. <_0>Player</_0>
  13. </collidesWithTypes>
  14.  
  15. <collisionShapes childType="com.pblabs.box2D.CollisionShape">
  16. <_0 type="com.pblabs.box2D.PolygonCollisionShape">
  17. <vertices childType="flash.geom.Point">
  18. <_0 type="">
  19. <x>-1</x>
  20. <y>-1</y>
  21. </_0>
  22. <_1 type="">
  23. <x>1</x>
  24. <y>-1</y>
  25. </_1>
  26. <_2 type="">
  27. <x>1</x>
  28. <y>1</y>
  29. </_2>
  30. <_3 type="">
  31. <x>-1</x>
  32. <y>1</y>
  33. </_3>
  34. </vertices>
  35. </_0>
  36. </collisionShapes>
  37.  
  38. <collisionType childType="String">
  39. <_0>Enemy</_0>
  40. <_1>Renderable</_1>
  41. </collisionType>
  42.  
  43. <size type="">
  44. <x>16</x>
  45. <y>16</y>
  46. </size>
  47.  
  48. </component>
  49.  
  50. <component type="com.pblabs.rendering2D.SpriteRenderComponent" name="Render">
  51. <positionReference>@Spatial.position</positionReference>
  52. <rotationReference>@Spatial.rotation</rotationReference>
  53. <sizeReference>@Spatial.size</sizeReference>
  54. </component>
  55.  
  56. <component type="com.pblabs.rendering2D.AnimationController" name="Animation">
  57. <spriteSheetReference>@Render.spriteSheet</spriteSheetReference>
  58. <currentFrameReference>@Render.spriteIndex</currentFrameReference>
  59. <defaultAnimation>Idle</defaultAnimation>
  60. <animations childType="com.pblabs.rendering2D.AnimationControllerInfo">
  61. <Idle type="">
  62. <frameRate>4</frameRate>
  63. <maxFrameDelay>250</maxFrameDelay>
  64. <loop>true</loop>
  65. <spriteSheet componentReference="Enemy1SpriteSheet"/>
  66. </Idle>
  67. </animations>
  68. </component>
  69.  
  70. </template>
  71.  
  72. <template name="Player">
  73.  
  74. <component type="com.pblabs.box2D.Box2DSpatialComponent" name="Spatial">
  75.  
  76. <canMove>true</canMove>
  77. <canSleep>false</canSleep>
  78. <canRotate>false</canRotate>
  79. <manager componentReference="SpatialDB"/>
  80.  
  81. <collidesWithTypes childType="String">
  82. <_0>Enemy</_0>
  83. </collidesWithTypes>
  84.  
  85. <collisionShapes childType="com.pblabs.box2D.CollisionShape">
  86. <_0 type="com.pblabs.box2D.PolygonCollisionShape">
  87. <vertices childType="flash.geom.Point">
  88. <_0 type="">
  89. <x>-1</x>
  90. <y>-1</y>
  91. </_0>
  92. <_1 type="">
  93. <x>1</x>
  94. <y>-1</y>
  95. </_1>
  96. <_2 type="">
  97. <x>1</x>
  98. <y>1</y>
  99. </_2>
  100. <_3 type="">
  101. <x>-1</x>
  102. <y>1</y>
  103. </_3>
  104. </vertices>
  105. </_0>
  106. </collisionShapes>
  107.  
  108. <collisionType childType="String">
  109. <_0>Player</_0>
  110. <_1>Renderable</_1>
  111. </collisionType>
  112.  
  113. <position>
  114. <x>240</x>
  115. <y>352</y>
  116. </position>
  117.  
  118. <size type="">
  119. <x>28</x>
  120. <y>16</y>
  121. </size>
  122.  
  123. </component>
  124.  
  125. <component type="com.pblabs.rendering2D.SpriteRenderComponent" name="Render">
  126. <positionReference>@Spatial.position</positionReference>
  127. <rotationReference>@Spatial.rotation</rotationReference>
  128. <sizeReference>@Spatial.size</sizeReference>
  129. <spriteSheet componentReference="PlayerSpriteSheet"/>
  130. </component>
  131.  
  132. <component type="PlayerControllerComponent" name="PlayerController">
  133. <velocityReference>@Spatial.linearVelocity</velocityReference>
  134. <positionReference>@Spatial.position</positionReference>
  135. <screenWidth>480</screenWidth>
  136. </component>
  137.  
  138. </template>
  139.  
  140. </things>