arkanoid.app.json 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276
  1. {
  2. "metadata": {
  3. "type": "App"
  4. },
  5. "project": {
  6. "shadows": true,
  7. "vr": false
  8. },
  9. "camera": {
  10. "metadata": {
  11. "version": 4.5,
  12. "type": "Object",
  13. "generator": "Object3D.toJSON"
  14. },
  15. "object": {
  16. "uuid": "0C0DD0AD-3A7F-4ECD-A9FE-CECD97D5CBD9",
  17. "type": "PerspectiveCamera",
  18. "name": "Camera",
  19. "layers": 1,
  20. "matrix": [0.939236,0,-0.343272,0,-0.147782,0.902586,-0.404351,0,0.309832,0.430511,0.847741,0,11.713146,19.228675,40.388679,1],
  21. "fov": 50,
  22. "zoom": 1,
  23. "near": 0.1,
  24. "far": 100000,
  25. "focus": 10,
  26. "aspect": 1.428977,
  27. "filmGauge": 35,
  28. "filmOffset": 0
  29. }
  30. },
  31. "scene": {
  32. "metadata": {
  33. "version": 4.5,
  34. "type": "Object",
  35. "generator": "Object3D.toJSON"
  36. },
  37. "geometries": [
  38. {
  39. "uuid": "BBEE74D1-E43D-4C32-A9F3-4656E78C26F3",
  40. "type": "PlaneGeometry",
  41. "width": 30,
  42. "height": 40,
  43. "widthSegments": 1,
  44. "heightSegments": 1
  45. },
  46. {
  47. "uuid": "C1722F5F-89AD-45D8-B78C-D1D34AF2A012",
  48. "type": "BoxGeometry",
  49. "width": 2,
  50. "height": 1,
  51. "depth": 1,
  52. "widthSegments": 1,
  53. "heightSegments": 1,
  54. "depthSegments": 1
  55. },
  56. {
  57. "uuid": "327EFFCF-649C-4EF3-86D4-B422C5A86E89",
  58. "type": "CylinderGeometry",
  59. "radiusTop": 0.5,
  60. "radiusBottom": 0.5,
  61. "height": 2,
  62. "radialSegments": 32,
  63. "heightSegments": 1,
  64. "openEnded": false
  65. },
  66. {
  67. "uuid": "0791211B-BB02-4E57-82B5-64C05DE92B39",
  68. "type": "SphereGeometry",
  69. "radius": 0.5,
  70. "widthSegments": 32,
  71. "heightSegments": 16,
  72. "phiStart": 0,
  73. "phiLength": 6.28,
  74. "thetaStart": 0,
  75. "thetaLength": 3.14
  76. },
  77. {
  78. "uuid": "73F12A47-9EA7-47FD-BCF3-89B8219B2626",
  79. "type": "BoxGeometry",
  80. "width": 2,
  81. "height": 1,
  82. "depth": 1,
  83. "widthSegments": 1,
  84. "heightSegments": 1,
  85. "depthSegments": 1
  86. },
  87. {
  88. "uuid": "3BDEB9FB-BDD4-44AD-8A47-008BED1C8982",
  89. "type": "CylinderGeometry",
  90. "radiusTop": 0.5,
  91. "radiusBottom": 0.5,
  92. "height": 2,
  93. "radialSegments": 32,
  94. "heightSegments": 1,
  95. "openEnded": false
  96. }],
  97. "materials": [
  98. {
  99. "uuid": "2F69AF3A-DDF5-4BBA-87B5-80159F90DDBF",
  100. "type": "MeshPhongMaterial",
  101. "color": 86015,
  102. "emissive": 0,
  103. "specular": 1118481,
  104. "shininess": 30,
  105. "depthFunc": 3,
  106. "depthTest": true,
  107. "depthWrite": true
  108. },
  109. {
  110. "uuid": "D98FC4D1-169E-420A-92EA-20E55009A46D",
  111. "type": "MeshBasicMaterial",
  112. "color": 63744,
  113. "depthFunc": 3,
  114. "depthTest": true,
  115. "depthWrite": true,
  116. "wireframe": true
  117. },
  118. {
  119. "uuid": "3B9DE64D-E1C8-4C24-9F73-3A9E10E3E655",
  120. "type": "MeshPhongMaterial",
  121. "color": 16777215,
  122. "emissive": 0,
  123. "specular": 1118481,
  124. "shininess": 30,
  125. "depthFunc": 3,
  126. "depthTest": true,
  127. "depthWrite": true
  128. },
  129. {
  130. "uuid": "043B208C-1F83-42C6-802C-E0E35621C27C",
  131. "type": "MeshPhongMaterial",
  132. "color": 16777215,
  133. "emissive": 0,
  134. "specular": 1118481,
  135. "shininess": 30,
  136. "depthFunc": 3,
  137. "depthTest": true,
  138. "depthWrite": true
  139. },
  140. {
  141. "uuid": "40EC9BDA-91C0-4671-937A-2BCB6DA7EEBB",
  142. "type": "MeshBasicMaterial",
  143. "color": 63744,
  144. "depthFunc": 3,
  145. "depthTest": true,
  146. "depthWrite": true,
  147. "wireframe": true
  148. }],
  149. "object": {
  150. "uuid": "31517222-A9A7-4EAF-B5F6-60751C0BABA3",
  151. "type": "Scene",
  152. "name": "Scene",
  153. "layers": 1,
  154. "matrix": [1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],
  155. "children": [
  156. {
  157. "uuid": "EBBB1E63-6318-4752-AE2E-440A4E0B3EF3",
  158. "type": "Mesh",
  159. "name": "Ground",
  160. "layers": 1,
  161. "matrix": [1,0,0,0,0,0.000796,-1,0,0,1,0.000796,0,0,0,0,1],
  162. "geometry": "BBEE74D1-E43D-4C32-A9F3-4656E78C26F3",
  163. "material": "2F69AF3A-DDF5-4BBA-87B5-80159F90DDBF"
  164. },
  165. {
  166. "uuid": "6EE2E764-43E0-48E0-85F2-E0C8823C20DC",
  167. "type": "DirectionalLight",
  168. "name": "DirectionalLight 1",
  169. "layers": 1,
  170. "matrix": [1,0,0,0,0,1,0,0,0,0,1,0,10,20,15,1],
  171. "color": 16777215,
  172. "intensity": 1,
  173. "shadow": {
  174. "camera": {
  175. "uuid": "3BC010F7-9766-4087-BA04-1D4FD7721ABA",
  176. "type": "OrthographicCamera",
  177. "layers": 1,
  178. "zoom": 1,
  179. "left": -5,
  180. "right": 5,
  181. "top": 5,
  182. "bottom": -5,
  183. "near": 0.5,
  184. "far": 500
  185. }
  186. }
  187. },
  188. {
  189. "uuid": "38219749-1E67-45F2-AB15-E64BA0940CAD",
  190. "type": "Mesh",
  191. "name": "Brick",
  192. "layers": 1,
  193. "matrix": [1,0,0,0,0,1,0,0,0,0,1,0,0,0.5,0,1],
  194. "geometry": "C1722F5F-89AD-45D8-B78C-D1D34AF2A012",
  195. "material": "D98FC4D1-169E-420A-92EA-20E55009A46D",
  196. "children": [
  197. {
  198. "uuid": "711A5955-8F17-4A8B-991A-7604D27E6FA0",
  199. "type": "Mesh",
  200. "name": "Cylinder",
  201. "layers": 1,
  202. "matrix": [0.000795,0.000795,1,0,-1.000001,-0.000001,0.000795,0,0.000001,-1.000001,0.000795,0,0,0,0,1],
  203. "geometry": "327EFFCF-649C-4EF3-86D4-B422C5A86E89",
  204. "material": "3B9DE64D-E1C8-4C24-9F73-3A9E10E3E655"
  205. }]
  206. },
  207. {
  208. "uuid": "18FFA67C-F893-4E7A-8A76-8D996DEBE0C6",
  209. "type": "Mesh",
  210. "name": "Ball",
  211. "layers": 1,
  212. "matrix": [1,0,0,0,0,1,0,0,0,0,1,0,0,0.5,3.55,1],
  213. "geometry": "0791211B-BB02-4E57-82B5-64C05DE92B39",
  214. "material": "043B208C-1F83-42C6-802C-E0E35621C27C"
  215. },
  216. {
  217. "uuid": "6D660D49-39B8-40C3-95F6-E4E007AA8D79",
  218. "type": "Mesh",
  219. "name": "Paddle",
  220. "layers": 1,
  221. "matrix": [2,0,0,0,0,1,0,0,0,0,1,0,0,0.5,15.95,1],
  222. "geometry": "73F12A47-9EA7-47FD-BCF3-89B8219B2626",
  223. "material": "40EC9BDA-91C0-4671-937A-2BCB6DA7EEBB",
  224. "children": [
  225. {
  226. "uuid": "4F5F884C-9E1B-45E6-8F1E-4D538A46D8CB",
  227. "type": "Mesh",
  228. "name": "Cylinder",
  229. "layers": 1,
  230. "matrix": [0.000795,0.000795,1,0,-1.000001,-0.000001,0.000795,0,0.000001,-1.000001,0.000795,0,0,0,0,1],
  231. "geometry": "3BDEB9FB-BDD4-44AD-8A47-008BED1C8982",
  232. "material": "3B9DE64D-E1C8-4C24-9F73-3A9E10E3E655"
  233. }]
  234. },
  235. {
  236. "uuid": "B0BEAF69-8B5D-4D87-ADCA-FDE83A02762D",
  237. "type": "PointLight",
  238. "name": "PointLight 2",
  239. "layers": 1,
  240. "matrix": [1,0,0,0,0,1,0,0,0,0,1,0,-11.65,6.949,-20.682,1],
  241. "color": 16777215,
  242. "intensity": 1,
  243. "distance": 0,
  244. "decay": 1,
  245. "shadow": {
  246. "camera": {
  247. "uuid": "2F0DA21A-EFB8-4E9A-83C5-A601D6113780",
  248. "type": "PerspectiveCamera",
  249. "layers": 1,
  250. "fov": 90,
  251. "zoom": 1,
  252. "near": 0.5,
  253. "far": 500,
  254. "focus": 10,
  255. "aspect": 1,
  256. "filmGauge": 35,
  257. "filmOffset": 0
  258. }
  259. }
  260. }],
  261. "background": 11184810
  262. }
  263. },
  264. "scripts": {
  265. "6D660D49-39B8-40C3-95F6-E4E007AA8D79": [
  266. {
  267. "name": "User",
  268. "source": "function pointermove( event ) {\n\n\tthis.position.x = ( event.clientX / player.width ) * 30 - 15;\n\n}\n\n// function update( event ) {}"
  269. }],
  270. "31517222-A9A7-4EAF-B5F6-60751C0BABA3": [
  271. {
  272. "name": "Game Logic",
  273. "source": "var ball = this.getObjectByName( 'Ball' );\n\nvar direction = new THREE.Vector3();\ndirection.x = Math.random() - 0.5;\ndirection.z = - 0.5;\ndirection.normalize();\n\nvar speed = new THREE.Vector3();\n\n//\n\nvar group = new THREE.Group();\nthis.add( group );\n\nvar paddle = this.getObjectByName( 'Paddle' );\npaddle.material.visible = false;\ngroup.add( paddle );\n\nvar brick = this.getObjectByName( 'Brick' );\n\nfor ( var j = 0; j < 8; j ++ ) {\n\n\tvar material = new THREE.MeshPhongMaterial( { color: Math.random() * 0xffffff } );\n\n\tfor ( var i = 0; i < 12; i ++ ) {\n\t\t\n\t\tvar object = brick.clone();\n\t\tobject.position.x = i * 2.2 - 12;\n\t\tobject.position.z = j * 1.4 - 12;\n\t\tgroup.add( object );\n\n\t\tvar cylinder = object.getObjectByName( 'Cylinder' );\n\t\tcylinder.material = material;\n\n\t}\n\t\n}\n\nbrick.visible = false;\nbrick.material.visible = false;\n\n//\n\nvar raycaster = new THREE.Raycaster();\n\nfunction update( event ) {\n\t\n\tif ( ball.position.x < - 15 || ball.position.x > 15 ) direction.x = - direction.x;\n\tif ( ball.position.z < - 20 || ball.position.z > 20 ) direction.z = - direction.z;\n\n\tball.position.x = Math.max( - 15, Math.min( 15, ball.position.x ) );\n\tball.position.z = Math.max( - 20, Math.min( 20, ball.position.z ) );\n\t\t\n\traycaster.set( ball.position, direction );\n\t\n\tvar intersections = raycaster.intersectObjects( group.children );\n\t\n\tif ( intersections.length > 0 ) {\n\t\n\t\tvar intersection = intersections[ 0 ];\n\t\t\n\t\tif ( intersection.distance < 0.5 ) {\n\t\t\t\n\t\t\tif ( intersection.object !== paddle ) {\n\n\t\t\t\tgroup.remove( intersection.object );\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tdirection.reflect( intersection.face.normal );\n\t\t\t\n\t\t}\n\t\t\n\t}\n\n\tball.position.add( speed.copy( direction ).multiplyScalar( event.delta / 40 ) );\n\t\n}"
  274. }]
  275. }
  276. }