Advertisement
Guest User

Untitled

a guest
Jul 17th, 2017
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.62 KB | None | 0 0
  1. <things version="1">
  2.  
  3. <entity name="Scene">
  4. <component type="com.pblabs.rendering2D.DisplayObjectScene" name="DisplayObjectScene">
  5. <position>
  6. <x>0</x>
  7. <y>225</y>
  8. </position>
  9. <!-- niet meer nodig <spacialDatabase componentReference="SceneDB" componentName="Box2dManager" /> -->
  10. <sceneView type="com.pblabs.rendering2D.ui.SceneView">
  11. <width>900</width>
  12. <height>500</height>
  13. <x>0</x>
  14. <y>0</y>
  15. </sceneView>
  16. </component>
  17. </entity>
  18.  
  19. <entity name="Background">
  20. <component type="com.pblabs.rendering2D.SimpleSpatialComponent" name="Spatial">
  21. <position>
  22. <x>0</x>
  23. <y>0</y>
  24. </position>
  25. <size>
  26. <x>900</x>
  27. <y>500</y>
  28. </size>
  29. <spatialManager componentReference="SceneDB"/>
  30. </component>
  31. <component type="com.pblabs.rendering2D.SpriteRenderer" name="Render">
  32. <scene componentReference="Scene"/>
  33. <fileName>assets/bg.png</fileName>
  34. <zIndex>-1</zIndex>
  35. </component>
  36. </entity>
  37.  
  38. <!-- moet geen box2d eigenschappen hebben dus in gewone scene -->
  39. <entity name="PlatformSpriteSheet">
  40. <component name="SpriteSheet" type="com.pblabs.rendering2D.spritesheet.SpriteSheetComponent" >
  41. <imageFilename>assets/platform.png</imageFilename>
  42. </component>
  43. </entity>
  44.  
  45. <entity name="PlatformSpriteSheet2">
  46. <component name="SpriteSheet" type="com.pblabs.rendering2D.spritesheet.SpriteSheetComponent" >
  47. <imageFilename>assets/platform3.png</imageFilename>
  48. </component>
  49. </entity>
  50.  
  51. <entity name="GoalSpriteSheet">
  52. <component name="SpriteSheet" type="com.pblabs.rendering2D.spritesheet.SpriteSheetComponent" >
  53. <imageFilename>assets/lvlgoal.png</imageFilename>
  54. </component>
  55. </entity>
  56.  
  57. <template name="Platform">
  58. <component type="com.pblabs.box2D.Box2DSpatialComponent" name="SpatialPlatform">
  59. <spatialManager componentReference="SceneDB" />
  60. <collisionType>
  61. <type>Platform</type>
  62. </collisionType>
  63. <collidesWithTypes>
  64. <type>Player</type>
  65. <type>Enemy</type>
  66. </collidesWithTypes>
  67. <size>
  68. <x>256</x>
  69. <y>16</y>
  70. </size>
  71. <canMove>false</canMove>
  72. <canSleep>true</canSleep>
  73. <canRotate>false</canRotate>
  74. <collisionShapes>
  75. <shape type="com.pblabs.box2D.PolygonCollisionShape">
  76. <!-- Array van Points (vertices) -->
  77. <vertices childType="flash.geom.Point">
  78. <_><x>-1</x><y>-1</y></_>
  79. <_><x>1</x><y>-1</y></_>
  80. <_><x>1</x><y>1</y></_>
  81. <_><x>-1</x><y>1</y></_>
  82. </vertices>
  83. <friction>1</friction>
  84. </shape>
  85. </collisionShapes>
  86. </component>
  87. </template>
  88.  
  89. <template name="Goal">
  90. <component type="com.pblabs.box2D.Box2DSpatialComponent" name="SpatialGoal">
  91. <spatialManager componentReference="SceneDB" />
  92. <collisionType>
  93. <type>Goal</type>
  94. </collisionType>
  95. <collidesWithTypes>
  96. <type>Player</type>
  97. </collidesWithTypes>
  98. <size>
  99. <x>38</x>
  100. <y>38</y>
  101. </size>
  102. <canMove>false</canMove>
  103. <canSleep>false</canSleep>
  104. <canRotate>false</canRotate>
  105. <collisionShapes childType="com.pblabs.box2D.CollisionShape">
  106. <Shape type="com.pblabs.box2D.CircleCollisionShape">
  107. <radius>0.6</radius>
  108. </Shape>
  109. </collisionShapes>
  110. </component>
  111. </template>
  112.  
  113. <entity name="Platform1" template="Platform">
  114. <!-- kan alle eigenschappen overschrijven van template -->
  115. <component type="com.pblabs.rendering2D.SpriteSheetRenderer" name="Render">
  116. <scene componentReference="Scene" />
  117. <spriteSheet componentReference="PlatformSpriteSheet2" />
  118. <positionProperty>@SpatialPlatform.position</positionProperty>
  119. <rotationProperty>@SpatialPlatform.rotation</rotationProperty>
  120. <sizeProperty>@SpatialPlatform.size</sizeProperty>
  121. </component>
  122. <component name="SpatialPlatform">
  123. <size>
  124. <x>900</x>
  125. <y>50</y>
  126. </size>
  127. <position>
  128. <x>0</x>
  129. <y>225</y>
  130. </position>
  131. </component>
  132. </entity>
  133.  
  134. <entity name="Platform2" template="Platform">
  135. <!-- kan alle eigenschappen overschrijven van template -->
  136. <component type="com.pblabs.rendering2D.SpriteSheetRenderer" name="Render">
  137. <scene componentReference="Scene" />
  138. <spriteSheet componentReference="PlatformSpriteSheet2" />
  139. <positionProperty>@SpatialPlatform.position</positionProperty>
  140. <rotationProperty>@SpatialPlatform.rotation</rotationProperty>
  141. <sizeProperty>@SpatialPlatform.size</sizeProperty>
  142. </component>
  143. <component name="SpatialPlatform">
  144. <size>
  145. <x>100</x>
  146. <y>20</y>
  147. </size>
  148. <position>
  149. <x>0</x>
  150. <y>0</y>
  151. </position>
  152. </component>
  153. </entity>
  154.  
  155. <entity name="IdleRightSpriteSheet">
  156. <component name="SpriteSheet" type="com.pblabs.rendering2D.spritesheet.SpriteSheetComponent">
  157. <imageFilename>assets/idleright.png</imageFilename>
  158. <divider type="com.pblabs.rendering2D.spritesheet.CellCountDivider">
  159. <xCount>6</xCount>
  160. </divider>
  161. </component>
  162. </entity>
  163. <entity name="IdleLeftSpriteSheet">
  164. <component name="SpriteSheet" type="com.pblabs.rendering2D.spritesheet.SpriteSheetComponent">
  165. <imageFilename>assets/idleleft.png</imageFilename>
  166. <divider type="com.pblabs.rendering2D.spritesheet.CellCountDivider">
  167. <xCount>6</xCount>
  168. </divider>
  169. </component>
  170. </entity>
  171.  
  172. <entity name="RunLeftSpriteSheet">
  173. <component name="SpriteSheet" type="com.pblabs.rendering2D.spritesheet.SpriteSheetComponent">
  174. <imageFilename>assets/runleft.png</imageFilename>
  175. <divider type="com.pblabs.rendering2D.spritesheet.CellCountDivider">
  176. <xCount>12</xCount>
  177. </divider>
  178. </component>
  179. </entity>
  180. <entity name="RunRightSpriteSheet">
  181. <component name="SpriteSheet" type="com.pblabs.rendering2D.spritesheet.SpriteSheetComponent">
  182. <imageFilename>assets/runright.png</imageFilename>
  183. <divider type="com.pblabs.rendering2D.spritesheet.CellCountDivider">
  184. <xCount>12</xCount>
  185. </divider>
  186. </component>
  187. </entity>
  188.  
  189. <entity name="EnemySpriteSheet">
  190. <component type="com.pblabs.rendering2D.spritesheet.SpriteSheetComponent" name="SpriteSheet">
  191. <image filename="assets/monster.png"/>
  192. <divider type="com.pblabs.rendering2D.spritesheet.CellCountDivider">
  193. <xCount>2</xCount>
  194. <yCount>1</yCount>
  195. </divider>
  196. </component>
  197. </entity>
  198.  
  199.  
  200. <entity name="Player">
  201. <component type="com.pblabs.rendering2D.SpriteSheetRenderer" name="RenderPlayer">
  202. <scene componentReference="Scene" />
  203. <positionProperty>@SpatialPlayer.position</positionProperty>
  204. <rotationProperty>@SpatialPlayer.rotation</rotationProperty>
  205. <sizeProperty>@SpatialPlayer.size</sizeProperty>
  206. </component>
  207. <component type="com.pblabs.box2D.Box2DSpatialComponent" name="SpatialPlayer">
  208. <spatialManager componentReference="SceneDB" />
  209. <collisionType>
  210. <type>Player</type>
  211. </collisionType>
  212. <collidesWithTypes>
  213. <type>Platform</type>
  214. <type>Enemy</type>
  215. <type>Goal</type>
  216. </collidesWithTypes>
  217. <size>
  218. <x>43</x>
  219. <y>48</y>
  220. </size>
  221. <position>
  222. <x>-400</x>
  223. <y>200</y>
  224. </position>
  225. <canSleep>false</canSleep>
  226. <canRotate>false</canRotate>
  227. <collisionShapes>
  228. <shape type="com.pblabs.box2D.PolygonCollisionShape">
  229. <!-- Array van Points (vertices) -->
  230. <vertices childType="flash.geom.Point">
  231. <_><x>-0.65</x><y>-0.9</y></_>
  232. <_><x>0.65</x><y>-0.9</y></_>
  233. <_><x>0.65</x><y>0.9</y></_>
  234. <_><x>-0.65</x><y>0.9</y></_>
  235. </vertices>
  236. <friction>1</friction>
  237. </shape>
  238. </collisionShapes>
  239. </component>
  240. <!-- zorgt voor animatie -->
  241. <component type="com.pblabs.rendering2D.AnimationController" name="Animation">
  242. <spriteSheetReference>@RenderPlayer.spriteSheet</spriteSheetReference>
  243. <currentFrameReference>@RenderPlayer.spriteIndex</currentFrameReference>
  244. <defaultAnimation>IdleRight</defaultAnimation>
  245. <changeAnimationEvent>PlayerAnimation</changeAnimationEvent>
  246. <currentAnimationReference>@KeyboardController.currentAnimation</currentAnimationReference>
  247. <animations childType="com.pblabs.rendering2D.AnimationControllerInfo">
  248. <IdleRight>
  249. <frameRate>12</frameRate>
  250. <loop>true</loop>
  251. <spriteSheet componentReference="IdleRightSpriteSheet" />
  252. </IdleRight>
  253. <IdleLeft>
  254. <frameRate>12</frameRate>
  255. <loop>true</loop>
  256. <spriteSheet componentReference="IdleLeftSpriteSheet" />
  257. </IdleLeft>
  258. <RunRight>
  259. <frameRate>6</frameRate>
  260. <loop>true</loop>
  261. <spriteSheet componentReference="RunRightSpriteSheet" />
  262. </RunRight>
  263. <RunLeft>
  264. <frameRate>6</frameRate>
  265. <loop>true</loop>
  266. <spriteSheet componentReference="RunLeftSpriteSheet" />
  267. </RunLeft>
  268. </animations>
  269. </component>
  270. <!-- zelf geschreven component -->
  271. <component type="KeyboardControllerWithInputmapComponent" name="KeyboardController">
  272. <velocityProperty>@SpatialPlayer.linearVelocity</velocityProperty>
  273. <animationEventName>PlayerAnimation</animationEventName>
  274. <movingSpeed>200</movingSpeed>
  275. <jumpSpeed>200</jumpSpeed>
  276. <Input>
  277. <goLeft>LEFT</goLeft>
  278. <goRight>RIGHT</goRight>
  279. <goUp>UP</goUp>
  280. <goDown>DOWN</goDown>
  281. <pause>O</pause>
  282. <cocaine>X</cocaine>
  283. <weed>C</weed>
  284. <xtc>V</xtc>
  285. </Input>
  286. <jumpSound>assets/jump.mp3</jumpSound>
  287. <positionProperty>@SpatialPlayer.position</positionProperty>
  288. </component>
  289. </entity>
  290.  
  291. <entity name="Enemy">
  292. <component type="com.pblabs.box2D.Box2DSpatialComponent" name="SpatialEnemy">
  293. <spatialManager componentReference="SceneDB"/>
  294. <canRotate>false</canRotate>
  295. <canSleep>false</canSleep>
  296. <canMove>false</canMove>
  297. <collisionType childType="String">
  298. <Type>Enemy</Type>
  299. </collisionType>
  300. <collidesWithTypes childType="String">
  301. <Type>Platform</Type>
  302. <Type>Player</Type>
  303. </collidesWithTypes>
  304. <size>
  305. <x>26</x>
  306. <y>27</y>
  307. </size>
  308. <position>
  309. <x>0</x>
  310. <y>180</y>
  311. </position>
  312. <collisionShapes childType="com.pblabs.box2D.CollisionShape">
  313. <Shape type="com.pblabs.box2D.CircleCollisionShape">
  314. <radius>0.6</radius>
  315. </Shape>
  316. </collisionShapes>
  317. </component>
  318. <component type="com.pblabs.rendering2D.SpriteSheetRenderer" name="RenderEnemy">
  319. <scene componentReference="Scene"/>
  320. <positionProperty>@SpatialEnemy.position</positionProperty>
  321. <rotationProperty>@SpatialEnemy.rotation</rotationProperty>
  322. <sizeProperty>@SpatialEnemy.size</sizeProperty>
  323. </component>
  324. <component type="com.pblabs.rendering2D.AnimationController" name="Animation">
  325. <spriteSheetReference>@RenderEnemy.spriteSheet</spriteSheetReference>
  326. <currentFrameReference>@RenderEnemy.spriteIndex</currentFrameReference>
  327. <defaultAnimation>Idle</defaultAnimation>
  328. <animations childType="com.pblabs.rendering2D.AnimationControllerInfo">
  329. <Idle type="">
  330. <frameRate>2</frameRate>
  331. <loop>true</loop>
  332. <spriteSheet componentReference="EnemySpriteSheet"/>
  333. </Idle>
  334. </animations>
  335. </component>
  336. </entity>
  337.  
  338.  
  339. <entity name="Goal1" template="Goal">
  340. <!-- kan alle eigenschappen overschrijven van template -->
  341. <component type="com.pblabs.rendering2D.SpriteSheetRenderer" name="Render">
  342. <scene componentReference="Scene" />
  343. <spriteSheet componentReference="GoalSpriteSheet" />
  344. <positionProperty>@SpatialGoal.position</positionProperty>
  345. <rotationProperty>@SpatialGoal.rotation</rotationProperty>
  346. <sizeProperty>@SpatialGoal.size</sizeProperty>
  347. </component>
  348. <component name="SpatialGoal">
  349. <size>
  350. <x>38</x>
  351. <y>38</y>
  352. </size>
  353. <position>
  354. <x>0</x>
  355. <y>80</y>
  356. </position>
  357. </component>
  358. </entity>
  359.  
  360. <group name="SpriteSheets">
  361. <objectReference name="PlatformSpriteSheet" />
  362. <objectReference name="PlatformSpriteSheet2" />
  363. <objectReference name="GoalSpriteSheet" />
  364. <objectReference name="IdleRightSpriteSheet" />
  365. <objectReference name="RunLeftSpriteSheet" />
  366. <objectReference name="RunRightSpriteSheet" />
  367. <objectReference name="IdleLeftSpriteSheet" />
  368. <objectReference name="EnemySpriteSheet"/>
  369. </group>
  370. <group name="Objects">
  371. <objectReference name="Background"/>
  372. <objectReference name="Player" />
  373. <!-- <objectReference name="Goal1"/> -->
  374. <objectReference name="Enemy"/>
  375. <objectReference name="Platform1" />
  376. <objectReference name="Platform2" />
  377. </group>
  378. <group name="Managers">
  379. <objectReference name="Scene" />
  380. </group>
  381. <group name="Level1Data">
  382. <groupReference name="Managers" />
  383. <groupReference name="SpriteSheets" />
  384. <groupReference name="Objects" />
  385. </group>
  386.  
  387. </things>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement