sprite.scene 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. scene spriteSample
  2. {
  3. // Width and height are expected to be 1280x720
  4. node camera
  5. {
  6. camera
  7. {
  8. type = ORTHOGRAPHIC
  9. nearPlane = 0
  10. farPlane = 100
  11. // zoomX default is game width
  12. // zoomY default is game height
  13. // aspectRatio default is game width / game height
  14. }
  15. // width and height are divided in half
  16. translate = 640, 360, 0
  17. }
  18. // Background sprite
  19. node background
  20. {
  21. sprite
  22. {
  23. path = res/common/sprites/background.png
  24. // game width * 5
  25. width = 6400
  26. height = 720
  27. }
  28. }
  29. // Level floor
  30. node floor
  31. {
  32. tileset
  33. {
  34. path = res/common/sprites/level.png
  35. tileWidth = 70
  36. tileHeight = 70
  37. rows = 3
  38. columns = 7
  39. tile
  40. {
  41. cell = 0, 0
  42. source = 568, 284
  43. }
  44. tile
  45. {
  46. cell = 1, 0
  47. source = 568, 284
  48. }
  49. tile
  50. {
  51. cell = 2, 0
  52. source = 568, 284
  53. }
  54. tile
  55. {
  56. cell = 3, 0
  57. source = 568, 284
  58. }
  59. tile
  60. {
  61. cell = 4, 0
  62. source = 497, 284
  63. }
  64. tile
  65. {
  66. cell = 0, 1
  67. source = 568, 0
  68. }
  69. tile
  70. {
  71. cell = 1, 1
  72. source = 568, 0
  73. }
  74. tile
  75. {
  76. cell = 2, 1
  77. source = 568, 0
  78. }
  79. tile
  80. {
  81. cell = 3, 1
  82. source = 568, 0
  83. }
  84. tile
  85. {
  86. cell = 4, 1
  87. source = 710, 142
  88. }
  89. tile
  90. {
  91. cell = 5, 1
  92. source = 497, 284
  93. }
  94. tile
  95. {
  96. cell = 0, 2
  97. source = 568, 0
  98. }
  99. tile
  100. {
  101. cell = 1, 2
  102. source = 568, 0
  103. }
  104. tile
  105. {
  106. cell = 2, 2
  107. source = 568, 0
  108. }
  109. tile
  110. {
  111. cell = 3, 2
  112. source = 568, 0
  113. }
  114. tile
  115. {
  116. cell = 4, 2
  117. source = 568, 0
  118. }
  119. tile
  120. {
  121. cell = 5, 2
  122. source = 710, 142
  123. }
  124. tile
  125. {
  126. cell = 6, 2
  127. source = 497, 284
  128. }
  129. }
  130. }
  131. node player
  132. {
  133. node text
  134. {
  135. text
  136. {
  137. font = res/ui/arial.gpb
  138. text = P1
  139. size = 18
  140. color = 0, 0, 1, 1
  141. }
  142. }
  143. sprite
  144. {
  145. path = res/common/sprites/player1.png
  146. width = 72
  147. height = 97
  148. source = 67, 196, 66, 92
  149. frameCount = 13
  150. }
  151. // Position player at lower-left. Y position is floor's tileset height (tileHeight * rows)
  152. translate = 0, 210, 0
  153. }
  154. node rocket
  155. {
  156. sprite
  157. {
  158. path = res/common/sprites/rocket.png
  159. width = 128
  160. height = 128
  161. blendMode = BLEND_ADDITIVE
  162. anchor = 0.5, 0.3
  163. offset = OFFSET_ANCHOR
  164. }
  165. translate = 1280, 0, 0
  166. rotate = 0, 0, 1, -45
  167. }
  168. node water
  169. {
  170. // Sprite drawable set in code because Effect isn't supported
  171. translate = 0, -50, 0
  172. }
  173. // Set active camera
  174. activeCamera = camera
  175. }