arkanoid.app.json 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  1. {
  2. "metadata": {
  3. "type": "App"
  4. },
  5. "project": {
  6. "shadows": true,
  7. "vr": false
  8. },
  9. "camera": {
  10. "metadata": {
  11. "version": 4.4,
  12. "type": "Object",
  13. "generator": "Object3D.toJSON"
  14. },
  15. "object": {
  16. "uuid": "E41E9F54-8B31-4D1F-8D09-AF5E802E9A22",
  17. "type": "PerspectiveCamera",
  18. "name": "Camera",
  19. "matrix": [0.9392361044883728,-2.8092810300250903e-9,-0.3432718515396118,0,-0.14778217673301697,0.902585506439209,-0.404351145029068,0,0.3098321855068207,0.43051064014434814,0.847740888595581,0,142.32125854492188,202.75485229492188,389.40936279296875,1],
  20. "fov": 50,
  21. "aspect": 1.536388140161725,
  22. "near": 0.1,
  23. "far": 100000
  24. }
  25. },
  26. "scene": {
  27. "metadata": {
  28. "version": 4.4,
  29. "type": "Object",
  30. "generator": "Object3D.toJSON"
  31. },
  32. "geometries": [
  33. {
  34. "uuid": "8F05A1F2-3877-478B-8DFC-F572AC61AB3A",
  35. "type": "PlaneGeometry",
  36. "width": 300,
  37. "height": 400,
  38. "widthSegments": 1,
  39. "heightSegments": 1
  40. },
  41. {
  42. "uuid": "EEDF0A9A-D174-44E4-9C2F-A2F5BB8BE7F5",
  43. "type": "CylinderGeometry",
  44. "radiusTop": 5,
  45. "radiusBottom": 5,
  46. "height": 20,
  47. "radialSegments": 32,
  48. "heightSegments": 1,
  49. "openEnded": false
  50. },
  51. {
  52. "uuid": "7149652B-DBD7-4CB7-A600-27A9AC005C95",
  53. "type": "BoxGeometry",
  54. "width": 20,
  55. "height": 10,
  56. "depth": 10,
  57. "widthSegments": 1,
  58. "heightSegments": 1,
  59. "depthSegments": 1
  60. },
  61. {
  62. "uuid": "CABCC711-1331-4D4C-9FF6-409299F10C68",
  63. "type": "SphereGeometry",
  64. "radius": 5,
  65. "widthSegments": 32,
  66. "heightSegments": 16,
  67. "phiStart": 0,
  68. "phiLength": 6.28,
  69. "thetaStart": 0,
  70. "thetaLength": 3.14
  71. },
  72. {
  73. "uuid": "EFBF641D-F092-462E-B7FB-0BFAD1591EFC",
  74. "type": "BoxGeometry",
  75. "width": 20,
  76. "height": 10,
  77. "depth": 10,
  78. "widthSegments": 1,
  79. "heightSegments": 1,
  80. "depthSegments": 1
  81. }],
  82. "materials": [
  83. {
  84. "uuid": "2F69AF3A-DDF5-4BBA-87B5-80159F90DDBF",
  85. "type": "MeshPhongMaterial",
  86. "color": 86015,
  87. "emissive": 0,
  88. "specular": 1118481,
  89. "shininess": 30
  90. },
  91. {
  92. "uuid": "3B9DE64D-E1C8-4C24-9F73-3A9E10E3E655",
  93. "type": "MeshPhongMaterial",
  94. "color": 16777215,
  95. "emissive": 0,
  96. "specular": 1118481,
  97. "shininess": 30
  98. },
  99. {
  100. "uuid": "D98FC4D1-169E-420A-92EA-20E55009A46D",
  101. "type": "MeshBasicMaterial",
  102. "wireframe": true,
  103. "color": 63744
  104. },
  105. {
  106. "uuid": "043B208C-1F83-42C6-802C-E0E35621C27C",
  107. "type": "MeshPhongMaterial",
  108. "color": 16777215,
  109. "emissive": 0,
  110. "specular": 1118481,
  111. "shininess": 30
  112. },
  113. {
  114. "uuid": "40EC9BDA-91C0-4671-937A-2BCB6DA7EEBB",
  115. "type": "MeshBasicMaterial",
  116. "wireframe": true,
  117. "color": 63744
  118. }],
  119. "object": {
  120. "uuid": "31517222-A9A7-4EAF-B5F6-60751C0BABA3",
  121. "type": "Scene",
  122. "name": "Scene",
  123. "matrix": [1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],
  124. "children": [
  125. {
  126. "uuid": "EBBB1E63-6318-4752-AE2E-440A4E0B3EF3",
  127. "type": "Mesh",
  128. "name": "Ground",
  129. "matrix": [1,0,0,0,0,0.0007960614748299122,-0.9999997019767761,0,0,0.9999997019767761,0.0007960614748299122,0,0,0,0,1],
  130. "geometry": "8F05A1F2-3877-478B-8DFC-F572AC61AB3A",
  131. "material": "2F69AF3A-DDF5-4BBA-87B5-80159F90DDBF"
  132. },
  133. {
  134. "uuid": "6EE2E764-43E0-48E0-85F2-E0C8823C20DC",
  135. "type": "DirectionalLight",
  136. "name": "DirectionalLight 1",
  137. "matrix": [1,0,0,0,0,1,0,0,0,0,1,0,100,200,150,1],
  138. "color": 16777215,
  139. "intensity": 1
  140. },
  141. {
  142. "uuid": "38219749-1E67-45F2-AB15-E64BA0940CAD",
  143. "type": "Mesh",
  144. "name": "Brick",
  145. "matrix": [1,0,0,0,0,1,0,0,0,0,1,0,0,5,0,1],
  146. "children": [
  147. {
  148. "uuid": "711A5955-8F17-4A8B-991A-7604D27E6FA0",
  149. "type": "Mesh",
  150. "name": "Cylinder",
  151. "matrix": [0.0007962009985931218,0.0007962677045725286,0.9999995231628418,0,-0.9999997615814209,3.462185702574061e-7,0.0007962677045725286,0,2.210134084634774e-7,-0.9999997615814209,0.0007962008821777999,0,0,0,0,1],
  152. "geometry": "EEDF0A9A-D174-44E4-9C2F-A2F5BB8BE7F5",
  153. "material": "3B9DE64D-E1C8-4C24-9F73-3A9E10E3E655"
  154. }],
  155. "geometry": "7149652B-DBD7-4CB7-A600-27A9AC005C95",
  156. "material": "D98FC4D1-169E-420A-92EA-20E55009A46D"
  157. },
  158. {
  159. "uuid": "18FFA67C-F893-4E7A-8A76-8D996DEBE0C6",
  160. "type": "Mesh",
  161. "name": "Ball",
  162. "matrix": [1,0,0,0,0,1,0,0,0,0,1,0,0,5,35.54999923706055,1],
  163. "geometry": "CABCC711-1331-4D4C-9FF6-409299F10C68",
  164. "material": "043B208C-1F83-42C6-802C-E0E35621C27C"
  165. },
  166. {
  167. "uuid": "6D660D49-39B8-40C3-95F6-E4E007AA8D79",
  168. "type": "Mesh",
  169. "name": "Paddle",
  170. "matrix": [2,0,0,0,0,1,0,0,0,0,1,0,0,5,159.5399932861328,1],
  171. "children": [
  172. {
  173. "uuid": "4F5F884C-9E1B-45E6-8F1E-4D538A46D8CB",
  174. "type": "Mesh",
  175. "name": "Cylinder",
  176. "matrix": [0.0007962009985931218,0.0007962677045725286,0.9999995231628418,0,-0.9999997615814209,3.462185702574061e-7,0.0007962677045725286,0,2.210134084634774e-7,-0.9999997615814209,0.0007962008821777999,0,0,0,0,1],
  177. "geometry": "EEDF0A9A-D174-44E4-9C2F-A2F5BB8BE7F5",
  178. "material": "3B9DE64D-E1C8-4C24-9F73-3A9E10E3E655"
  179. }],
  180. "geometry": "EFBF641D-F092-462E-B7FB-0BFAD1591EFC",
  181. "material": "40EC9BDA-91C0-4671-937A-2BCB6DA7EEBB"
  182. },
  183. {
  184. "uuid": "B0BEAF69-8B5D-4D87-ADCA-FDE83A02762D",
  185. "type": "PointLight",
  186. "name": "PointLight 2",
  187. "matrix": [1,0,0,0,0,1,0,0,0,0,1,0,-116.54356384277344,69.48957061767578,-206.8248291015625,1],
  188. "color": 16777215,
  189. "intensity": 1,
  190. "distance": 0,
  191. "decay": 1
  192. }]
  193. }
  194. },
  195. "scripts": {
  196. "6D660D49-39B8-40C3-95F6-E4E007AA8D79": [
  197. {
  198. "name": "User",
  199. "source": "function mousemove( event ) {\n\n\tthis.position.x = ( event.clientX / player.width ) * 300 - 150;\n\n}\n\n// function update( event ) {}"
  200. }],
  201. "31517222-A9A7-4EAF-B5F6-60751C0BABA3": [
  202. {
  203. "name": "Game Logic",
  204. "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 * 22 - 120;\n\t\tobject.position.z = j * 14 - 120;\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 < - 150 || ball.position.x > 150 ) direction.x = - direction.x;\n\tif ( ball.position.z < - 200 || ball.position.z > 200 ) direction.z = - direction.z;\n\n\tball.position.x = Math.max( - 150, Math.min( 150, ball.position.x ) );\n\tball.position.z = Math.max( - 200, Math.min( 200, ball.position.z ) );\n\t\n\tball.position.add( speed.copy( direction ).multiplyScalar( event.delta / 4 ) );\n\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 < 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}"
  205. }]
  206. }
  207. }