arkanoid.app.json 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. {
  2. "camera": {
  3. "metadata": {
  4. "version": 4.3,
  5. "type": "Object",
  6. "generator": "ObjectExporter"
  7. },
  8. "object": {
  9. "uuid": "8EFB9C06-6312-4975-B04A-C9E4549BE348",
  10. "type": "PerspectiveCamera",
  11. "name": "Camera",
  12. "fov": 50,
  13. "aspect": 1.536388140161725,
  14. "near": 0.1,
  15. "far": 100000,
  16. "matrix": [0.9392361044883728,-1.2050817232989175e-8,-0.34327182173728943,0,-0.15080472826957703,0.8983326554298401,-0.41262128949165344,0,0.30837228894233704,0.4393158257007599,0.8437464833259583,0,142.32125854492188,202.75485229492188,389.40936279296875,1]
  17. }
  18. },
  19. "scene": {
  20. "metadata": {
  21. "version": 4.3,
  22. "type": "Object",
  23. "generator": "ObjectExporter"
  24. },
  25. "geometries": [
  26. {
  27. "uuid": "8F05A1F2-3877-478B-8DFC-F572AC61AB3A",
  28. "type": "PlaneGeometry",
  29. "width": 300,
  30. "height": 400,
  31. "widthSegments": 1,
  32. "heightSegments": 1
  33. },
  34. {
  35. "uuid": "7149652B-DBD7-4CB7-A600-27A9AC005C95",
  36. "type": "BoxGeometry",
  37. "width": 20,
  38. "height": 10,
  39. "depth": 10,
  40. "widthSegments": 1,
  41. "heightSegments": 1,
  42. "depthSegments": 1
  43. },
  44. {
  45. "uuid": "CABCC711-1331-4D4C-9FF6-409299F10C68",
  46. "type": "SphereGeometry",
  47. "radius": 5,
  48. "widthSegments": 32,
  49. "heightSegments": 16,
  50. "phiStart": 0,
  51. "phiLength": 6.28,
  52. "thetaStart": 0,
  53. "thetaLength": 3.14
  54. },
  55. {
  56. "uuid": "A1D8B049-74DD-4B08-B5BC-8DCEC9AF0222",
  57. "type": "BoxGeometry",
  58. "width": 40,
  59. "height": 10,
  60. "depth": 10,
  61. "widthSegments": 1,
  62. "heightSegments": 1,
  63. "depthSegments": 1
  64. }],
  65. "materials": [
  66. {
  67. "uuid": "2F69AF3A-DDF5-4BBA-87B5-80159F90DDBF",
  68. "type": "MeshPhongMaterial",
  69. "color": 86015,
  70. "emissive": 0,
  71. "specular": 1118481,
  72. "shininess": 30
  73. },
  74. {
  75. "uuid": "CFBEAD4C-6695-4A99-887B-8161E2947225",
  76. "type": "MeshPhongMaterial",
  77. "color": 16777215,
  78. "emissive": 0,
  79. "specular": 1118481,
  80. "shininess": 30
  81. },
  82. {
  83. "uuid": "043B208C-1F83-42C6-802C-E0E35621C27C",
  84. "type": "MeshPhongMaterial",
  85. "color": 16777215,
  86. "emissive": 0,
  87. "specular": 1118481,
  88. "shininess": 30
  89. },
  90. {
  91. "uuid": "40EC9BDA-91C0-4671-937A-2BCB6DA7EEBB",
  92. "type": "MeshPhongMaterial",
  93. "color": 13486790,
  94. "emissive": 0,
  95. "specular": 1118481,
  96. "shininess": 30
  97. }],
  98. "object": {
  99. "uuid": "31517222-A9A7-4EAF-B5F6-60751C0BABA3",
  100. "type": "Scene",
  101. "name": "Scene",
  102. "matrix": [1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],
  103. "children": [
  104. {
  105. "uuid": "EBBB1E63-6318-4752-AE2E-440A4E0B3EF3",
  106. "type": "Mesh",
  107. "name": "Ground",
  108. "geometry": "8F05A1F2-3877-478B-8DFC-F572AC61AB3A",
  109. "material": "2F69AF3A-DDF5-4BBA-87B5-80159F90DDBF",
  110. "matrix": [1,0,0,0,0,0.000796250649727881,-0.9999997019767761,0,0,0.9999997019767761,0.000796250649727881,0,0,0,0,1]
  111. },
  112. {
  113. "uuid": "6EE2E764-43E0-48E0-85F2-E0C8823C20DC",
  114. "type": "DirectionalLight",
  115. "name": "DirectionalLight 1",
  116. "color": 16777215,
  117. "intensity": 1,
  118. "matrix": [1,0,0,0,0,1,0,0,0,0,1,0,100,200,150,1]
  119. },
  120. {
  121. "uuid": "38219749-1E67-45F2-AB15-E64BA0940CAD",
  122. "type": "Mesh",
  123. "name": "Brick",
  124. "geometry": "7149652B-DBD7-4CB7-A600-27A9AC005C95",
  125. "material": "CFBEAD4C-6695-4A99-887B-8161E2947225",
  126. "matrix": [1,0,0,0,0,1,0,0,0,0,1,0,0,5,0,1]
  127. },
  128. {
  129. "uuid": "18FFA67C-F893-4E7A-8A76-8D996DEBE0C6",
  130. "type": "Mesh",
  131. "name": "Ball",
  132. "geometry": "CABCC711-1331-4D4C-9FF6-409299F10C68",
  133. "material": "043B208C-1F83-42C6-802C-E0E35621C27C",
  134. "matrix": [1,0,0,0,0,1,0,0,0,0,1,0,0,5,35.54999923706055,1]
  135. },
  136. {
  137. "uuid": "6D660D49-39B8-40C3-95F6-E4E007AA8D79",
  138. "type": "Mesh",
  139. "name": "Paddle",
  140. "geometry": "A1D8B049-74DD-4B08-B5BC-8DCEC9AF0222",
  141. "material": "40EC9BDA-91C0-4671-937A-2BCB6DA7EEBB",
  142. "matrix": [1,0,0,0,0,1,0,0,0,0,1,0,0,5,159.54217529296875,1]
  143. },
  144. {
  145. "uuid": "B0BEAF69-8B5D-4D87-ADCA-FDE83A02762D",
  146. "type": "PointLight",
  147. "name": "PointLight 2",
  148. "color": 16777215,
  149. "intensity": 1,
  150. "distance": 0,
  151. "decay": 1,
  152. "matrix": [1,0,0,0,0,1,0,0,0,0,1,0,-116.54356384277344,69.48957061767578,-206.8248291015625,1]
  153. }]
  154. }
  155. },
  156. "scripts": {
  157. "6D660D49-39B8-40C3-95F6-E4E007AA8D79": [
  158. {
  159. "name": "User",
  160. "source": "function mousemove( event ) {\n\n\tthis.position.x = ( event.clientX / player.width ) * 300 - 150;\n\n}\n\n// function update( event ) {}"
  161. }],
  162. "31517222-A9A7-4EAF-B5F6-60751C0BABA3": [
  163. {
  164. "name": "Game Logic",
  165. "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' );\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.material = material;\n\t\tobject.position.x = i * 22 - 120;\n\t\tobject.position.z = j * 14 - 120;\n\t\tgroup.add( object );\n\t\t\n\t}\n\t\n}\n\nbrick.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}"
  166. }]
  167. }
  168. }