Billy's Quest #games#platformer#all
@Stage\n\nwhen flag clicked\nset [time v] to [0]\nset [level v] to [1]\nset [coins v] to [0]\nset [death v] to [0]\nset [fall_in_water v] to [0]\nset [kills v] to [0]\nset [kill v] to [0]\nset [saw_touches v] to [0]\ndelete all of [collected v]\ndelete all of [checkpoints v]\ndelete all of [achievements v]\nbroadcast (Start v)\n\nwhen I receive [start v]\nhide variable [mouse v]\nforever\n    change [time v] by (1)\nend\n\nwhen [m v] key pressed\nset [mouse v] to (join ((mouse x) + (Scroll x)) (join [,] ((mouse y) + (Scroll y))))\nshow variable [mouse v]\n\nwhen I receive [start v]\nforever\n    switch backdrop to (Level)\nend\n\nwhen I receive [start v]\nset volume to (50) %\nforever\n    play sound [Super World v] until done\nend\n\nwhen I receive [start v]\nforever\n    set [score v] to (round (((Coins) * (100)) - (time)))\n    if <(Score) < [0]> then\n        set [score v] to [0]\n    end\nend\n\nwhen I receive [start v]\nforever\n    if <not <(Level) = [4]>> then\n        change [time v] by (1)\n        wait (1) seconds\n    else\n        stop [this script v]\n    end\nend\n\n@Blank\n\n@Player\n\nwhen I receive [start v]\nset [checkpoint x v] to [-199]\nset [checkpoint y v] to [-102]\nset size to (50) %\nbroadcast (Green Flag v) and wait\nbroadcast (Play Game v) and wait\n\ndefine Game On\nset [hurt v] to [No]\nset [health v] to [182]\nbroadcast (Transition_1 v)\nset [x v] to (Checkpoint x)\nset [y v] to (Checkpoint y)\nset [sx v] to [0]\nset [sy v] to [0]\nset [in air v] to [0]\nset [finish v] to []\nset [scroll x v] to [0]\nset [scroll y v] to [0]\nset [falling? v] to [10]\npoint in direction (90)\nshow\n\ndefine Tick\nswitch costume to (hitbox v)\nif <<<<key (a v) pressed?> or <key (left arrow v) pressed?>> or <key (4 v) pressed?>> or <<(mouse x) < (x position)> and <mouse down?>>> then\n    point in direction (-90)\n    change [sx v] by (-1.5)\nelse\n    if <<<<key (d v) pressed?> or <key (right arrow v) pressed?>> or <key (6 v) pressed?>> or <<(mouse x) > (x position)> and <mouse down?>>> then\n        point in direction (90)\n        change [sx v] by (1.5)\n    else\n        set [frames v] to [0]\n    end\nend\nset [sx v] to ((sx) * (0.8))\nif <([abs v] of (sx) ) > [0.9]> then\n    Change Player x by (round (sx))\nend\nif <<<<key (w v) pressed?> or <key (up arrow v) pressed?>> or <key (8 v) pressed?>> or <<(mouse y) > (y position)> and <mouse down?>>> then\n    if <(in air) < [4]> then\n        set [sy v] to [12]\n        set [falling? v] to [6]\n        set [jump key v] to [1]\n    end\nelse\n    set [jump key v] to [0]\nend\nif <(sy) > [-20]> then\n    change [sy v] by (-1)\nend\nChange Player y by (sy)\nSet Costume\nDie\nPosition\nset [scroll x v] to (x)\nchange [scroll x v] by (round (((x) - (Scroll x)) / (10)))\nif <(Scroll x) > [6825]> then\n    set [scroll x v] to [6825]\nend\nif <(Scroll x) < [0]> then\n    set [scroll x v] to [0]\nend\nchange [scroll y v] by (round (((y) - (Scroll y)) / (10)))\nif <(Scroll y) < [0]> then\n    set [scroll y v] to [0]\nend\nif <(x) < [-244]> then\n    set [x v] to [-244]\nend\nif <(x) > [7068]> then\n    set [finish v] to [Yes]\nend\nif <(Level) = [4]> then\n    if <(Scroll x) > [0]> then\n        set [scroll x v] to [0]\n    end\n    if <(x) > [244]> then\n        set [x v] to [244]\n    end\nend\n\nwhen I receive [green flag v]\nhide\ngo to [front v] layer\n\nwhen I receive [play game v]\nforever\n    broadcast (Reset v) and wait\n    broadcast (Setup v) and wait\n    Game On\n    repeat until <(Finish) > []>\n        Tick\n        Position\n        broadcast (Tick v)\n    end\n    if <(Finish) = [Yes]> then\n        Game Con\n    else\n        Game End\n    end\nend\n\ndefine Change Player y by (sy)\nchange [y v] by (sy)\nchange [in air v] by (1)\nchange [falling? v] by (1)\nPosition\nrepeat until <not <touching (platform v)?>>\n    if <(sy) > [0]> then\n        change [y v] by (-1)\n    else\n        change [y v] by (1)\n        set [in air v] to [0]\n        set [falling? v] to [0]\n    end\n    Position\n    set [sy v] to [0]\nend\nchange [frames v] by (0.5)\n\ndefine Position\ngo to x: ((x) - (Scroll x)) y: ((y) - (Scroll y))\n\ndefine Change Player x by (sx)\nchange [x v] by (sx)\nPosition\nif <touching (platform v)?> then\n    repeat (12)\n        change [y v] by (1)\n        Position\n        if <not <touching (platform v)?>> then\n            stop [this script v]\n        end\n    end\n    change [y v] by (-12)\n    repeat until <not <touching (platform v)?>>\n        if <(sx) > [0]> then\n            change [x v] by (-1)\n        else\n            change [x v] by (1)\n        end\n        Position\n    end\nend\n\ndefine Game End\nrepeat (2)\n    hide\n    wait (0.05) seconds\n    show\n    wait (0.05) seconds\nend\nbroadcast (Transition_2 v)\nwait (1) seconds\nhide\n\ndefine Die\nif <touching (danger v)?> then\n    set [finish v] to [Die]\nend\nif <touching (saw v)?> then\n    if <(Hurt) = [No]> then\n        set [hurt v] to [Yes]\n        change [health v] by (20)\n    end\nend\n\ndefine Game Con\ndelete all of [checkpoints v]\nset [checkpoint x v] to [-199]\nset [checkpoint y v] to [-102]\nchange [level v] by (1)\nGame On\n\nwhen I receive [bounce v]\nset [sy v] to [14]\n\nwhen I receive [start v]\nbroadcast (DeleteClone v) and wait\nbroadcast (CreateClone v) and wait\n\ndefine Set Costume\nif <(falling?) < [6]> then\n    if <<(frames) = [0.5]> or <(frames) = [0]>> then\n        switch costume to (stand v)\n    else\n        switch costume to ([floor v] of ((2) + ((frames) mod (15))) )\n    end\nelse\n    if <(sy) > [0]> then\n        switch costume to (jump v)\n    else\n        switch costume to (jump v)\n    end\nend\n\nwhen I receive [start v]\nforever\n    if <(Hurt) = [Yes]> then\n        repeat (10)\n            set [brightness v] effect to (20)\n            wait (0.1) seconds\n            set [brightness v] effect to (0)\n            wait (0.1) seconds\n        end\n        set [hurt v] to [No]\n    else\n        set [brightness v] effect to (0)\n    end\nend\n\nwhen I receive [up v]\nset [sy v] to [16]\n\n@Platform\n\nwhen flag clicked\nhide\n\nwhen I receive [start v]\nforever\n    if <(Sounds) = [0]> then\n        set volume to (50) %\n    else\n        set volume to (0) %\n    end\nend\n\nwhen I receive [win v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen I receive [green flag v]\nshow\n\nwhen I receive [tick v]\nPosition ((x) - (Scroll x)) ((y) - (Scroll y))\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\ndefine Clone at x: (x) y: (y)\ncreate clone of (_myself_ v)\nnext costume\nchange [x v] by (x)\nchange [y v] by (y)\n\nwhen I receive [setup v]\nhide\nset [x v] to [0]\nset [y v] to [0]\nif <(Level) = [1]> then\n    switch costume to (level1_1 v)\n    Clone at x: [486] y: [0]\n    Clone at x: [486] y: [0]\n    Clone at x: [486] y: [0]\n    Clone at x: [486] y: [0]\n    Clone at x: [486] y: [0]\n    Clone at x: [486] y: [0]\n    Clone at x: [486] y: [0]\n    Clone at x: [486] y: [0]\n    Clone at x: [486] y: [0]\n    Clone at x: [486] y: [0]\n    Clone at x: [486] y: [0]\n    Clone at x: [486] y: [0]\n    Clone at x: [486] y: [0]\n    Clone at x: [486] y: [0]\nelse\n    if <(Level) = [2]> then\n        switch costume to (level2_1 v)\n        Clone at x: [486] y: [0]\n        Clone at x: [486] y: [0]\n        Clone at x: [486] y: [0]\n        Clone at x: [486] y: [0]\n        Clone at x: [486] y: [0]\n        Clone at x: [486] y: [0]\n        Clone at x: [486] y: [0]\n        Clone at x: [486] y: [0]\n        Clone at x: [486] y: [0]\n        Clone at x: [486] y: [0]\n        Clone at x: [486] y: [0]\n        Clone at x: [486] y: [0]\n        Clone at x: [486] y: [0]\n        Clone at x: [486] y: [0]\n    else\n        if <(Level) = [3]> then\n            switch costume to (level3_1 v)\n            Clone at x: [486] y: [0]\n            Clone at x: [486] y: [0]\n            Clone at x: [486] y: [0]\n            Clone at x: [486] y: [0]\n            Clone at x: [486] y: [0]\n            Clone at x: [486] y: [0]\n            Clone at x: [486] y: [0]\n            Clone at x: [486] y: [0]\n            Clone at x: [486] y: [0]\n            Clone at x: [486] y: [0]\n            Clone at x: [486] y: [0]\n            Clone at x: [486] y: [0]\n            Clone at x: [486] y: [0]\n            Clone at x: [486] y: [0]\n        else\n            switch costume to (level4_1 v)\n        end\n    end\nend\n\nwhen I receive [reset v]\ndelete this clone\n\n@Danger\n\nwhen flag clicked\nhide\n\nwhen I receive [win v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen I start as a clone\nforever\n    set [ghost v] effect to (20)\n    go to [back v] layer\n    go [forward v] (1) layers\n    point in direction ((([sin v] of ((Time) * (2)) ) * (2)) + (90))\nend\n\nwhen I receive [green flag v]\nshow\n\nwhen I receive [tick v]\nPosition ((x) - (Scroll x)) ((y) - (Scroll y))\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\ndefine Clone at x: (x) y: (y) type: (type)\nset [x v] to (x)\nset [y v] to (y)\nswitch costume to (type)\ncreate clone of (_myself_ v)\nset [x v] to [-99999]\n\nwhen I receive [setup v]\nhide\nif <(Level) = [1]> then\n    Clone at x: [72] y: [-274] type: [2]\n    Clone at x: [1287] y: [-274] type: [2]\n    Clone at x: [2261] y: [-274] type: [2]\n    Clone at x: [2453] y: [-274] type: [2]\n    Clone at x: [2645] y: [-274] type: [2]\n    Clone at x: [3211] y: [-274] type: [2]\n    Clone at x: [3915] y: [-274] type: [3]\n    Clone at x: [4300] y: [-105] type: [2]\n    Clone at x: [5840] y: [-110] type: [2]\n    Clone at x: [5970] y: [-110] type: [2]\n    Clone at x: [6109] y: [-110] type: [2]\n    Clone at x: [6240] y: [-110] type: [2]\n    Clone at x: [6745] y: [-170] type: [2]\nelse\n    if <(Level) = [2]> then\n        Clone at x: [530] y: [-205] type: [2]\n        Clone at x: [1065] y: [-285] type: [3]\n        Clone at x: [2336] y: [-230] type: [3]\n        Clone at x: [2596] y: [-230] type: [3]\n        Clone at x: [2860] y: [-230] type: [3]\n        Clone at x: [4795] y: [-274] type: [2]\n        Clone at x: [5550] y: [-205] type: [3]\n    else\n        if <(Level) = [3]> then\n            Clone at x: [1356] y: [-274] type: [2]\n            Clone at x: [3300] y: [-274] type: [2]\n            Clone at x: [3776] y: [-170] type: [2]\n            Clone at x: [4767] y: [-180] type: [2]\n            Clone at x: [5720] y: [-274] type: [2]\n            Clone at x: [5880] y: [-274] type: [2]\n            Clone at x: [6088] y: [-280] type: [3]\n        end\n    end\nend\n\nwhen I receive [reset v]\ndelete this clone\n\n@Checkpoint\n\nwhen I receive [tick v]\nposition ((x) - (Scroll x)) ((y) - (Scroll y))\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\ndefine Clone at x: (x) y: (y)\nset [x v] to (x)\nset [y v] to (y)\ngo to [back v] layer\ncreate clone of (_myself_ v)\n\nwhen I receive [setup v]\nhide\nset [x v] to [0]\nset [y v] to [0]\nif <(Level) = [1]> then\n    set [checkpoint# v] to [1]\n    Clone at x: [1525] y: [-90]\n    set [checkpoint# v] to [2]\n    Clone at x: [4506] y: [84]\nelse\n    if <(Level) = [2]> then\n        set [checkpoint# v] to [1]\n        Clone at x: [1824] y: [-90]\n        set [checkpoint# v] to [2]\n        Clone at x: [4140] y: [-90]\n    else\n        if <(Level) = [3]> then\n            set [checkpoint# v] to [1]\n            Clone at x: [2114] y: [-90]\n            set [checkpoint# v] to [2]\n            Clone at x: [4529] y: [-90]\n        end\n    end\nend\nset [x v] to [-99999]\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen flag clicked\nswitch costume to (1 v)\n\nwhen I receive [win v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen I start as a clone\nforever\n    if <[checkpoints v] contains (checkpoint#)?> then\n        switch costume to (2 v)\n    else\n        switch costume to (1 v)\n    end\n    if <touching (player v)?> then\n        if <not <[checkpoints v] contains (checkpoint#)?>> then\n            set [checkpoint x v] to ((x) - (7))\n            set [checkpoint y v] to ((y) - (13))\n            broadcast (Checkpoint v)\n            if <not <[checkpoints v] contains (checkpoint#)?>> then\n                add (checkpoint#) to [checkpoints v]\n            end\n        end\n    end\nend\n\n@Deco\n\nwhen flag clicked\nhide\n\nwhen I receive [start v]\nforever\n    if <(Sounds) = [0]> then\n        set volume to (50) %\n    else\n        set volume to (0) %\n    end\nend\n\nwhen I receive [win v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen I receive [green flag v]\nshow\n\nwhen I receive [tick v]\ngo to [back v] layer\nPosition ((x) - (Scroll x)) ((y) - (Scroll y))\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\ndefine Clone at x: (x) y: (y)\ncreate clone of (_myself_ v)\nnext costume\nchange [x v] by (x)\nchange [y v] by (y)\n\nwhen I receive [setup v]\nhide\nset [x v] to [0]\nset [y v] to [0]\nif <(Level) = [1]> then\n    switch costume to (level1_1 v)\n    Clone at x: [486] y: [0]\n    Clone at x: [486] y: [0]\n    Clone at x: [486] y: [0]\n    Clone at x: [486] y: [0]\n    Clone at x: [486] y: [0]\n    Clone at x: [486] y: [0]\n    Clone at x: [486] y: [0]\n    Clone at x: [486] y: [0]\n    Clone at x: [486] y: [0]\n    Clone at x: [486] y: [0]\n    Clone at x: [486] y: [0]\n    Clone at x: [486] y: [0]\n    Clone at x: [486] y: [0]\n    Clone at x: [486] y: [0]\nelse\n    if <(Level) = [2]> then\n        switch costume to (level2_1 v)\n        Clone at x: [486] y: [0]\n        Clone at x: [486] y: [0]\n        Clone at x: [486] y: [0]\n        Clone at x: [486] y: [0]\n        Clone at x: [486] y: [0]\n        Clone at x: [486] y: [0]\n        Clone at x: [486] y: [0]\n        Clone at x: [486] y: [0]\n        Clone at x: [486] y: [0]\n        Clone at x: [486] y: [0]\n        Clone at x: [486] y: [0]\n        Clone at x: [486] y: [0]\n        Clone at x: [486] y: [0]\n        Clone at x: [486] y: [0]\n    else\n        if <(Level) = [3]> then\n            switch costume to (level3_1 v)\n            Clone at x: [486] y: [0]\n            Clone at x: [486] y: [0]\n            Clone at x: [486] y: [0]\n            Clone at x: [486] y: [0]\n            Clone at x: [486] y: [0]\n            Clone at x: [486] y: [0]\n            Clone at x: [486] y: [0]\n            Clone at x: [486] y: [0]\n            Clone at x: [486] y: [0]\n            Clone at x: [486] y: [0]\n            Clone at x: [486] y: [0]\n            Clone at x: [486] y: [0]\n            Clone at x: [486] y: [0]\n            Clone at x: [486] y: [0]\n        else\n            switch costume to (level4_1 v)\n        end\n    end\nend\n\nwhen I receive [reset v]\ndelete this clone\n\n@Enemy\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\ndefine Clone at x: (x) y: (y) speed: (speed) distance: (distance) type: (type)\nset [x v] to (x)\nset [y v] to (y)\nset [speed v] to (speed)\nset [distance v] to (distance)\nset [type v] to (type)\ngo to [front v] layer\ncreate clone of (_myself_ v)\nset [x v] to [-99999]\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen I receive [setup v]\nset [time v] to [0]\nif <(Level) = [1]> then\n    Clone at x: [527] y: [-40] speed: [2] distance: [55] type: [1]\n    Clone at x: [937] y: [-30] speed: [2.5] distance: [50] type: [1]\n    Clone at x: [1715] y: [-130] speed: [2] distance: [110] type: [1]\n    Clone at x: [2974] y: [-130] speed: [2] distance: [110] type: [1]\n    Clone at x: [2974] y: [-130] speed: [2] distance: [-110] type: [2]\n    Clone at x: [3627] y: [-130] speed: [2] distance: [100] type: [1]\n    Clone at x: [3627] y: [-130] speed: [2] distance: [-100] type: [2]\n    Clone at x: [4778] y: [44] speed: [2] distance: [-150] type: [2]\n    Clone at x: [4778] y: [44] speed: [2] distance: [150] type: [1]\n    Clone at x: [4800] y: [44] speed: [1] distance: [300] type: [1]\n    Clone at x: [5200] y: [-8] speed: [2] distance: [75] type: [1]\n    Clone at x: [5200] y: [-8] speed: [2] distance: [-75] type: [2]\n    Clone at x: [5400] y: [-44] speed: [2.5] distance: [75] type: [1]\n    Clone at x: [6476] y: [-28] speed: [3] distance: [110] type: [1]\n    Clone at x: [6476] y: [-28] speed: [3] distance: [-110] type: [2]\nelse\n    if <(Level) = [2]> then\n        Clone at x: [80] y: [-130] speed: [3] distance: [-110] type: [2]\n        Clone at x: [80] y: [-130] speed: [3] distance: [110] type: [1]\n        Clone at x: [350] y: [-62] speed: [3] distance: [70] type: [1]\n        Clone at x: [1855] y: [-130] speed: [1] distance: [270] type: [1]\n        Clone at x: [1855] y: [-130] speed: [1] distance: [-270] type: [2]\n        Clone at x: [1680] y: [-130] speed: [2] distance: [90] type: [1]\n        Clone at x: [1960] y: [-130] speed: [2] distance: [-90] type: [2]\n        Clone at x: [3310] y: [10] speed: [2] distance: [-110] type: [2]\n        Clone at x: [3310] y: [10] speed: [2] distance: [110] type: [1]\n        Clone at x: [3857] y: [-130] speed: [1] distance: [240] type: [1]\n        Clone at x: [3857] y: [-130] speed: [1] distance: [-240] type: [2]\n        Clone at x: [4417] y: [-130] speed: [1] distance: [-240] type: [2]\n        Clone at x: [4417] y: [-130] speed: [1] distance: [240] type: [1]\n        Clone at x: [5364] y: [-40] speed: [2] distance: [-90] type: [2]\n        Clone at x: [5364] y: [-40] speed: [2] distance: [90] type: [1]\n        Clone at x: [6390] y: [-130] speed: [2] distance: [80] type: [1]\n        Clone at x: [6586] y: [-130] speed: [2] distance: [-80] type: [2]\n        Clone at x: [6884] y: [-130] speed: [2] distance: [80] type: [1]\n        Clone at x: [6390] y: [-130] speed: [2] distance: [-80] type: [2]\n        Clone at x: [6586] y: [-130] speed: [2] distance: [80] type: [1]\n        Clone at x: [6884] y: [-130] speed: [2] distance: [-80] type: [2]\n    else\n        if <(Level) = [3]> then\n            Clone at x: [509] y: [-19] speed: [2] distance: [-80] type: [2]\n            Clone at x: [700] y: [-130] speed: [2] distance: [70] type: [1]\n            Clone at x: [2110] y: [-130] speed: [2] distance: [150] type: [1]\n            Clone at x: [2110] y: [-130] speed: [2] distance: [-150] type: [2]\n            Clone at x: [3540] y: [-25] speed: [2] distance: [-100] type: [2]\n            Clone at x: [3540] y: [-25] speed: [2] distance: [100] type: [1]\n            Clone at x: [5288] y: [-75] speed: [2] distance: [80] type: [1]\n            Clone at x: [5288] y: [-75] speed: [2] distance: [-80] type: [2]\n            Clone at x: [6623] y: [-62] speed: [2] distance: [-100] type: [2]\n            Clone at x: [6623] y: [-62] speed: [2] distance: [100] type: [1]\n        end\n    end\nend\n\nwhen I receive [tick v]\nPosition (((x) - (Scroll x)) + (([cos v] of ((Time) * (speed)) ) * (distance))) ((y) - (Scroll y))\nset [check_direction v] to (round (([cos v] of ((Time) * (speed)) ) * (distance)))\nif <(type) = [1]> then\n    if <(check_direction) = ((distance) * (-1))> then\n        point in direction (90)\n    end\n    if <(check_direction) = (distance)> then\n        point in direction (-90)\n    end\nelse\n    if <(check_direction) = ((distance) * (-1))> then\n        point in direction (-90)\n    end\n    if <(check_direction) = (distance)> then\n        point in direction (90)\n    end\nend\nif <touching (player v)?> then\n    if <<([y position v] of [player v]) > (y position)> and <([sy v] of [player v]) < [-1]>> then\n        stop [other scripts in sprite v]\n        broadcast (Bounce v)\n        start sound [Hit v]\n        add (x position) to [killed v]\n        add (y position) to [killed v]\n        change [kills v] by (1)\n        broadcast (Death v)\n        delete this clone\n    else\n        if <(Hurt) = [No]> then\n            set [hurt v] to [Yes]\n            change [health v] by (15)\n        end\n    end\nend\n\nwhen I start as a clone\nswitch costume to (walk1 v)\nforever\n    next costume\nend\n\n@fx\n\nwhen I receive [death v]\ngo to x: (item (1) of [killed v]) y: ((item (2) of [killed v]) + (50))\nexplosion\n\ndefine explosion\nrepeat (20)\n    create clone of (_myself_ v)\nend\n\nwhen flag clicked\ndelete all of [killed v]\nhide\n\nwhen I start as a clone\nshow\ngo to [front v] layer\nset [s v] to (pick random (2) to (10))\npoint in direction (pick random (0) to (360))\nclear graphic effects\nset size to (pick random (50) to (100)) %\nrepeat (15)\n    change y by (-5)\n    change size by (-5)\n    change [ghost v] effect by (5)\n    move (s) steps\n    if <(s) > [.5]> then\n        change [s v] by (-.5)\n    end\nend\ndelete this clone\n\n@Saw\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\ndefine Clone at x: (x) y: (y) speed: (speed) distance: (distance)\nset [x v] to (x)\nset [y v] to (y)\nset [speed v] to (speed)\nset [distance v] to (distance)\ngo to [front v] layer\ncreate clone of (_myself_ v)\nset [x v] to [-99999]\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen I receive [setup v]\nif <(Level) = [1]> then\n    Clone at x: [1111] y: [-132] speed: [2] distance: [0]\n    Clone at x: [1985] y: [-76] speed: [3] distance: [100]\n    Clone at x: [1985] y: [-76] speed: [3] distance: [-100]\n    Clone at x: [3900] y: [-60] speed: [3] distance: [-100]\n    Clone at x: [3900] y: [-60] speed: [3] distance: [100]\nelse\n    if <(Level) = [2]> then\n        Clone at x: [770] y: [-62] speed: [4] distance: [100]\n        Clone at x: [770] y: [-62] speed: [4] distance: [-100]\n        Clone at x: [1466] y: [-33] speed: [5] distance: [60]\n        Clone at x: [2208] y: [-66] speed: [3] distance: [0]\n        Clone at x: [2474] y: [-66] speed: [3] distance: [0]\n        Clone at x: [2724] y: [-68] speed: [3] distance: [0]\n        Clone at x: [2990] y: [-80] speed: [3] distance: [0]\n        Clone at x: [3080] y: [-80] speed: [3] distance: [0]\n        Clone at x: [5074] y: [-132] speed: [4] distance: [110]\n        Clone at x: [5074] y: [-132] speed: [4] distance: [-110]\n        Clone at x: [5738] y: [-40] speed: [3] distance: [0]\n        Clone at x: [5874] y: [-40] speed: [3] distance: [0]\n        Clone at x: [6012] y: [-40] speed: [3] distance: [0]\n        Clone at x: [6148] y: [-40] speed: [3] distance: [0]\n        Clone at x: [3860] y: [6] speed: [5] distance: [-120]\n        Clone at x: [3860] y: [6] speed: [5] distance: [120]\n    else\n        if <(Level) = [3]> then\n            Clone at x: [268] y: [-132] speed: [5] distance: [-100]\n            Clone at x: [268] y: [-132] speed: [5] distance: [100]\n            Clone at x: [1740] y: [1] speed: [4] distance: [-120]\n            Clone at x: [1740] y: [1] speed: [4] distance: [120]\n            Clone at x: [2490] y: [-40] speed: [5] distance: [120]\n            Clone at x: [2768] y: [-40] speed: [5] distance: [-120]\n            Clone at x: [2490] y: [-132] speed: [4] distance: [-120]\n            Clone at x: [2768] y: [-132] speed: [4] distance: [-120]\n            Clone at x: [4019] y: [-30] speed: [4] distance: [120]\n            Clone at x: [4019] y: [-30] speed: [4] distance: [-120]\n            Clone at x: [4913] y: [-132] speed: [6] distance: [25]\n            Clone at x: [4357] y: [-132] speed: [4] distance: [90]\n            Clone at x: [4357] y: [-132] speed: [4] distance: [-90]\n            Clone at x: [6331] y: [-132] speed: [5] distance: [-90]\n        end\n    end\nend\n\nwhen I receive [tick v]\ngo to [back v] layer\ngo [forward v] (1) layers\nPosition (((x) - (Scroll x)) + (([cos v] of ((Time) * (speed)) ) * (distance))) ((y) - (Scroll y))\n\nwhen I start as a clone\nforever\n    turn right ((speed) + (5)) degrees\nend\n\n@Notification\n\ndefine Change x by: (x)\nchange x by (((x) - (x position)) / (4))\n\nwhen I receive [checkpoint v]\nstart sound [mixkit-fairy-arcade-sparkle-866 v]\nset [type v] to [1]\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nset [hide v] to [1]\nwait (1.5) seconds\nset [hide v] to [0]\n\nwhen I start as a clone\nset x to (-310)\nset y to (125)\nset size to (90) %\nshow\nif <(type) = [1]> then\n    forever\n        switch costume to (2 v)\n        if <(hide) = [1]> then\n            Change x by: [-186]\n        else\n            Change x by: [-310]\n        end\n    end\nelse\n    forever\n        switch costume to (1 v)\n        if <(hide) = [1]> then\n            Change x by: [-173]\n        else\n            Change x by: [-310]\n        end\n    end\nend\n\nwhen I receive [achievement v]\nstart sound [mixkit-unlock-game-notification-253 v]\nset [type v] to [2]\ncreate clone of (_myself_ v)\n\n@Transitions\n\nwhen I receive [transition_1 v]\ngo to x: (0) y: (0)\ngo to [front v] layer\nswitch costume to (costume1 v)\nset size to (100) %\nshow\nrepeat (5)\n    switch costume to (costume7 v)\n    set size to ((size) * (1.2)) %\n    switch costume to (costume2 v)\nend\nset size to ((size) * (0.5)) %\nrepeat (2)\n    switch costume to (costume7 v)\n    set size to ((size) * (1.2)) %\n    switch costume to (costume3 v)\nend\nrepeat (2)\n    switch costume to (costume7 v)\n    set size to ((size) * (1.2)) %\n    switch costume to (costume4 v)\nend\nrepeat (3)\n    switch costume to (costume7 v)\n    set size to ((size) * (1.2)) %\n    switch costume to (costume5 v)\nend\nrepeat (5)\n    switch costume to (costume7 v)\n    set size to ((size) * (1.2)) %\n    switch costume to (costume6 v)\nend\nhide\n\nwhen I receive [transition_2 v]\ngo to x: (0) y: (0)\ngo to [front v] layer\nswitch costume to (costume7 v)\nset size to (1116) %\nswitch costume to (costume6 v)\nshow\nrepeat (4)\n    switch costume to (costume7 v)\n    set size to ((size) / (1.2)) %\n    switch costume to (costume6 v)\nend\nrepeat (3)\n    switch costume to (costume7 v)\n    set size to ((size) / (1.2)) %\n    switch costume to (costume5 v)\nend\nrepeat (2)\n    switch costume to (costume7 v)\n    set size to ((size) / (1.2)) %\n    switch costume to (costume4 v)\nend\nrepeat (2)\n    switch costume to (costume7 v)\n    set size to ((size) / (1.2)) %\n    switch costume to (costume3 v)\nend\nswitch costume to (costume7 v)\nset size to (250) %\nrepeat (5)\n    switch costume to (costume7 v)\n    set size to ((size) / (1.2)) %\n    switch costume to (costume2 v)\nend\nswitch costume to (costume1 v)\nset size to (100) %\n\nwhen I receive [start v]\ncreate clone of (_myself_ v)\n\n@Health Bar\n\nwhen I receive [start v]\nset [# v] to [0]\nrepeat (2)\n    change [# v] by (1)\n    create clone of (_myself_ v)\nend\nshow\nforever\n    if <not <(Level) = [4]>> then\n        go to x: (-182) y: (155)\n        set size to (60) %\n        set [ghost v] effect to (40)\n        switch costume to (1a v)\n        go to [front v] layer\n        go [backward v] (8) layers\n    else\n        hide\n        stop [this script v]\n    end\nend\n\nwhen I start as a clone\nforever\n    if <not <(Level) = [4]>> then\n        if <(#) = [1]> then\n            change x by: ((Health) * (-1))\n            set y to (155)\n            show\n            set size to (60) %\n            switch costume to (1b v)\n            go to [front v] layer\n            go [backward v] (6) layers\n            if <(Health) > [259]> then\n                set [finish v] to [No]\n            end\n        else\n            go to x: (-182) y: (155)\n            show\n            set size to (60) %\n            switch costume to (Level)\n            go to [front v] layer\n            go [backward v] (5) layers\n        end\n    else\n        hide\n        delete this clone\n    end\nend\n\ndefine change x by: (x)\nchange x by (((x) - (x position)) / (4))\n\n@Collectable\n\ndefine Clone at x: (x) y: (y) type: (type) num: (num)\nset [x v] to (x)\nset [y v] to (y)\nset [num v] to (num)\nswitch costume to (type)\ngo to [front v] layer\ncreate clone of (_myself_ v)\nif <(dir) = [1]> then\n    set [dir v] to [-1]\nelse\n    set [dir v] to [1]\nend\nset [x v] to [-99999]\n\nwhen I receive [tick v]\ngo to [back v] layer\ngo [forward v] (10) layers\nPosition ((x) - (Scroll x)) ((y) - (Scroll y))\nif <touching (player v)?> then\n    start sound [collect v]\n    change [coins v] by (1)\n    add (join (join (Level) [_]) (num)) to [collected v]\n    delete this clone\nend\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen I receive [setup v]\nset [dir v] to [1]\nif <(Level) = [1]> then\n    Clone at x: [18] y: [-72] type: [1] num: [1]\n    Clone at x: [62] y: [-30] type: [1] num: [2]\n    Clone at x: [107] y: [-71] type: [1] num: [3]\n    Clone at x: [270] y: [-88] type: [1] num: [4]\n    Clone at x: [297] y: [-88] type: [1] num: [5]\n    Clone at x: [325] y: [-88] type: [1] num: [6]\n    Clone at x: [506] y: [100] type: [1] num: [7]\n    Clone at x: [542] y: [100] type: [1] num: [8]\n    Clone at x: [1016] y: [150] type: [1] num: [9]\n    Clone at x: [1056] y: [150] type: [1] num: [10]\n    Clone at x: [1016] y: [120] type: [1] num: [11]\n    Clone at x: [1056] y: [120] type: [1] num: [12]\n    Clone at x: [2353] y: [2] type: [1] num: [13]\n    Clone at x: [2353] y: [-30] type: [1] num: [14]\n    Clone at x: [2553] y: [2] type: [1] num: [15]\n    Clone at x: [2553] y: [-30] type: [1] num: [16]\n    Clone at x: [2753] y: [2] type: [1] num: [42]\n    Clone at x: [2753] y: [-30] type: [1] num: [43]\n    Clone at x: [3150] y: [185] type: [1] num: [17]\n    Clone at x: [3175] y: [185] type: [1] num: [18]\n    Clone at x: [3150] y: [165] type: [1] num: [19]\n    Clone at x: [3175] y: [165] type: [1] num: [20]\n    Clone at x: [3223] y: [185] type: [1] num: [21]\n    Clone at x: [3248] y: [185] type: [1] num: [22]\n    Clone at x: [3223] y: [165] type: [1] num: [23]\n    Clone at x: [3248] y: [165] type: [1] num: [24]\n    Clone at x: [3888] y: [11] type: [1] num: [25]\n    Clone at x: [3914] y: [11] type: [1] num: [26]\n    Clone at x: [4100] y: [80] type: [1] num: [27]\n    Clone at x: [4190] y: [80] type: [1] num: [28]\n    Clone at x: [5550] y: [-76] type: [1] num: [29]\n    Clone at x: [5620] y: [-76] type: [1] num: [30]\n    Clone at x: [5550] y: [-40] type: [1] num: [31]\n    Clone at x: [5620] y: [-40] type: [1] num: [32]\n    Clone at x: [5585] y: [9] type: [1] num: [33]\n    Clone at x: [5910] y: [136] type: [1] num: [34]\n    Clone at x: [5910] y: [116] type: [1] num: [35]\n    Clone at x: [6043] y: [136] type: [1] num: [36]\n    Clone at x: [6043] y: [116] type: [1] num: [37]\n    Clone at x: [6180] y: [136] type: [1] num: [38]\n    Clone at x: [6180] y: [116] type: [1] num: [39]\n    Clone at x: [6314] y: [136] type: [1] num: [40]\n    Clone at x: [6314] y: [116] type: [1] num: [41]\nelse\n    if <(Level) = [2]> then\n        Clone at x: [-14] y: [-4] type: [1] num: [1]\n        Clone at x: [11] y: [-4] type: [1] num: [2]\n        Clone at x: [11] y: [-22] type: [1] num: [4]\n        Clone at x: [-14] y: [-22] type: [1] num: [3]\n        Clone at x: [262] y: [68] type: [1] num: [5]\n        Clone at x: [292] y: [88] type: [1] num: [6]\n        Clone at x: [322] y: [68] type: [1] num: [7]\n        Clone at x: [352] y: [88] type: [1] num: [8]\n        Clone at x: [382] y: [68] type: [1] num: [9]\n        Clone at x: [412] y: [88] type: [1] num: [10]\n        Clone at x: [442] y: [68] type: [1] num: [11]\n        Clone at x: [1252] y: [-54] type: [1] num: [12]\n        Clone at x: [1252] y: [-34] type: [1] num: [13]\n        Clone at x: [1276] y: [-54] type: [1] num: [14]\n        Clone at x: [1276] y: [-34] type: [1] num: [15]\n        Clone at x: [1302] y: [-54] type: [1] num: [16]\n        Clone at x: [1302] y: [-34] type: [1] num: [17]\n        Clone at x: [1656] y: [-50] type: [1] num: [18]\n        Clone at x: [1680] y: [-50] type: [1] num: [19]\n        Clone at x: [1936] y: [-50] type: [1] num: [20]\n        Clone at x: [1960] y: [-50] type: [1] num: [21]\n        Clone at x: [2208] y: [38] type: [1] num: [22]\n        Clone at x: [2208] y: [18] type: [1] num: [23]\n        Clone at x: [2472] y: [18] type: [1] num: [25]\n        Clone at x: [2472] y: [38] type: [1] num: [24]\n        Clone at x: [2722] y: [38] type: [1] num: [27]\n        Clone at x: [2722] y: [18] type: [1] num: [26]\n        Clone at x: [3035] y: [-35] type: [1] num: [28]\n        Clone at x: [3035] y: [-2] type: [1] num: [29]\n        Clone at x: [3035] y: [29] type: [1] num: [30]\n        Clone at x: [3260] y: [125] type: [1] num: [31]\n        Clone at x: [3230] y: [125] type: [1] num: [32]\n        Clone at x: [3230] y: [100] type: [1] num: [33]\n        Clone at x: [3260] y: [100] type: [1] num: [34]\n        Clone at x: [3412] y: [125] type: [1] num: [35]\n        Clone at x: [3442] y: [125] type: [1] num: [37]\n        Clone at x: [3412] y: [100] type: [1] num: [36]\n        Clone at x: [3442] y: [100] type: [1] num: [38]\n        Clone at x: [4336] y: [100] type: [1] num: [39]\n        Clone at x: [4370] y: [100] type: [1] num: [40]\n        Clone at x: [4482] y: [100] type: [1] num: [41]\n        Clone at x: [4518] y: [100] type: [1] num: [42]\n        Clone at x: [4353] y: [132] type: [1] num: [43]\n        Clone at x: [4500] y: [132] type: [1] num: [44]\n        Clone at x: [5806] y: [18] type: [1] num: [45]\n        Clone at x: [5944] y: [18] type: [1] num: [46]\n        Clone at x: [6081] y: [18] type: [1] num: [47]\n        Clone at x: [6222] y: [18] type: [1] num: [48]\n        Clone at x: [5678] y: [18] type: [1] num: [49]\n        Clone at x: [4137] y: [-18] type: [1] num: [50]\n    else\n        if <(Level) = [3]> then\n            Clone at x: [-76] y: [28] type: [1] num: [1]\n            Clone at x: [-48] y: [28] type: [1] num: [2]\n            Clone at x: [-48] y: [5] type: [1] num: [3]\n            Clone at x: [-76] y: [5] type: [1] num: [4]\n            Clone at x: [400] y: [-76] type: [1] num: [5]\n            Clone at x: [400] y: [-36] type: [1] num: [6]\n            Clone at x: [134] y: [-76] type: [1] num: [7]\n            Clone at x: [134] y: [-36] type: [1] num: [8]\n            Clone at x: [1110] y: [20] type: [1] num: [9]\n            Clone at x: [1132] y: [20] type: [1] num: [10]\n            Clone at x: [1132] y: [-3] type: [1] num: [11]\n            Clone at x: [1110] y: [-3] type: [1] num: [12]\n            Clone at x: [828] y: [-84] type: [1] num: [13]\n            Clone at x: [850] y: [-84] type: [1] num: [14]\n            Clone at x: [850] y: [-106] type: [1] num: [15]\n            Clone at x: [828] y: [-106] type: [1] num: [16]\n            Clone at x: [1477] y: [90] type: [1] num: [17]\n            Clone at x: [1498] y: [90] type: [1] num: [18]\n            Clone at x: [1498] y: [70] type: [1] num: [19]\n            Clone at x: [1477] y: [70] type: [1] num: [20]\n            Clone at x: [2976] y: [-90] type: [1] num: [21]\n            Clone at x: [3013] y: [-90] type: [1] num: [22]\n            Clone at x: [3121] y: [-90] type: [1] num: [23]\n            Clone at x: [3153] y: [-90] type: [1] num: [24]\n            Clone at x: [3536] y: [64] type: [1] num: [25]\n            Clone at x: [3536] y: [36] type: [1] num: [26]\n            Clone at x: [3536] y: [92] type: [1] num: [27]\n            Clone at x: [4016] y: [64] type: [1] num: [28]\n            Clone at x: [4016] y: [36] type: [1] num: [29]\n            Clone at x: [4016] y: [92] type: [1] num: [30]\n            Clone at x: [5078] y: [-71] type: [1] num: [31]\n            Clone at x: [5078] y: [-41] type: [1] num: [32]\n            Clone at x: [5490] y: [-71] type: [1] num: [33]\n            Clone at x: [5490] y: [-41] type: [1] num: [34]\n            Clone at x: [5602] y: [135] type: [1] num: [35]\n            Clone at x: [5778] y: [135] type: [1] num: [36]\n            Clone at x: [5999] y: [135] type: [1] num: [37]\n            Clone at x: [6614] y: [100] type: [1] num: [38]\n            Clone at x: [6614] y: [75] type: [1] num: [39]\n        end\n    end\nend\n\nwhen I start as a clone\nforever\n    point in direction ((([sin v] of ((Time) * (5)) ) * ((dir) * (10))) + (90))\nend\n\nwhen I start as a clone\nif <[collected v] contains (join (join (Level) [_]) (num))?> then\n    delete this clone\nend\n\n@Engine by Zykon\n\ndefine render (text) at size (size) at x (x) y (y) bright (bright)\nset [size v] to (size)\nswitch costume to (c v)\nclear graphic effects\nset size to (size) %\nset [brightness v] effect to (bright)\ngo to x: (x) y: (y)\nset [count v] to [0]\nhide\nrepeat (length of (text))\n    if <(x position) > ((240) - ((size) * (0.2)))> then\n        set x to (x)\n        change y by ((size) * (-0.3))\n    end\n    change [count v] by (1)\n    switch costume to (letter (count) of (text))\n    set [x v] to (x position)\n    set [y v] to (y position)\n    create clone of (_myself_ v)\n    change x by ((((item (costume [number v]) of [width v]) * (size)) / (100)) + ((size) * (0.099)))\nend\nhide\n\nwhen I start as a clone\nshow\nforever\n    set x to ((x) + (offset x))\n    set y to ((y) + (offset y))\n    set size to ((offset size) + (size)) %\n    if <(costume [number v]) = [11]> then\n        clear graphic effects\n    end\nend\n\nwhen I receive [del_clones v]\ndelete this clone\n\nwhen I receive [start v]\nset [coins v] to [0]\ndelete all of [width v]\nbroadcast (del_clones v)\nforever\n    broadcast (del_clones v)\n    if <not <(Level) = [4]>> then\n        render (Coins) at size [90] at x [-102] y [146] bright [100]\n    else\n        render (join [s] (Score)) at size [90] at x [-170] y [146] bright [100]\n    end\nend\n\ndefine delete\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen flag clicked\nhide\n\n@Trampoline\n\ndefine Clone at x: (x) y: (y)\nset [x v] to (x)\nset [y v] to (y)\ngo to [front v] layer\ncreate clone of (_myself_ v)\nset [x v] to [-99999]\n\nwhen I receive [tick v]\nPosition ((x) - (Scroll x)) ((y) - (Scroll y))\nset size to (50) %\nif <touching (player v)?> then\n    if <<([y position v] of [player v]) > (y position)> and <([sy v] of [player v]) < [-1]>> then\n        broadcast (Up v)\n        switch costume to (1 v)\n        repeat (6)\n            next costume\n        end\n    end\nend\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen I receive [setup v]\nif <(Level) = [3]> then\n    Clone at x: [1562] y: [-104]\n    Clone at x: [3208] y: [-104]\nend\n\n@Thumbnail\n\nwhen flag clicked\nforever\n    go to x: (0) y: (0)\n    set [ghost v] effect to (100)\n    go to [front v] layer\n    show\nend\n\n
                              Instructions\n*Use w,a,s,d / arrow / 8456 keys to move Billy\n*Collect coins to increase score\n*Jump on enemies to eliminate them\n*Avoid water and saws\n*https://turbowarp.org/622860276/ [If it is lagging]\n\n                                     Aim\n*Help the Billy find a treasure chest