1. <things version="1">
  2.  
  3. <template name="Enemy">
  4.  
  5. <component type="com.pblabs.box2D.Box2DSpatialComponent" name="Spatial">
  6.  
  7. <canMove>true</canMove>
  8. <canSleep>false</canSleep>
  9. <canRotate>false</canRotate>
  10. <manager componentReference="SpatialDB"/>
  11.  
  12. <collidesWithTypes childType="String">
  13. <_0>Player</_0>
  14. <_1>PlayerBullet</_1>
  15. <_2>Player</_2>
  16. </collidesWithTypes>
  17.  
  18. <collisionShapes childType="com.pblabs.box2D.CollisionShape">
  19. <_0 type="com.pblabs.box2D.PolygonCollisionShape">
  20. <vertices childType="flash.geom.Point">
  21. <_0 type="">
  22. <x>-1</x>
  23. <y>-1</y>
  24. </_0>
  25. <_1 type="">
  26. <x>1</x>
  27. <y>-1</y>
  28. </_1>
  29. <_2 type="">
  30. <x>1</x>
  31. <y>1</y>
  32. </_2>
  33. <_3 type="">
  34. <x>-1</x>
  35. <y>1</y>
  36. </_3>
  37. </vertices>
  38. </_0>
  39. </collisionShapes>
  40.  
  41. <collisionType childType="String">
  42. <_0>Enemy</_0>
  43. <_1>Renderable</_1>
  44. </collisionType>
  45.  
  46. <size type="">
  47. <x>16</x>
  48. <y>16</y>
  49. </size>
  50.  
  51. </component>
  52.  
  53. <component type="com.pblabs.rendering2D.SpriteRenderComponent" name="Render">
  54. <positionReference>@Spatial.position</positionReference>
  55. <rotationReference>@Spatial.rotation</rotationReference>
  56. <sizeReference>@Spatial.size</sizeReference>
  57. </component>
  58.  
  59. <component type="com.pblabs.rendering2D.AnimationController" name="Animation">
  60. <spriteSheetReference>@Render.spriteSheet</spriteSheetReference>
  61. <currentFrameReference>@Render.spriteIndex</currentFrameReference>
  62. <defaultAnimation>Idle</defaultAnimation>
  63. <animations childType="com.pblabs.rendering2D.AnimationControllerInfo">
  64. <Idle type="">
  65. <frameRate>4</frameRate>
  66. <maxFrameDelay>250</maxFrameDelay>
  67. <loop>true</loop>
  68. <spriteSheet componentReference="Enemy1SpriteSheet"/>
  69. </Idle>
  70. </animations>
  71. </component>
  72.  
  73. <component type="com.pblabs.components.basic.HealthComponent" name="Health">
  74. <maxHealth>1</maxHealth>
  75. </component>
  76.  
  77. <component type="DeathHandlerComponent" name="DeathHandler">
  78. <PositionReference>@Spatial.position</PositionReference>
  79. <entityToCreateOnDeath>Explosion</entityToCreateOnDeath>
  80. </component>
  81.  
  82. <component type="EnemyControllerComponent" name="EnemyController">
  83. <PositionReference>@Spatial.position</PositionReference>
  84. <VelocityReference>@Spatial.linearVelocity</VelocityReference>
  85. </component>
  86.  
  87. <component type="DeathOnContactComponent" name="DeathOnContact">
  88. <deathCollisionTypes childType="String">
  89. <_0>Player</_0>
  90. </deathCollisionTypes>
  91. </component>
  92.  
  93. <component type="DestroyOnLevelClearComponent" name="DestroyOnLevelClear"/>
  94.  
  95. </template>
  96.  
  97. <template name="Player">
  98.  
  99. <component type="com.pblabs.box2D.Box2DSpatialComponent" name="Spatial">
  100.  
  101. <canMove>true</canMove>
  102. <canSleep>false</canSleep>
  103. <canRotate>false</canRotate>
  104. <manager componentReference="SpatialDB"/>
  105.  
  106. <collidesWithTypes childType="String">
  107. <_0>Enemy</_0>
  108. <_0>EnemyBullet</_0>
  109. </collidesWithTypes>
  110.  
  111. <collisionShapes childType="com.pblabs.box2D.CollisionShape">
  112. <_0 type="com.pblabs.box2D.PolygonCollisionShape">
  113. <vertices childType="flash.geom.Point">
  114. <_0 type="">
  115. <x>-1</x>
  116. <y>-1</y>
  117. </_0>
  118. <_1 type="">
  119. <x>1</x>
  120. <y>-1</y>
  121. </_1>
  122. <_2 type="">
  123. <x>1</x>
  124. <y>1</y>
  125. </_2>
  126. <_3 type="">
  127. <x>-1</x>
  128. <y>1</y>
  129. </_3>
  130. </vertices>
  131. </_0>
  132. </collisionShapes>
  133.  
  134. <collisionType childType="String">
  135. <_0>Player</_0>
  136. <_1>Renderable</_1>
  137. </collisionType>
  138.  
  139. <position>
  140. <x>240</x>
  141. <y>352</y>
  142. </position>
  143.  
  144. <size type="">
  145. <x>28</x>
  146. <y>16</y>
  147. </size>
  148.  
  149. </component>
  150.  
  151. <component type="com.pblabs.rendering2D.SpriteRenderComponent" name="Render">
  152. <positionReference>@Spatial.position</positionReference>
  153. <rotationReference>@Spatial.rotation</rotationReference>
  154. <sizeReference>@Spatial.size</sizeReference>
  155. <spriteSheet componentReference="PlayerSpriteSheet"/>
  156. </component>
  157.  
  158. <component type="PlayerControllerComponent" name="PlayerController">
  159. <velocityReference>@Spatial.linearVelocity</velocityReference>
  160. <positionReference>@Spatial.position</positionReference>
  161. <screenWidth>480</screenWidth>
  162. <bulletEntityName>PlayerBullet</bulletEntityName>
  163. <timeBetweenShots>0.5</timeBetweenShots>
  164. </component>
  165.  
  166. <component type="DeathOnContactComponent" name="DeathOnContact">
  167. <deathCollisionTypes childType="String">
  168. <_0>Enemy</_0>
  169. </deathCollisionTypes>
  170. </component>
  171.  
  172. <component type="DeathHandlerComponent" name="DeathHandler">
  173. <PositionReference>@Spatial.position</PositionReference>
  174. <entityToCreateOnDeath>PlayerExplosion</entityToCreateOnDeath>
  175. </component>
  176.  
  177. <component type="DeathHandlerComponent" name="GameOverDeathHandler">
  178. <reposition>false</reposition>
  179. <entityToCreateOnDeath>GameOver</entityToCreateOnDeath>
  180. </component>
  181.  
  182. <component type="com.pblabs.components.basic.HealthComponent" name="Health">
  183. <maxHealth>5</maxHealth>
  184. </component>
  185.  
  186. <component type="DestroyOnLevelClearComponent" name="DestroyOnLevelClear"/>
  187.  
  188. </template>
  189.  
  190. <template name="Bullet">
  191.  
  192. <component type="com.pblabs.box2D.Box2DSpatialComponent" name="Spatial">
  193.  
  194. <canMove>true</canMove>
  195. <canSleep>false</canSleep>
  196. <canRotate>false</canRotate>
  197. <manager componentReference="SpatialDB"/>
  198.  
  199. <collisionShapes childType="com.pblabs.box2D.CollisionShape">
  200. <_0 type="com.pblabs.box2D.PolygonCollisionShape">
  201. <vertices childType="flash.geom.Point">
  202. <_0 type="">
  203. <x>-1</x>
  204. <y>-1</y>
  205. </_0>
  206. <_1 type="">
  207. <x>1</x>
  208. <y>-1</y>
  209. </_1>
  210. <_2 type="">
  211. <x>1</x>
  212. <y>1</y>
  213. </_2>
  214. <_3 type="">
  215. <x>-1</x>
  216. <y>1</y>
  217. </_3>
  218. </vertices>
  219. </_0>
  220. </collisionShapes>
  221.  
  222. <size type="">
  223. <x>6</x>
  224. <y>14</y>
  225. </size>
  226.  
  227. </component>
  228.  
  229. <component type="com.pblabs.rendering2D.SpriteRenderComponent" name="Render">
  230. <positionReference>@Spatial.position</positionReference>
  231. <rotationReference>@Spatial.rotation</rotationReference>
  232. <sizeReference>@Spatial.size</sizeReference>
  233. </component>
  234.  
  235. <component type="com.pblabs.rendering2D.AnimationController" name="Animation">
  236. <spriteSheetReference>@Render.spriteSheet</spriteSheetReference>
  237. <currentFrameReference>@Render.spriteIndex</currentFrameReference>
  238. <defaultAnimation>Idle</defaultAnimation>
  239. <animations childType="com.pblabs.rendering2D.AnimationControllerInfo">
  240. <Idle type="">
  241. <frameRate>6</frameRate>
  242. <maxFrameDelay>1000</maxFrameDelay>
  243. <loop>true</loop>
  244. <spriteSheet componentReference="BulletSpriteSheet"/>
  245. </Idle>
  246. </animations>
  247. </component>
  248.  
  249. <component type="DestroyIfOffScreenComponent" name="DestroyIfOffScreen">
  250. <positionReference>@Spatial.position</positionReference>
  251. <screenWidth>480</screenWidth>
  252. <screenHeight>384</screenHeight>
  253. </component>
  254.  
  255. <component type="DamageOnContactComponent" name="DamageOnContact">
  256. <damage>1</damage>
  257. </component>
  258.  
  259. <component type="DestroyOnLevelClearComponent" name="DestroyOnLevelClear"/>
  260.  
  261. </template>
  262.  
  263. <template name="PlayerBullet" template="Bullet">
  264.  
  265. <component name="Spatial">
  266.  
  267. <collisionType childType="String">
  268. <_0>Renderable</_0>
  269. <_0>PlayerBullet</_0>
  270. </collisionType>
  271.  
  272. <collidesWithTypes childType="String">
  273. <_0>Enemy</_0>
  274. </collidesWithTypes>
  275.  
  276. </component>
  277.  
  278. </template>
  279.  
  280. <template name="EnemyBullet" template="Bullet">
  281.  
  282. <component name="Spatial">
  283.  
  284. <collisionType childType="String">
  285. <_0>Renderable</_0>
  286. <_0>EnemyBullet</_0>
  287. </collisionType>
  288.  
  289. <collidesWithTypes childType="String">
  290. <_0>Player</_0>
  291. </collidesWithTypes>
  292.  
  293. </component>
  294.  
  295. </template>
  296.  
  297. <template name="Explosion">
  298.  
  299. <component type="com.pblabs.rendering2D.SimpleSpatialComponent" name="Spatial">
  300.  
  301. <spatialManager componentReference="SpatialDB"/>
  302.  
  303. <objectMask childType="String">
  304. <_0>Renderable</_0>
  305. </objectMask>
  306.  
  307. </component>
  308.  
  309. <component type="com.pblabs.rendering2D.SpriteRenderComponent" name="Render">
  310. <positionReference>@Spatial.position</positionReference>
  311. </component>
  312.  
  313. <component type="com.pblabs.rendering2D.AnimationController" name="Animation">
  314. <spriteSheetReference>@Render.spriteSheet</spriteSheetReference>
  315. <currentFrameReference>@Render.spriteIndex</currentFrameReference>
  316. <defaultAnimation>Idle</defaultAnimation>
  317. <animations childType="com.pblabs.rendering2D.AnimationControllerInfo">
  318. <Idle type="">
  319. <frameRate>6</frameRate>
  320. <maxFrameDelay>1000</maxFrameDelay>
  321. <loop>false</loop>
  322. <spriteSheet componentReference="ExplosionSpriteSheet"/>
  323. <startEvent>ExplosionStart</startEvent>
  324. <completeEvent>ExplosionComplete</completeEvent>
  325. </Idle>
  326. </animations>
  327. </component>
  328.  
  329. <component type="DestroyAfterCountdownComponent" name="DestroyAfterCountdown">
  330. <TimeToLive>0.5</TimeToLive>
  331. </component>
  332.  
  333. <component type="DestroyOnLevelClearComponent" name="DestroyOnLevelClear"/>
  334.  
  335. </template>
  336.  
  337. <template name="PlayerExplosion">
  338.  
  339. <component type="com.pblabs.rendering2D.SimpleSpatialComponent" name="Spatial">
  340.  
  341. <spatialManager componentReference="SpatialDB"/>
  342.  
  343. <objectMask childType="String">
  344. <_0>Renderable</_0>
  345. </objectMask>
  346.  
  347. </component>
  348.  
  349. <component type="com.pblabs.rendering2D.SpriteRenderComponent" name="Render">
  350. <positionReference>@Spatial.position</positionReference>
  351. </component>
  352.  
  353. <component type="com.pblabs.rendering2D.AnimationController" name="Animation">
  354. <spriteSheetReference>@Render.spriteSheet</spriteSheetReference>
  355. <currentFrameReference>@Render.spriteIndex</currentFrameReference>
  356. <defaultAnimation>Idle</defaultAnimation>
  357. <animations childType="com.pblabs.rendering2D.AnimationControllerInfo">
  358. <Idle type="">
  359. <frameRate>6</frameRate>
  360. <maxFrameDelay>1000</maxFrameDelay>
  361. <loop>false</loop>
  362. <spriteSheet componentReference="PlayerExplosionSpriteSheet"/>
  363. <startEvent>ExplosionStart</startEvent>
  364. <completeEvent>ExplosionComplete</completeEvent>
  365. </Idle>
  366. </animations>
  367. </component>
  368.  
  369. <component type="DestroyAfterCountdownComponent" name="DestroyAfterCountdown">
  370. <TimeToLive>0.5</TimeToLive>
  371. </component>
  372.  
  373. <component type="DestroyOnLevelClearComponent" name="DestroyOnLevelClear"/>
  374.  
  375. </template>
  376.  
  377. <template name="GameOver">
  378.  
  379. <component type="com.pblabs.box2D.Box2DSpatialComponent" name="Spatial">
  380.  
  381. <canMove>false</canMove>
  382. <canSleep>false</canSleep>
  383. <canRotate>false</canRotate>
  384. <manager componentReference="SpatialDB"/>
  385.  
  386. <collisionShapes childType="com.pblabs.box2D.CollisionShape">
  387. <_0 type="com.pblabs.box2D.PolygonCollisionShape">
  388. <vertices childType="flash.geom.Point">
  389. <_0 type="">
  390. <x>-1</x>
  391. <y>-1</y>
  392. </_0>
  393. <_1 type="">
  394. <x>1</x>
  395. <y>-1</y>
  396. </_1>
  397. <_2 type="">
  398. <x>1</x>
  399. <y>1</y>
  400. </_2>
  401. <_3 type="">
  402. <x>-1</x>
  403. <y>1</y>
  404. </_3>
  405. </vertices>
  406. </_0>
  407. </collisionShapes>
  408.  
  409. <collisionType childType="String">
  410. <_0>Renderable</_0>
  411. </collisionType>
  412.  
  413. <position>
  414. <x>240</x>
  415. <y>192</y>
  416. </position>
  417.  
  418. </component>
  419.  
  420. <component type="com.pblabs.rendering2D.SpriteRenderComponent" name="Render">
  421. <positionReference>@Spatial.position</positionReference>
  422. <spriteSheet componentReference="GameOverSpriteSheet"/>
  423. </component>
  424.  
  425. <component type="SwitchLevelComponent" name="SwitchLevel">
  426. <level>0</level>
  427. </component>
  428.  
  429. <component type="DestroyOnLevelClearComponent" name="DestroyOnLevelClear"/>
  430.  
  431. </template>
  432.  
  433. <template name="MainMenu">
  434.  
  435. <component type="com.pblabs.box2D.Box2DSpatialComponent" name="Spatial">
  436.  
  437. <canMove>false</canMove>
  438. <canSleep>false</canSleep>
  439. <canRotate>false</canRotate>
  440. <manager componentReference="SpatialDB"/>
  441.  
  442. <collisionShapes childType="com.pblabs.box2D.CollisionShape">
  443. <_0 type="com.pblabs.box2D.PolygonCollisionShape">
  444. <vertices childType="flash.geom.Point">
  445. <_0 type="">
  446. <x>-1</x>
  447. <y>-1</y>
  448. </_0>
  449. <_1 type="">
  450. <x>1</x>
  451. <y>-1</y>
  452. </_1>
  453. <_2 type="">
  454. <x>1</x>
  455. <y>1</y>
  456. </_2>
  457. <_3 type="">
  458. <x>-1</x>
  459. <y>1</y>
  460. </_3>
  461. </vertices>
  462. </_0>
  463. </collisionShapes>
  464.  
  465. <collisionType childType="String">
  466. <_0>Renderable</_0>
  467. </collisionType>
  468.  
  469. <position>
  470. <x>240</x>
  471. <y>192</y>
  472. </position>
  473.  
  474. </component>
  475.  
  476. <component type="com.pblabs.rendering2D.SpriteRenderComponent" name="Render">
  477. <positionReference>@Spatial.position</positionReference>
  478. <spriteSheet componentReference="MainMenuSpriteSheet"/>
  479. </component>
  480.  
  481. <component type="SwitchLevelComponent" name="SwitchLevel">
  482. <level>1</level>
  483. </component>
  484.  
  485. <component type="DestroyOnLevelClearComponent" name="DestroyOnLevelClear"/>
  486.  
  487. </template>
  488.  
  489. </things>