arkanoid.app.json 8.6 KB

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