1. <things version="1">
  2. <template name="Enemy">
  3. <component type="com.pblabs.box2D.Box2DSpatialComponent" name="Spatial">
  4. <canMove>false</canMove>
  5. <canRotate>false</canRotate>
  6. <collidesWithTypes childType="String">
  7. <_0>Player</_0>
  8. </collidesWithTypes>
  9. <collisionShapes childType="com.pblabs.box2D.CollisionShape">
  10. <_0 type="com.pblabs.box2D.PolygonCollisionShape">
  11. <vertices childType="flash.geom.Point">
  12. <_0 type="">
  13. <x>-1</x>
  14. <y>-1</y>
  15. </_0>
  16. <_1 type="">
  17. <x>1</x>
  18. <y>-1</y>
  19. </_1>
  20. <_2 type="">
  21. <x>1</x>
  22. <y>1</y>
  23. </_2>
  24. <_3 type="">
  25. <x>-1</x>
  26. <y>1</y>
  27. </_3>
  28. </vertices>
  29. </_0>
  30. </collisionShapes>
  31. <collisionType childType="String">
  32. <_0>Enemy</_0>
  33. <_1>Renderable</_1>
  34. </collisionType>
  35. <manager componentReference="SpatialDB"/>
  36. <size type="">
  37. <x>26</x>
  38. <y>26</y>
  39. </size>
  40. </component>
  41. <component type="com.pblabs.rendering2D.SpriteRenderComponent" name="Render">
  42. <positionReference>@Spatial.position</positionReference>
  43. <rotationReference>@Spatial.rotation</rotationReference>
  44. <sizeReference>@Spatial.size</sizeReference>
  45. <spriteSheet type="com.pblabs.rendering2D.SpriteSheetComponent" name="SpriteSheet">
  46. <image filename="../Media/enemy.png"/>
  47. </spriteSheet>
  48. </component>
  49.  
  50. <component type="com.pblabs.rendering2D.AnimationController" name="Animation">
  51. <spriteSheetReference>@Render.spriteSheet</spriteSheetReference>
  52. <currentFrameReference>@Render.spriteIndex</currentFrameReference>
  53. <defaultAnimation>Idle</defaultAnimation>
  54. <animations childType="com.pblabs.rendering2D.AnimationControllerInfo">
  55. <Idle type="">
  56. <frameRate>4</frameRate>
  57. <maxFrameDelay>250</maxFrameDelay>
  58. <loop>true</loop>
  59. <spriteSheet componentReference="EnemySpriteSheet"/>
  60. </Idle>
  61. </animations>
  62. </component>
  63.  
  64. </template>
  65. </things>