-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.blocks
1 lines (1 loc) · 10.8 KB
/
main.blocks
1
<xml xmlns="https://developers.google.com/blockly/xml"><variables><variable id="JtIga/ihLh`G}M78y[S*">cameraDistance</variable><variable id="a:rtP?sZQ-}G1RJrZt~R">redCube</variable><variable id="sX}z19{h9M2oR],D,^+}">blueCube</variable><variable id="7nObF0CSu,aaChgYsl,H">greenCube</variable></variables><block type="pxt-on-start" id="zAx)RqzG#px!GR*!?/ch" x="0" y="0"><statement name="HANDLER"><block type="typescript_statement" id="(ld2=n}C,Q@8h){B3Qqf" editable="false"><mutation xmlns="http://www.w3.org/1999/xhtml" line0="const engine = new threed.Engine();" numlines="1" declaredvars="engine"></mutation><next><block type="typescript_statement" id="|VRicJ?vB)IHjNBR9Ng)" editable="false"><mutation xmlns="http://www.w3.org/1999/xhtml" line0="engine.renderer.backfaceCulling = true;" numlines="1"></mutation><next><block type="typescript_statement" id="2s8#YN/8ssFXD-d;CO3B" editable="false"><mutation xmlns="http://www.w3.org/1999/xhtml" line0="engine.renderer.depthCheckEnabled = true;" numlines="1"></mutation><next><block type="typescript_statement" id="DDk*CAEgammbq%H$fWS6" editable="false"><mutation xmlns="http://www.w3.org/1999/xhtml" line0="engine.renderer.overWire = false;" numlines="1"></mutation><next><block type="typescript_statement" id="#$K2q6E1TH5vw2H!g~ls" editable="false"><mutation xmlns="http://www.w3.org/1999/xhtml" line0="engine.renderer.lightModel = threed.LightModel.Dither;" numlines="1"></mutation><next><block type="typescript_statement" id="heib[PSK]`M?5Cu3$73#" editable="false"><mutation xmlns="http://www.w3.org/1999/xhtml" line0="const cube = threed.Model.Cube();" numlines="1" declaredvars="cube"></mutation><next><block type="typescript_statement" id="]FcDWC+XM`1ta^1X(%4]" editable="false"><mutation xmlns="http://www.w3.org/1999/xhtml" line0="const redCube = new threed.Instance(cube, threed.Colors.Red, new threed.Vector3(Fx8(0), Fx8(0), Fx8(0)), threed.Vector3.Zero(), threed.Vector3.One());" numlines="1" declaredvars="redCube"></mutation><next><block type="typescript_statement" id="w.]}a=%O|Wqcgfnr`2x%" editable="false"><mutation xmlns="http://www.w3.org/1999/xhtml" line0="const blueCube = new threed.Instance(cube, threed.Colors.Blue, new threed.Vector3(Fx8(2.75), Fx8(0), Fx8(0)), threed.Vector3.Zero(), threed.Vector3.One());" numlines="1" declaredvars="blueCube"></mutation><next><block type="typescript_statement" id="Tctv/X#fp_CWZfmR|fh#" editable="false"><mutation xmlns="http://www.w3.org/1999/xhtml" line0="const greenCube = new threed.Instance(cube, threed.Colors.Green, new threed.Vector3(Fx8(-2.75), Fx8(0), Fx8(0)), threed.Vector3.Zero(), threed.Vector3.One());" numlines="1" declaredvars="greenCube"></mutation><next><block type="array_push" id="YO#LDOl%+TYj[|r^gvoL"><value name="list"><block type="typescript_expression" id="-``LMMoP/pWAAK9?49rm" editable="false"><field name="EXPRESSION">engine.instances</field></block></value><value name="value"><block type="variables_get" id="K+WKPJ7OimbYXzS`]@)U"><field name="VAR" id="a:rtP?sZQ-}G1RJrZt~R">redCube</field></block></value><next><block type="array_push" id="#Roj2YhEW$Q7-9Bpix}D"><value name="list"><block type="typescript_expression" id=":|y`%%4tFL607ulBW{B2" editable="false"><field name="EXPRESSION">engine.instances</field></block></value><value name="value"><block type="variables_get" id="D{S1mb06Teo5x);6cEep"><field name="VAR" id="sX}z19{h9M2oR],D,^+}">blueCube</field></block></value><next><block type="array_push" id="15GBJQ24+ptpNXRMt/}Y"><value name="list"><block type="typescript_expression" id="}{EL#S^we!Ls`h2pd!#f" editable="false"><field name="EXPRESSION">engine.instances</field></block></value><value name="value"><block type="variables_get" id="d=m~L?XmZtNep(=g{s:o"><field name="VAR" id="7nObF0CSu,aaChgYsl,H">greenCube</field></block></value><next><block type="typescript_statement" id="x|~62]Sph510rx|xufUk" editable="false"><mutation xmlns="http://www.w3.org/1999/xhtml" line0="let cameraOrbitAngle = threed.PI_OVER_2_FX8;" numlines="1" declaredvars="cameraOrbitAngle"></mutation><next><block type="typescript_statement" id="/uoAgBK;Fh;iv~CWZOqm" editable="false"><mutation xmlns="http://www.w3.org/1999/xhtml" line0="let cameraDistance = Fx8(10);" numlines="1" declaredvars="cameraDistance"></mutation><next><block type="typescript_statement" id="]tbdItC5vkGXElricGsV" editable="false"><mutation xmlns="http://www.w3.org/1999/xhtml" line0="game.onPaint(function () {" line1=" engine.draw();" line2="})" numlines="3"></mutation></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></statement></block><block type="keyonevent" id="v4+#gr+_(ct]zkC}0X:a" x="559" y="0"><field name="button">controller.B</field><field name="event">ControllerButtonEvent.Pressed</field><statement name="HANDLER"><block type="typescript_statement" id="6ap9Qx)/uamcs]m,A6Rr" editable="false"><mutation xmlns="http://www.w3.org/1999/xhtml" line0="engine.renderer.overWire = !engine.renderer.overWire;" numlines="1"></mutation></block></statement></block><block type="keyonevent" id="wccR0/o}$-Vk5`2Q{Y(F" x="550" y="170"><field name="button">controller.A</field><field name="event">ControllerButtonEvent.Pressed</field><statement name="HANDLER"><block type="typescript_statement" id="0l.:Ha@?lC%ltH{:z.D2" editable="false"><mutation xmlns="http://www.w3.org/1999/xhtml" line0="engine.renderer.lightModel += 1;" numlines="1"></mutation><next><block type="typescript_statement" id="ZL0.K.Ha3/,g,/[f6min" editable="false"><mutation xmlns="http://www.w3.org/1999/xhtml" line0="engine.renderer.lightModel %= threed.LightModel.Count;" numlines="1"></mutation></block></next></block></statement></block><block type="function_definition" id="g-sbZ-]L=?qQ)MIr:+`o" x="550" y="430"><mutation name="updateCamera" functionid="q?dnpA.-$o-NJYe:kR_,"/><field name="function_name">updateCamera</field><statement name="STACK"><block type="controls_if" id="HvbO?SiI^[~TvF5f_2eC"><value name="IF0"><shadow type="logic_boolean"><field name="BOOL">TRUE</field></shadow><block type="logic_compare" id="KZdcu*=dV_MdP)i%Z]^!"><field name="OP">LT</field><value name="A"><shadow type="math_number"><field name="NUM">0</field></shadow><block type="variables_get" id="Ue|piK`NK32MF?lgTz)~"><field name="VAR" id="JtIga/ihLh`G}M78y[S*">cameraDistance</field></block></value><value name="B"><shadow type="math_number"><field name="NUM">0</field></shadow><block type="typescript_expression" id="n`MS{a+;[si?#;6Z.o}4" editable="false"><field name="EXPRESSION">Fx.zeroFx8</field></block></value></block></value><statement name="DO0"><block type="typescript_statement" id="i%(e{f]rKfYRuU{|+)3K" editable="false"><mutation xmlns="http://www.w3.org/1999/xhtml" line0="cameraDistance = Fx.zeroFx8;" numlines="1"></mutation></block></statement><next><block type="typescript_statement" id="DOi_5@t4/5oyHWl},6s|" editable="false"><mutation xmlns="http://www.w3.org/1999/xhtml" line0="engine.camera.orbit(redCube.position, cameraDistance, cameraOrbitAngle, threed.Vector3.Y());" numlines="1"></mutation><next><block type="typescript_statement" id="iW`t#b|bWL47*w-jTh48" editable="false"><mutation xmlns="http://www.w3.org/1999/xhtml" line0="engine.camera.lookAt(redCube.position);" numlines="1"></mutation></block></next></block></next></block></statement></block><block type="gameupdate" id="[email protected]=ot_.ZOB" x="0" y="1298"><statement name="HANDLER"><block type="typescript_statement" id="51/D8(ffvFx+RwPc(IIO" editable="false"><mutation xmlns="http://www.w3.org/1999/xhtml" line0="const dx = Fx8(controller.dx(30));" numlines="1" declaredvars="dx"></mutation><next><block type="typescript_statement" id="bRDwF]~)%XH(xg)_13Zl" editable="false"><mutation xmlns="http://www.w3.org/1999/xhtml" line0="const dy = Fx8(controller.dy(15));" numlines="1" declaredvars="dy"></mutation><next><block type="typescript_statement" id="BIo!Y3G!`se.A;L)q*=(" editable="false"><mutation xmlns="http://www.w3.org/1999/xhtml" line0="cameraOrbitAngle = Fx.sub(cameraOrbitAngle, dx);" numlines="1"></mutation><next><block type="typescript_statement" id="5{LP`9]KK7(jacg1`%Xn" editable="false"><mutation xmlns="http://www.w3.org/1999/xhtml" line0="cameraDistance = Fx.add(cameraDistance, dy);" numlines="1"></mutation><next><block type="function_call" id=".MQAbz(vvSY7~qrtZN~("><mutation name="updateCamera" functionid="q?dnpA.-$o-NJYe:kR_,"/><next><block type="typescript_statement" id="CcXoYx,$:AGj9.j,W([V" editable="false"><mutation xmlns="http://www.w3.org/1999/xhtml" line0="redCube.rotation.x = Fx.add(redCube.rotation.x, Fx8(0.76));" numlines="1"></mutation><comment id="undefined" pinned="false" h="80" w="160">Note: angles are not in radians OR degrees here! They're in a 256-angle unit circle.</comment><next><block type="typescript_statement" id="TLwBPQ`YJiDVLKaAtyvG" editable="false"><mutation xmlns="http://www.w3.org/1999/xhtml" line0="redCube.rotation.y = Fx.add(redCube.rotation.y, Fx8(0.33));" numlines="1"></mutation><next><block type="typescript_statement" id="7~h?Oo5NC8B*oIQsUlt0" editable="false"><mutation xmlns="http://www.w3.org/1999/xhtml" line0="redCube.rotation.z = Fx.sub(redCube.rotation.z, Fx8(0.01));" numlines="1"></mutation><next><block type="typescript_statement" id="32CxEN7iQq2SpPY3Ss-F" editable="false"><mutation xmlns="http://www.w3.org/1999/xhtml" line0="blueCube.rotation.z = Fx.add(blueCube.rotation.z, Fx8(2.37));" numlines="1"></mutation><next><block type="typescript_statement" id="=7^;PGV}UEZt$SazYVsO" editable="false"><mutation xmlns="http://www.w3.org/1999/xhtml" line0="blueCube.rotation.y = Fx.sub(blueCube.rotation.y, Fx8(0.41));" numlines="1"></mutation><next><block type="typescript_statement" id="~FOTa0mt,jg7P^F.40qL" editable="false"><mutation xmlns="http://www.w3.org/1999/xhtml" line0="blueCube.rotation.z = Fx.sub(blueCube.rotation.z, Fx8(0.01));" numlines="1"></mutation><next><block type="typescript_statement" id="LAGJG`r1}}nQ=3*nD(xq" editable="false"><mutation xmlns="http://www.w3.org/1999/xhtml" line0="greenCube.rotation.x = Fx.sub(greenCube.rotation.x, Fx8(1.71));" numlines="1"></mutation><next><block type="typescript_statement" id="pTbvLlIvE}jNTy1iCXCq" editable="false"><mutation xmlns="http://www.w3.org/1999/xhtml" line0="greenCube.rotation.y = Fx.add(greenCube.rotation.y, Fx8(0.03));" numlines="1"></mutation><next><block type="typescript_statement" id="Eq38QMR).w`/lSG$)c(s" editable="false"><mutation xmlns="http://www.w3.org/1999/xhtml" line0="greenCube.rotation.z = Fx.sub(greenCube.rotation.z, Fx8(0.01));" numlines="1"></mutation><next><block type="typescript_statement" id="Xei7;lIdqyk|n@*Xaqyu" editable="false"><mutation xmlns="http://www.w3.org/1999/xhtml" line0="engine.step();" numlines="1"></mutation></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></statement></block></xml>