//!tgscript v1 //! script name=GameOver //! region graph //! node 1 OnUpdate pos=(60,80) export function onUpdate(ctx) { //! node 2 GetGlobal pos=(60,220) global=hp const n2_value = ctx.getGlobal("hp"); //! node 3 GetGlobal pos=(60,320) global=started const n3_value = ctx.getGlobal("started"); //! node 4 ConstNumber pos=(60,420) const n4_value = 0.50; //! node 5 Less pos=(260,220) const n5_out = (n2_value < n4_value); //! node 6 Greater pos=(260,320) const n6_out = (n3_value > n4_value); //! node 7 And pos=(460,260) const n7_out = (n5_out && n6_out); //! node 8 Time pos=(60,520) const n8_value = ctx.time(); //! node 9 Branch pos=(660,80) if (n7_out) { //! node 10 ConstNumber pos=(660,240) const n10_value = 0.00; //! node 11 SetGlobal pos=(860,80) global=started ctx.setGlobal("started", n10_value); //! node 12 SetVar pos=(1060,80) var=overAt ctx.setVar("overAt", n8_value); //! node 13 FindEntity pos=(1060,240) entity=SfxHurt const n13_value = ctx.findEntity("SfxHurt"); //! node 14 PlayAudio pos=(1260,80) ctx.playAudio(n13_value); //! node 15 ConstNumber pos=(1260,240) const n15_value = 1.00; //! node 16 SetGlobal pos=(1460,80) global=over ctx.setGlobal("over", n15_value); } //! node 20 GetVar pos=(60,720) var=overAt const n20_value = ctx.getVar("overAt"); //! node 21 Greater pos=(260,720) const n21_out = (n20_value > n4_value); //! node 22 Branch pos=(1460,80) if (n21_out) { //! node 23 FindEntity pos=(1460,240) entity=Camera const n23_value = ctx.findEntity("Camera"); //! node 24 GetEntityPosition2D pos=(1660,240) const n24_value = ctx.getEntityPosition2D(n23_value); //! node 25 SetPosition2D pos=(1860,80) ctx.setPosition2D(n24_value); //! node 26 ConstNumber pos=(1660,360) const n26_value = 2.50; //! node 27 AddNumber pos=(1860,360) const n27_out = (n20_value + n26_value); //! node 28 Greater pos=(2060,320) const n28_out = (n8_value > n27_out); //! node 29 Branch pos=(2260,80) if (n28_out) { //! node 30 LoadScene pos=(2460,80) scene="" ctx.loadScene(""); } } } //! endregion