Mac & Cheese - A Platformer
@Stage\n\nwhen [m v] key pressed\nset [mouse v] to (join ((mouse x) + (SCROLL X)) (join [, ] ((mouse y) + (SCROLL Y))))\n\n@Blank\n\n@Player\n\nwhen I receive [green flag v]\nhide\ngo [backward v] (10) layers\n\nwhen I receive [play game v]\nset [level v] to [1]\nforever\n    broadcast (Reset v) and wait\n    broadcast (Setup v) and wait\n    Game On\n    repeat until <(EXIT) > []>\n        Tick\n        Tester\n        Jump Ring?\n        broadcast (Tick v)\n    end\n    if <(EXIT) = [WIN]> then\n        Game - Win\n    else\n        Game Over\n    end\nend\n\ndefine Game On\nif <(LEVEL) = [4]> then\n    set [x v] to [-10]\n    set [y v] to [-10]\nelse\n    if <(LEVEL) = [5]> then\n        set [x v] to [-26]\n        set [y v] to [-15]\n    else\n        set [x v] to [0]\n        set [y v] to [-10]\n    end\nend\nset [sx v] to [0]\nset [sy v] to [0]\nset [in air v] to [0]\nset [exit v] to []\nset size to (100) %\nshow\n\ndefine Tick\nif <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <(mouse x) < (x position)>>> then\n    if <(LEVEL) = [4]> then\n        change [sx v] by (-2.2)\n    else\n        change [sx v] by (-2.1)\n    end\nend\nif <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <(x position) < (mouse x)>>> then\n    if <(LEVEL) = [4]> then\n        change [sx v] by (2.2)\n    else\n        change [sx v] by (2.1)\n    end\nend\nset [sx v] to ((sx) * (0.801))\nif <([abs v] of (sx) ) > [0.9]> then\n    Change Player X By (round (sx))\nend\nif <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > (y position)>>> then\n    if <(in air) < [4]> then\n        if <(LEVEL) = [4]> then\n            set [sy v] to [17]\n        else\n            set [sy v] to [16]\n        end\n    end\nend\nif <not <touching (ladders v)?>> then\n    if <(sy) > [-20]> then\n        change [sy v] by (-2)\n    end\nend\nChange Player Y By (sy)\nTest - Game Over\nset [scroll x v] to (x)\nif <(SCROLL X) < [-10]> then\n    set [scroll x v] to [-10]\nend\nchange [scroll y v] by (round (((y) - (SCROLL Y)) / (10)))\nif <(SCROLL Y) < [0]> then\n    set [scroll y v] to [0]\nend\nPosition\nif <(y) < [-180]> then\n    start sound [Oops v]\n    set [exit v] to [DIE]\nend\nif <touching (bouncy v)?> then\n    if <(LEVEL) = [5]> then\n        start sound [Big Boing v]\n        set [sy v] to [25]\n    else\n        start sound [Big Boing v]\n        set [sy v] to [28]\n    end\nend\nif <touching (right v)?> then\n    change [sx v] by (1.4)\nend\nif <touching (ladders v)?> then\n    if <touching (ladders v)?> then\n        if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > (y position)>>> then\n            if <not <touching (level v)?>> then\n                set [sy v] to [8]\n            end\n        end\n    end\n    if <touching (ladders v)?> then\n        if <<<key (down arrow v) pressed?> or <key (s v) pressed?>> or <<mouse down?> and <(y position) > (mouse y)>>> then\n            if <not <touching (level v)?>> then\n                set [sy v] to [-8]\n            end\n        end\n    end\n    if <not <<<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > (y position)>>> or <<<key (down arrow v) pressed?> or <key (s v) pressed?>> or <<mouse down?> and <(y position) > (mouse y)>>>>> then\n        set [sy v] to [0]\n    end\nend\n\ndefine Change Player Y By (sy)\nchange [y v] by (sy)\nchange [in air v] by (1)\nPosition\nrepeat until <not <touching (level 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    end\n    Position\n    set [sy v] to [0]\nend\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)\nchange [in air v] by (1)\nPosition\nif <touching (level v)?> then\n    repeat (12)\n        change [y v] by (1)\n        Position\n        if <not <touching (level v)?>> then\n            stop [this script v]\n        end\n    end\n    change [y v] by (-12)\n    if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > (y position)>>> then\n        if <(sx) > [0]> then\n            set [sx v] to [-16]\n        else\n            set [sx v] to [16]\n        end\n        set [in air v] to [0]\n    else\n        set [sx v] to [0]\n    end\n    repeat until <not <touching (level 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 Over\nset [exit v] to []\nrepeat (4)\n    hide\n    wait (0.1) seconds\n    show\n    wait (0.1) seconds\nend\nhide\nwait (0.5) seconds\n\ndefine Test - Game Over\nif <touching (danger v)?> then\n    start sound [Oops v]\n    set [exit v] to [DIE]\nend\nif <touching (gears v)?> then\n    start sound [Oops v]\n    set [exit v] to [DIE]\nend\nif <touching (wheel v)?> then\n    start sound [Oops v]\n    set [exit v] to [DIE]\nend\nif <touching (pike v)?> then\n    start sound [Oops v]\n    set [exit v] to [DIE]\nend\n\ndefine Game - Win\nrepeat (50)\n    point towards (exit v)\n    turn right (65) degrees\n    move ((distance to [exit v]) / (2)) steps\n    change size by (-1)\n    change [ghost v] effect by (2)\nend\nhide\nchange [level v] by (1)\nwait (1) seconds\nclear graphic effects\n\ndefine Tester\nchange y by (-2.9)\nchange y by (1)\n\nwhen I receive [intro done v]\nbroadcast (Green Flag v) and wait\nbroadcast (Play Game v) and wait\n\ndefine Jump Ring?\nif <<touching (jump rings v)?> and <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > (y position)>>>> then\n    set [sy v] to [17]\nend\n\nwhen I receive [intro done v]\ngo to [front v] layer\n\nset [exit v] to [win]\n\n@Danger\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nPosition ((x) - (SCROLL X)) ((y) - (SCROLL 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 (level 1 1  v)\n    Clone At X: [360] Y: [0]\n    Clone At X: [360] Y: [0]\n    Clone At X: [360] Y: [0]\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (level 2 1 v)\n        Clone At X: [360] Y: [0]\n        Clone At X: [360] Y: [0]\n        Clone At X: [360] Y: [0]\n        Clone At X: [360] Y: [0]\n        Clone At X: [360] Y: [0]\n    else\n        if <(LEVEL) = [3]> then\n            switch costume to (level 3 1 v)\n            Clone At X: [360] Y: [0]\n            Clone At X: [360] Y: [0]\n            Clone At X: [360] Y: [0]\n            Clone At X: [360] Y: [0]\n            Clone At X: [360] Y: [0]\n            Clone At X: [360] Y: [0]\n            Clone At X: [360] Y: [0]\n            Clone At X: [360] Y: [0]\n            Clone At X: [360] Y: [0]\n        else\n            if <(LEVEL) = [4]> then\n                switch costume to (level 4 1 v)\n                Clone At X: [360] Y: [0]\n                Clone At X: [360] Y: [0]\n                Clone At X: [360] Y: [0]\n                Clone At X: [360] Y: [0]\n                Clone At X: [360] Y: [0]\n                Clone At X: [360] Y: [0]\n            else\n                if <(LEVEL) = [5]> then\n                    switch costume to (level 5 1 v)\n                    Clone At X: [360] Y: [0]\n                    Clone At X: [360] Y: [0]\n                    Clone At X: [360] Y: [0]\n                    Clone At X: [360] Y: [0]\n                    Clone At X: [360] Y: [0]\n                    Clone At X: [360] Y: [0]\n                    Clone At X: [360] Y: [0]\n                else\n                    if <(LEVEL) = [6]> then\n                        switch costume to (level 6 1 v)\n                        Clone At X: [360] Y: [0]\n                        Clone At X: [360] Y: [0]\n                        Clone At X: [360] Y: [0]\n                        Clone At X: [360] Y: [0]\n                        Clone At X: [360] Y: [0]\n                        Clone At X: [360] Y: [0]\n                        Clone At X: [360] Y: [30]\n                    end\n                end\n            end\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\ndefine Clone At X: (x) Y: (y)\ngo to [back v] layer\ncreate clone of (_myself_ v)\nchange [x v] by (x)\nchange [y v] by (y)\nnext costume\n\nwhen I start as a clone\n\ngo [backward v] (20) layers\n\n@Level\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nPosition ((x) - (SCROLL X)) ((y) - (SCROLL 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 (level 1 1  v)\n    Clone At X: [360] Y: [0]\n    Clone At X: [360] Y: [0]\n    Clone At X: [360] Y: [0]\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (level 2 1 v)\n        Clone At X: [360] Y: [0]\n        Clone At X: [360] Y: [0]\n        Clone At X: [360] Y: [0]\n        Clone At X: [360] Y: [0]\n        Clone At X: [360] Y: [0]\n    else\n        if <(LEVEL) = [3]> then\n            switch costume to (level 3 1 v)\n            Clone At X: [360] Y: [0]\n            Clone At X: [360] Y: [0]\n            Clone At X: [360] Y: [0]\n            Clone At X: [360] Y: [0]\n            Clone At X: [360] Y: [0]\n            Clone At X: [360] Y: [0]\n            Clone At X: [360] Y: [0]\n            Clone At X: [360] Y: [0]\n            Clone At X: [360] Y: [0]\n        else\n            if <(LEVEL) = [4]> then\n                switch costume to (level 4 1 v)\n                Clone At X: [360] Y: [0]\n                Clone At X: [360] Y: [0]\n                Clone At X: [360] Y: [0]\n                Clone At X: [360] Y: [0]\n                Clone At X: [360] Y: [0]\n                Clone At X: [360] Y: [0]\n            else\n                if <(LEVEL) = [5]> then\n                    switch costume to (level 5 1 v)\n                    Clone At X: [360] Y: [0]\n                    Clone At X: [360] Y: [0]\n                    Clone At X: [360] Y: [0]\n                    Clone At X: [360] Y: [0]\n                    Clone At X: [360] Y: [0]\n                    Clone At X: [360] Y: [0]\n                    Clone At X: [360] Y: [0]\n                else\n                    if <(LEVEL) = [6]> then\n                        switch costume to (level 6 1 v)\n                        Clone At X: [360] Y: [0]\n                        Clone At X: [360] Y: [0]\n                        Clone At X: [360] Y: [0]\n                        Clone At X: [360] Y: [0]\n                        Clone At X: [360] Y: [0]\n                        Clone At X: [360] Y: [0]\n                        Clone At X: [360] Y: [0]\n                        Clone At X: [360] Y: [0]\n                    end\n                end\n            end\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\ndefine Clone At X: (x) Y: (y)\ncreate clone of (_myself_ v)\nchange [x v] by (x)\nchange [y v] by (y)\nnext costume\n\nwhen I start as a clone\ngo [forward v] (7) layers\n\n@Text\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nPosition ((x) - (SCROLL X)) ((y) - (SCROLL 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 (level 1 1  v)\n    Clone At X: [360] Y: [0]\n    Clone At X: [360] Y: [0]\n    Clone At X: [360] Y: [0]\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (level 2 1 v)\n        Clone At X: [360] Y: [0]\n        Clone At X: [360] Y: [0]\n        Clone At X: [360] Y: [0]\n        Clone At X: [360] Y: [0]\n        Clone At X: [360] Y: [0]\n    else\n        if <(LEVEL) = [3]> then\n            switch costume to (level 3 1 v)\n            Clone At X: [360] Y: [0]\n            Clone At X: [360] Y: [0]\n            Clone At X: [360] Y: [0]\n            Clone At X: [360] Y: [0]\n            Clone At X: [360] Y: [0]\n            Clone At X: [360] Y: [0]\n            Clone At X: [360] Y: [0]\n            Clone At X: [360] Y: [0]\n            Clone At X: [360] Y: [0]\n        else\n            if <(LEVEL) = [4]> then\n                switch costume to (level 4 1 v)\n                Clone At X: [360] Y: [0]\n                Clone At X: [360] Y: [0]\n                Clone At X: [360] Y: [0]\n                Clone At X: [360] Y: [0]\n                Clone At X: [360] Y: [0]\n                Clone At X: [360] Y: [0]\n            else\n                if <(LEVEL) = [5]> then\n                    switch costume to (level 5 1 v)\n                    Clone At X: [360] Y: [0]\n                    Clone At X: [360] Y: [0]\n                    Clone At X: [360] Y: [0]\n                    Clone At X: [360] Y: [0]\n                    Clone At X: [360] Y: [0]\n                    Clone At X: [360] Y: [0]\n                    Clone At X: [360] Y: [0]\n                else\n                    if <(LEVEL) = [6]> then\n                        switch costume to (level 6 1 v)\n                        Clone At X: [360] Y: [0]\n                        Clone At X: [360] Y: [0]\n                        Clone At X: [360] Y: [0]\n                        Clone At X: [360] Y: [0]\n                        Clone At X: [360] Y: [0]\n                        Clone At X: [360] Y: [0]\n                        Clone At X: [360] Y: [0]\n                        Clone At X: [360] Y: [0]\n                    end\n                end\n            end\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\ndefine Clone At X: (x) Y: (y)\ncreate clone of (_myself_ v)\nchange [x v] by (x)\nchange [y v] by (y)\nnext costume\n\nwhen I start as a clone\ngo to [back v] layer\n\n@Ladders\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nPosition ((x) - (SCROLL X)) ((y) - (SCROLL 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 (level 1 1  v)\n    Clone At X: [360] Y: [0]\n    Clone At X: [360] Y: [0]\n    Clone At X: [360] Y: [0]\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (level 2 1 v)\n        Clone At X: [360] Y: [0]\n        Clone At X: [360] Y: [0]\n        Clone At X: [360] Y: [0]\n        Clone At X: [360] Y: [0]\n        Clone At X: [360] Y: [0]\n    else\n        if <(LEVEL) = [3]> then\n            switch costume to (level 3 1 v)\n            Clone At X: [360] Y: [0]\n            Clone At X: [360] Y: [0]\n            Clone At X: [360] Y: [0]\n            Clone At X: [360] Y: [0]\n            Clone At X: [360] Y: [0]\n            Clone At X: [360] Y: [0]\n            Clone At X: [360] Y: [0]\n            Clone At X: [360] Y: [0]\n            Clone At X: [360] Y: [0]\n        else\n            if <(LEVEL) = [4]> then\n                switch costume to (level 4 1 v)\n                Clone At X: [360] Y: [0]\n                Clone At X: [360] Y: [0]\n                Clone At X: [360] Y: [0]\n                Clone At X: [360] Y: [0]\n                Clone At X: [360] Y: [0]\n                Clone At X: [360] Y: [0]\n            else\n                if <(LEVEL) = [5]> then\n                    switch costume to (level 5 1 v)\n                    Clone At X: [360] Y: [0]\n                    Clone At X: [360] Y: [0]\n                    Clone At X: [360] Y: [0]\n                    Clone At X: [360] Y: [0]\n                    Clone At X: [360] Y: [0]\n                    Clone At X: [360] Y: [0]\n                    Clone At X: [360] Y: [0]\n                    Clone At X: [360] Y: [0]\n                else\n                    if <(LEVEL) = [6]> then\n                        switch costume to (level 6 1 v)\n                        Clone At X: [360] Y: [0]\n                        Clone At X: [360] Y: [0]\n                        Clone At X: [360] Y: [0]\n                        Clone At X: [360] Y: [0]\n                        Clone At X: [360] Y: [0]\n                        Clone At X: [360] Y: [0]\n                        Clone At X: [360] Y: [0]\n                    end\n                end\n            end\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\ndefine Clone At X: (x) Y: (y)\ncreate clone of (_myself_ v)\nchange [x v] by (x)\nchange [y v] by (y)\nnext costume\n\nwhen I start as a clone\ngo [backward v] (3) layers\n\n@Exit\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\ngo [backward v] (30) layers\nPosition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\nif <<touching (player v)?> and <(costume [name v]) = [Open]>> then\n    start sound [Teleport2 v]\n    set [exit v] to [WIN]\nend\n\nwhen I receive [setup v]\nhide\nset [collected v] to [0]\nset [x v] to [0]\nset [y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (closed v)\n    Clone At X: [1327] Y: [0]\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (closed v)\n        Clone At X: [2050] Y: [10]\n    else\n        if <(LEVEL) = [3]> then\n            switch costume to (closed v)\n            Clone At X: [2869] Y: [250]\n        else\n            if <(LEVEL) = [4]> then\n                switch costume to (closed v)\n                Clone At X: [2394] Y: [-10]\n            else\n                if <(LEVEL) = [5]> then\n                    switch costume to (closed v)\n                    Clone At X: [2750] Y: [-15]\n                else\n                    if <(LEVEL) = [6]> then\n                        switch costume to (closed v)\n                        Clone At X: [9999] Y: [-15]\n                    end\n                end\n            end\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\ndefine Clone At X: (x) Y: (y)\nshow\nset [x v] to (x)\nset [y v] to (y)\n\nwhen I receive [open portal v]\nstart sound [Doorbell v]\nswitch costume to (open v)\n\nwhen I start as a clone\nset size to (110) %\ngo [backward v] (99) layers\n\n@Collectables\n\ndefine Counter\nset [counter collect v] to (join (COLLECTED) (join [ of ] (COLLECTED MAX)))\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [setup v]\nhide\nset [collected v] to [0]\nset [collected max v] to [0]\nset [x v] to [0]\nset [y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (1 v)\n    Clone At X: [130] Y: [20]\n    Clone At X: [250] Y: [60]\n    Clone At X: [400] Y: [100]\n    Clone At X: [668] Y: [-10]\n    Clone At X: [913] Y: [10]\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (1 v)\n        Clone At X: [167] Y: [-70]\n        Clone At X: [340] Y: [-70]\n        Clone At X: [588] Y: [130]\n        Clone At X: [735] Y: [150]\n        Clone At X: [966] Y: [-70]\n        Clone At X: [1291] Y: [-60]\n        Clone At X: [1565] Y: [180]\n        Clone At X: [1760] Y: [230]\n    else\n        if <(LEVEL) = [3]> then\n            switch costume to (1 v)\n            Clone At X: [-100] Y: [-60]\n            Clone At X: [289] Y: [0]\n            Clone At X: [1066] Y: [80]\n            Clone At X: [1172] Y: [-60]\n            Clone At X: [1531] Y: [-60]\n            Clone At X: [1887] Y: [0]\n            Clone At X: [2050] Y: [-10]\n            Clone At X: [2174] Y: [10]\n            Clone At X: [2321] Y: [30]\n            Clone At X: [2481] Y: [60]\n            Clone At X: [2550] Y: [-60]\n            Clone At X: [2676] Y: [-60]\n        else\n            if <(LEVEL) = [4]> then\n                switch costume to (1 v)\n                Clone At X: [-220] Y: [110]\n                Clone At X: [136] Y: [120]\n                Clone At X: [390] Y: [40]\n                Clone At X: [451] Y: [-80]\n                Clone At X: [581] Y: [-80]\n                Clone At X: [775] Y: [-10]\n                Clone At X: [1021] Y: [-70]\n                Clone At X: [1213] Y: [-70]\n                Clone At X: [1719] Y: [15]\n                Clone At X: [1835] Y: [125]\n                Clone At X: [1980] Y: [-80]\n            else\n                if <(LEVEL) = [5]> then\n                    switch costume to (1 v)\n                    Clone At X: [90] Y: [-10]\n                    Clone At X: [-156] Y: [110]\n                    Clone At X: [86] Y: [185]\n                    Clone At X: [695] Y: [-80]\n                    Clone At X: [788] Y: [-80]\n                    Clone At X: [1365] Y: [-60]\n                    Clone At X: [1712] Y: [45]\n                    Clone At X: [1635] Y: [210]\n                    Clone At X: [1708] Y: [210]\n                    Clone At X: [1933] Y: [275]\n                    Clone At X: [2487] Y: [10]\n                else\n                    Clone At X: [-62] Y: [-50]\n                    Clone At X: [219] Y: [120]\n                    Clone At X: [377] Y: [-10]\n                    Clone At X: [571] Y: [-50]\n                    Clone At X: [728] Y: [-50]\n                    Clone At X: [893] Y: [-50]\n                    Clone At X: [1242] Y: [90]\n                    Clone At X: [1771] Y: [120]\n                    Clone At X: [2177] Y: [-30]\n                    Clone At X: [2418] Y: [-30]\n                    Clone At X: [2612] Y: [300]\n                    Clone At X: [2723] Y: [-10]\n                    Clone At X: [2973] Y: [39]\n                end\n            end\n        end\n    end\nend\nset [x v] to [-99999]\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\ndefine Clone At X: (x) Y: (y)\nset [x v] to (x)\nset [y v] to (y)\nchange [collected max v] by (1)\ncreate clone of (_myself_ v)\n\nwhen I receive [tick v]\nchange [sine v] by (0.1)\nPosition ((x) - (SCROLL X)) (((y) + ((6) * ([sin v] of (((x) + (SINE)) * (10)) ))) - (SCROLL Y))\nCounter\nif <touching (player v)?> then\n    start sound [Coin v]\n    change [collected v] by (1)\n    if <(COLLECTED) = (COLLECTED MAX)> then\n        broadcast (Open Portal v)\n    end\n    delete this clone\nend\n\nwhen I receive [intro done v]\nCounter\nshow variable [counter collect v]\n\nwhen flag clicked\nhide variable [counter collect v]\n\nset [exit v] to [WIN]\n\n@text\n\nwhen flag clicked\ngo to [front v] layer\ngo to [front v] layer\nhide\ngo to [front v] layer\nwait (2.4) seconds\ngo to x: (0) y: (-60)\nset size to (100) %\nset [ghost v] effect to (100)\nshow\nset [rotation v] to [-10]\nrepeat (70)\n    change [ghost v] effect by (rotation)\n    change [rotation v] by (-1)\n    wait (0.01) seconds\nend\nset [ghost v] effect to (0)\n\nwhen I receive [message1 v]\nhide\n\nwhen I receive [intro done v]\nhide\n\nwhen flag clicked\ngo [forward v] (99999) layers\n\n@Intro\n\nwhen flag clicked\ngo to [front v] layer\nset [id v] to [1]\ncreate clone of (_myself_ v)\nset [id v] to [2]\ncreate clone of (_myself_ v)\nset [id v] to [3]\ncreate clone of (_myself_ v)\nset [id v] to [4]\ncreate clone of (_myself_ v)\nstart sound [Never Mind v]\nswitch costume to (1 v)\nshow\ngo to [front v] layer\ngo to x: (0) y: (0)\npoint in direction (-90)\nset size to (300) %\nset [sine v] to [30]\nrepeat (40)\n    change size by (((100) - (size)) * (1))\n    turn right (((90) - (direction)) * (0.18)) degrees\nend\nset [glide v] to [7]\nrepeat (20)\n    change y by ((glide) - (1))\n    change [glide v] by (-0.34)\nend\nwait (5.8) seconds\nhide\n\nwhen I start as a clone\nif <(id) = [1]> then\n    go [backward v] (1) layers\n    clear graphic effects\n    show\n    go to x: (0) y: (0)\n    point in direction (90)\n    set size to (100) %\n    switch costume to (bg v)\nelse\n    if <(id) = [2]> then\n        id 2\n    else\n        if <(id) = [3]> then\n            id 3\n        else\n            id 4\n        end\n    end\nend\n\ndefine id 2\ngo to x: (0) y: (0)\nswitch costume to (dot2 v)\nhide\nclear graphic effects\ngo to [front v] layer\nwait (7) seconds\nshow\nset size to (0.5) %\nset [vel v] to [1]\nswitch costume to (dot v)\nrepeat (50)\n    switch costume to (dot2 v)\n    change [vel v] by ((size) / (50))\n    change size by (vel)\n    switch costume to (dot v)\nend\nbroadcast (Intro Done v)\n\nwhen I receive [intro done v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\n\ndefine id 3\ngo to x: (0) y: (0)\nswitch costume to (dot2 v)\nhide\nclear graphic effects\ngo to [front v] layer\ngo to [front v] layer\nwait (7.2) seconds\nshow\nset size to (0.5) %\nset [vel v] to [1]\nswitch costume to (dot v)\nrepeat (50)\n    switch costume to (dot2 v)\n    change [vel v] by ((size) / (50))\n    change size by (vel)\n    switch costume to (smaller dot v)\nend\n\ndefine id 4\ngo to x: (0) y: (0)\nswitch costume to (dot2 v)\nhide\nclear graphic effects\ngo to [front v] layer\ngo to [front v] layer\ngo to [front v] layer\nwait (7.4) seconds\nshow\nset size to (0.5) %\nset [vel v] to [1]\nswitch costume to (dot v)\nrepeat (50)\n    switch costume to (dot2 v)\n    change [vel v] by ((size) / (50))\n    change size by (vel)\n    switch costume to (crazy dot v)\n    turn left (1) degrees\nend\n\n@Bouncy\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nPosition ((x) - (SCROLL X)) ((y) - (SCROLL 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 (level 1 1  v)\n    Clone At X: [360] Y: [0]\n    Clone At X: [360] Y: [0]\n    Clone At X: [360] Y: [0]\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (level 2 1 v)\n        Clone At X: [360] Y: [0]\n        Clone At X: [360] Y: [0]\n        Clone At X: [360] Y: [0]\n        Clone At X: [360] Y: [0]\n        Clone At X: [360] Y: [0]\n    else\n        if <(LEVEL) = [3]> then\n            switch costume to (level 3 1 v)\n            Clone At X: [360] Y: [0]\n            Clone At X: [360] Y: [0]\n            Clone At X: [360] Y: [0]\n            Clone At X: [360] Y: [0]\n            Clone At X: [360] Y: [0]\n            Clone At X: [360] Y: [0]\n            Clone At X: [360] Y: [0]\n            Clone At X: [360] Y: [0]\n        else\n            if <(LEVEL) = [4]> then\n                switch costume to (level 4 1 v)\n                Clone At X: [360] Y: [0]\n                Clone At X: [360] Y: [0]\n                Clone At X: [360] Y: [0]\n                Clone At X: [360] Y: [0]\n                Clone At X: [360] Y: [0]\n                Clone At X: [360] Y: [0]\n            else\n                if <(LEVEL) = [5]> then\n                    switch costume to (level 5 1 v)\n                    Clone At X: [360] Y: [0]\n                    Clone At X: [360] Y: [0]\n                    Clone At X: [360] Y: [0]\n                    Clone At X: [360] Y: [0]\n                    Clone At X: [360] Y: [0]\n                    Clone At X: [360] Y: [0]\n                    Clone At X: [360] Y: [0]\n                else\n                    if <(LEVEL) = [6]> then\n                        switch costume to (level 6 1 v)\n                        Clone At X: [360] Y: [0]\n                        Clone At X: [360] Y: [0]\n                        Clone At X: [360] Y: [0]\n                        Clone At X: [360] Y: [0]\n                    end\n                end\n            end\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\ndefine Clone At X: (x) Y: (y)\ncreate clone of (_myself_ v)\nchange [x v] by (x)\nchange [y v] by (y)\nnext costume\n\nwhen I start as a clone\ngo [backward v] (7) layers\n\n@Gears\n\nwhen I start as a clone\ngo to [back v] layer\nshow\nforever\n    turn right (3.5) degrees\nend\n\nwhen flag clicked\nhide\ngo to [back v] layer\nforever\n\nwhen I receive [tick v]\nPosition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\nif <(LEVEL) = [5]> then\n    set size to (90) %\nelse\n    set size to (100) %\nend\n\ndefine Clone x: (x) y: (y)\nset [x v] to (x)\nset [y v] to (y)\ncreate clone of (_myself_ v)\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]\nhide\nset [y v] to [0]\nset [x v] to [0]\nif <(LEVEL) = [4]> then\n    Clone x: [936] y: [-110]\n    Clone x: [1111] y: [-110]\n    Clone x: [2257] y: [-105]\nelse\n    if <(LEVEL) = [5]> then\n        Clone x: [840] y: [50]\n        Clone x: [2759] y: [200]\n    else\n        if <(LEVEL) = [6]> then\n            Clone x: [650] y: [-100]\n            Clone x: [2800] y: [260]\n        end\n    end\nend\nset [y v] to [-99999999999]\n\nClone x: [2470] y: [70]\n\n@Right\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nPosition ((x) - (SCROLL X)) ((y) - (SCROLL 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 (level 1 1  v)\n    Clone At X: [360] Y: [0]\n    Clone At X: [360] Y: [0]\n    Clone At X: [360] Y: [0]\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (level 2 1 v)\n        Clone At X: [360] Y: [0]\n        Clone At X: [360] Y: [0]\n        Clone At X: [360] Y: [0]\n        Clone At X: [360] Y: [0]\n        Clone At X: [360] Y: [0]\n    else\n        if <(LEVEL) = [3]> then\n            switch costume to (level 3 1 v)\n            Clone At X: [360] Y: [0]\n            Clone At X: [360] Y: [0]\n            Clone At X: [360] Y: [0]\n            Clone At X: [360] Y: [0]\n            Clone At X: [360] Y: [0]\n            Clone At X: [360] Y: [0]\n            Clone At X: [360] Y: [0]\n            Clone At X: [360] Y: [0]\n            Clone At X: [360] Y: [0]\n        else\n            if <(LEVEL) = [4]> then\n                switch costume to (level 4 1 v)\n                Clone At X: [360] Y: [0]\n                Clone At X: [360] Y: [0]\n                Clone At X: [360] Y: [0]\n                Clone At X: [360] Y: [0]\n                Clone At X: [360] Y: [0]\n                Clone At X: [360] Y: [0]\n            else\n                if <(LEVEL) = [5]> then\n                    switch costume to (level 5 1 v)\n                    Clone At X: [360] Y: [0]\n                    Clone At X: [360] Y: [0]\n                    Clone At X: [360] Y: [0]\n                    Clone At X: [360] Y: [0]\n                    Clone At X: [360] Y: [0]\n                    Clone At X: [360] Y: [0]\n                    Clone At X: [360] Y: [0]\n                else\n                    if <(LEVEL) = [6]> then\n                        switch costume to (level 6 1 v)\n                        Clone At X: [360] Y: [0]\n                        Clone At X: [360] Y: [0]\n                        Clone At X: [360] Y: [0]\n                        Clone At X: [360] Y: [0]\n                        Clone At X: [360] Y: [0]\n                        Clone At X: [360] Y: [0]\n                    end\n                end\n            end\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    set [ghost v] effect to (45)\n    go [backward v] (99) layers\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Clone At X: (x) Y: (y)\ncreate clone of (_myself_ v)\nchange [x v] by (x)\nchange [y v] by (y)\nnext costume\n\nwhen I start as a clone\nset [ghost v] effect to (40)\ngo [backward v] (99) layers\ngo [backward v] (99) layers\ngo [backward v] (99) layers\n\n@TN\n\nwhen flag clicked\ngo to x: (0) y: (0)\nshow\nset [ghost v] effect to (100)\nforever\n    go to [front v] layer\n    go to [front v] layer\nend\n\nset [exit v] to [WIN]\n\n@Music Button\n\nwhen flag clicked\nhide\n\nwhen I receive [intro done v]\nset [deaf v] to [0]\nshow\nswitch costume to (costume1 v)\nforever\n    go to [front v] layer\n    if <touching (mouse-pointer v)?> then\n        change size by (((90) - (size)) / (5))\n        set [brightness v] effect to (10)\n    else\n        change size by (((75) - (size)) / (5))\n        set [brightness v] effect to (0)\n    end\nend\n\nwhen I receive [intro done v]\nwait (0.8) seconds\nset volume to (50) %\nforever\n    if <(deaf) = [1]> then\n        play sound [SpongeBob v] until done\n    else\n        play sound [Snowy v] until done\n        play sound [Popsicle v] until done\n    end\nend\n\nwhen this sprite clicked\nif <(volume) = [50]> then\n    switch costume to (costume2 v)\n    set volume to (0) %\nelse\n    switch costume to (costume1 v)\n    set volume to (50) %\nend\n\n@Jump Rings\n\nwhen I start as a clone\nforever\n    repeat (10)\n        change size by (2)\n    end\n    wait (0.1) seconds\n    repeat (10)\n        change size by (-2)\n    end\nend\n\nwhen I start as a clone\nswitch costume to (1 v)\ngo to [back v] layer\nshow\nforever\n    if <touching (player v)?> then\n        set [brightness v] effect to (10)\n        wait (0.1) seconds\n    else\n        set [brightness v] effect to (0)\n    end\nend\n\nwhen flag clicked\nhide\ngo to [back v] layer\n\nwhen I receive [tick v]\nPosition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\ndefine Clone x: (x) y: (y)\nset [x v] to (x)\nset [y v] to (y)\ncreate clone of (_myself_ v)\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]\nset size to (90) %\ndelete this clone\n\nwhen I receive [setup v]\nhide\nset [y v] to [0]\nset [x v] to [0]\nif <(LEVEL) = [5]> then\n    Clone x: [-30] y: [20]\n    Clone x: [260] y: [120]\n    Clone x: [390] y: [100]\n    Clone x: [1081] y: [-30]\n    Clone x: [2360] y: [50]\n    Clone x: [2296] y: [205]\nelse\n    if <(LEVEL) = [6]> then\n        Clone x: [-200] y: [5]\n        Clone x: [1100] y: [-30]\n        Clone x: [1896] y: [50]\n        Clone x: [2021] y: [33]\n        Clone x: [2417] y: [15]\n        Clone x: [2560] y: [180]\n        Clone x: [2828] y: [1]\n    end\nend\nset [y v] to [-99999999999]\n\n@Pike\n\nwhen I start as a clone\npoint in direction (90)\ngo to [back v] layer\nshow\nforever\n    repeat (35)\n        change [y v] by (2)\n    end\n    repeat (35)\n        change [y v] by (-2)\n    end\nend\n\nwhen flag clicked\nhide\ngo to [back v] layer\n\nwhen I receive [tick v]\nPosition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\nif <(LEVEL) = [5]> then\n    set size to (90) %\nelse\n    set size to (100) %\nend\n\ndefine Clone x: (x) y: (y)\nset [x v] to (x)\nset [y v] to (y)\ncreate clone of (_myself_ v)\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]\nhide\nset [y v] to [0]\nset [x v] to [0]\nif <(LEVEL) = [6]> then\n    Clone x: [498] y: [-100]\n    Clone x: [803] y: [-100]\n    Clone x: [1609] y: [30]\n    Clone x: [2557] y: [10]\n    Clone x: [2669] y: [-110]\nend\nset [y v] to [-99999999999]\n\nset [exit v] to [WIN]\n\n
Here is a studio with some projects that use this engine:\nhttps://scratch.mit.edu/studios/1298154/\nIf you put your link in the comments I will add it. :)\n\n\n--If this project can get 200 loves I will upload my new platformer!\nNew platformer for 200 loves:\nhttps://scratch.mit.edu/projects/113470618/