Summer Platformer & Windland

Instructions: ⚠TRIGGER WARNING⚠ \n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\nHOW TO PLAY : \nUse Arrow keys or W A S D to move\nDo not step in lava or spikes\nThe orange arrow make you jump\nENJOY :)\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\nFeel free to report any bugs or glitches\n\nALSO PLEASE DO NOT ADVERTISE \n(much appreciated if you don't)

@Stage\n\nwhen flag clicked\nforever\n    if <(Level) = [34]> then\n        switch backdrop to (snow land v)\n    end\nend\n\nwhen flag clicked\nwait until <(Level) = [41]>\nforever\n    switch backdrop to (pro levels v)\n    wait (1) seconds\n    switch backdrop to (pro levels2 v)\n    wait (1) seconds\nend\n\n@player\n\ndefine vertical\nif <touching (bounce platforms fix v)?> then\n    start sound [jump v]\n    set [speed y v] to [25]\nend\nif <touching (pink platforms fix v)?> then\n    set [-2 v] to [-25]\n    set [- v] to [2]\n    set size to (20) %\nend\nif <touching (blue platform fix v)?> then\n    set [- v] to [0]\n    set [-2 v] to [0]\n    set size to (30) %\nend\nif <<touching color (#df0101)?> or > then\n    go to x: (-210) y: (-65)\n    set [speed x v] to [0]\n    set [speed y v] to [0]\nend\nset rotation style [don't rotate v]\nswitch costume to (hitbox - feet v)\ntouching\nchange [falling v] by (1)\nchange [speed y v] by (-1)\nif <(JUMP ALLOWED) = [0]> then\n    if <(Touching) = [1]> then\n        if <<(JUMPED) = [0]> and <<key (up arrow v) pressed?> or <(MOBILE CONTROLS = JUMP) = [1]>>> then\n            start sound [jump v]\n            set [speed y v] to ((12) - (-))\n            \n                if <(super jump) = [1]> then\n                    set [speed y v] to [20]\n                    set [super jump v] to [2]\n                else\n                    if <(landing) > [1]> then\n                        start sound [super jump v]\n                        set [speed y v] to [16]\n                        set [super jump v] to [1]\n                    end\n                end\n            end\n            set [falling v] to [10]\n            set [jumped v] to [1]\n        end\n    end\n    if <<(speed y) > [0]> and <not <<key (up arrow v) pressed?> or <(MOBILE CONTROLS = JUMP) = [1]>>>> then\n        change [speed y v] by (-0.5)\n    end\n    if <not <<key (up arrow v) pressed?> or <(MOBILE CONTROLS = JUMP) = [1]>>> then\n        set [jumped v] to [0]\n    end\nend\n\ndefine touching\nif <touching (level v)?> then\n    set [touching v] to [1]\n    if <(landing) = [0]> then\n        set [super jump v] to [0]\n    end\nelse\n    set [touching v] to [0]\nend\n\ndefine move\nset rotation style [don't rotate v]\nswitch costume to (hitbox - main v)\nrepeat ([abs v] of (speed y) )\n    set [last value v] to (y position)\n    change y by ((speed y) / ([abs v] of (speed y) ))\n    touching\n    if <(Touching) = [1]> then\n        if <(speed y) < [-1]> then\n            set [starting land v] to ([abs v] of (speed y) )\n            set [landing v] to ([abs v] of (speed y) )\n        end\n        set [speed y v] to [0]\n        set [falling v] to [0]\n        set y to (last value)\n    end\nend\ntouching\nif <(Touching) = [1]> then\n    repeat until <(Touching) = [0]>\n        change y by (1)\n        if <[160] < (y position)> then\n            broadcast (reset v)\n        end\n        touching\n    end\nend\nrepeat ([abs v] of (speed x) )\n    set [last value v] to (x position)\n    change x by ((speed x) / ([abs v] of (speed x) ))\n    touching\n    if <(Touching) = [1]> then\n        set [speed x v] to [0]\n        set x to (last value)\n    end\nend\ntouching\nif <(Touching) = [1]> then\n    repeat until <(Touching) = [0]>\n        change y by (1)\n        if <[160] < (y position)> then\n            broadcast (reset v)\n        end\n        touching\n    end\nend\nbroadcast (moved v)\n\ndefine horizontal\nset rotation style [don't rotate v]\nswitch costume to (hitbox - main v)\nset [key x v] to (<<key (right arrow v) pressed?> or <(MOBILE CONTROLS = RIGHT) = [1]>> - <<key (left arrow v) pressed?> or <(MOBILE CONTROLS = LEFT) = [1]>>)\nif <<<[2] > (falling)> and <([abs v] of (key X) ) > [0]>> and <not <(key X) = (([abs v] of (speed x) ) / (speed x))>>> then\n    set [key x v] to ((key X) * (0.2))\nend\nif <([abs v] of (speed x) ) < [0.5]> then\n    set [speed x v] to [0]\n    if <not <key (space v) pressed?>> then\n        set [frame v] to [0]\n    end\nend\nchange [speed x v] by ((key X) * (1.5))\nif <(falling) > [2]> then\n    set [speed x v] to ((speed x) * (0.98))\n    if <([abs v] of (speed x) ) > [6]> then\n        set [speed x v] to ((speed x) * (0.8))\n    end\nelse\n    set [speed x v] to ((speed x) * (0.8))\nend\nchange [frame v] by (0.2)\nif <not <(key X) = [0]>> then\n    point in direction ((([abs v] of (speed x) ) / (speed x)) * (90))\n    change [frame v] by (0.3)\nend\nif <not <((key X) * (90)) = (direction)>> then\n    set [skid v] to [1]\n    if <(speed x) = [0]> then\n        set [skid v] to [0]\n    end\nelse\n    set [skid v] to [0]\nend\n\ndefine frame\nset rotation style [left-right v]\nif <(falling) > [0]> then\n    if <(super jump) = [2]> then\n        megajump frames\n    else\n        if <(super jump) = [1]> then\n            switch costume to ((18) + (([floor v] of (falling) ) mod (16)))\n        else\n            if <(speed y) > [1]> then\n                switch costume to (jump v)\n            else\n                if <(speed y) < [-0.5]> then\n                    switch costume to (fall v)\n                else\n                    switch costume to (mid-air v)\n                end\n            end\n        end\n    end\nelse\n    if <(frame) > [1]> then\n        if <not <(key X) = (([abs v] of (speed x) ) / (speed x))>> then\n            switch costume to (turnaround v)\n        else\n            switch costume to ((4) + (([floor v] of (frame) ) mod (10)))\n        end\n    else\n        switch costume to (stand v)\n    end\nend\nif <key (space v) pressed?> then\n    switch costume to ((4) + (([floor v] of (frame) ) mod (10)))\nend\n\nwhen I receive [reset v]\ngo to x: (0) y: (0)\nset [speed x v] to [0]\nset [speed y v] to [0]\nset [platform v] to [0]\nset size to (30) %\nforever\n    vertical\n    horizontal\n    move\n    broadcast (moved v)\n    frame\n    stretch\nend\n\ndefine Find Closest Space to: (x) (y) max (max)\nset [temp v] to (direction)\nset [distance v] to [1]\npoint in direction (0)\nrepeat (max)\n    repeat (16)\n        go to x: (x) y: (y)\n        move (distance) steps\n        Check Touching Solid\n        if <(touching) < [1]> then\n            point in direction (temp)\n            stop [this script v]\n        end\n        turn right (22.5) degrees\n    end\n    change [distance v] by (1)\nend\ngo to x: (x) y: (y)\npoint in direction (temp)\n\ndefine platform\n\nwhen I receive [sidefilp v]\nwait (0.25) seconds\nif <(direction) = [90]> then\n    point in direction (-90)\nelse\n    if <(direction) = [-90]> then\n        point in direction (90)\n    end\nend\n\ndefine scene\n\ndefine sideflip animation\n\nwhen [space v] key pressed\nrepeat until <not <key (space v) pressed?>>\n    change [frame v] by (Y charge)\n    change [y charge v] by (0.02)\n    change [would be y charge v] by (0.02)\n    if <(Y charge) > [2]> then\n        set [y charge v] to [2]\n    end\nend\nset [frame v] to [0]\nset [y charge v] to [0]\nset [would be y charge v] to [0]\n\ndefine limiter\n\ndefine stretch\nif <(falling) > [0]> then\n    if <(super jump) = [2]> then\n        set [fisheye v] effect to (([abs v] of (speed y) ) * (-1.5))\n    else\n        if <(super jump) = [1]> then\n            set [fisheye v] effect to (([abs v] of (speed y) ) * (-3.5))\n        else\n            if <(speed y) > [1]> then\n                set [fisheye v] effect to ((speed y) * (-5))\n            else\n                set [fisheye v] effect to (([abs v] of (speed y) ) * (-2))\n            end\n        end\n    end\nelse\n    if <(landing) > [0]> then\n        change [landing v] by (-2)\n        if <(landing) < [1]> then\n            set [landing v] to [0]\n        end\n        set [fisheye v] effect to ((landing) * (2))\n    else\n        set [fisheye v] effect to (0)\n    end\nend\n\ndefine megajump frames\nif <(falling) > [17]> then\n    switch costume to (megajump-7 v)\nelse\n    if <(falling) > [16]> then\n        switch costume to (megajump-6 v)\n    else\n        if <(falling) > [15]> then\n            switch costume to (megajump-5 v)\n        else\n            if <(falling) > [14]> then\n                switch costume to (megajump-4 v)\n            else\n                if <(falling) > [13]> then\n                    switch costume to (megajump-3 v)\n                else\n                    if <(falling) > [12]> then\n                        switch costume to (megajump-2 v)\n                    else\n                        switch costume to (megajump-1 v)\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen I receive [bomg v]\nswitch backdrop to (caves v)\nset [level v] to [18]\ngo to x: (-100) y: (9999)\n\nwhen I receive [starting speedrun!!! v]\nshow variable [seconds v]\ngo to x: (0) y: (0)\nstop [other scripts in sprite v]\nswitch costume to (stand v)\npoint in direction (90)\nwait (0.3) seconds\nwait until <<mouse down?> or <key (any v) pressed?>>\nbroadcast (reset v)\nrepeat until <(Level) = [40]>\n    change [seconds v] by (0.1)\n    wait (0.04) seconds\nend\nif <(seconds) < (☁ World record)> then\n    set [☁ world record v] to (seconds)\n    broadcast (YES v)\nelse\n    broadcast (NO v)\nend\n\nwhen flag clicked\nswitch backdrop to (sky v)\nset [seconds v] to [0]\nhide variable [seconds v]\nhide variable [☁ world record v]\nshow\nset [scene v] to [1]\nbroadcast (new scene v)\nbroadcast (reset v)\n\nwhen I receive [reset v]\nforever\n    if <(size) = [30]> then\n        set [pitch v] effect to (0)\n    else\n        set [pitch v] effect to (30)\n    end\nend\n\nwhen I receive [reset v]\nforever\n    if <[238] < (x position)> then\n        set x to (-240)\n        broadcast (CHANGE SCENE v)\n        change [level v] by (1)\n    end\nend\n\nwhen flag clicked\nset [- v] to [0]\n\nwhen I receive [x v]\nchange [speed x v] by (1)\n\nwhen flag clicked\n\nforever\n\nwhen I receive [bounce v]\nif <<key (up arrow v) pressed?> or <(MOBILE CONTROLS = JUMP) = [1]>> then\n    set [speed y v] to [10]\nelse\n    set [speed y v] to [5]\nend\n\nwhen I receive [pro levels v]\nchange y by (1000)\n\n@level\n\nwhen flag clicked\nset [level v] to [1]\nswitch costume to (scene-1 v)\nforever\n    switch costume to (join [Scene-] (Level))\n    3D\nend\n\nwhen flag clicked\nforever\n    play sound [Baba Is You - On the island v] until done\nend\n\nwhen flag clicked\ngo to x: (0) y: (0)\ngo to [back v] layer\n3D\n\ndefine 3D\nerase all\nclear graphic effects\nset [brightness v] effect to (-30)\nset size to (80) %\nrepeat (20)\n    stamp\n    change size by (1)\n    change [brightness v] effect by (1.5)\nend\nset size to (100) %\nset [ghost v] effect to (100)\n\nwhen flag clicked\nforever\n    if <(Level) = [27]> then\n        switch backdrop to (desert v)\n    end\nend\n\n@WYZNACZNIK\n\nwhen flag clicked\nshow\nset [ghost v] effect to (100)\nwait (3) seconds\nwait until <touching (player v)?>\nbroadcast (BOMG v)\nhide\n\n@blank\n\n@Exit\n\nwhen flag clicked\ngo to x: (224) y: (-63)\nforever\n    go to [front v] layer\n    if <(Level) = [26]> then\n        show\n    else\n        hide\n    end\nend\n\n@Speedrun mode button\n\nforever\nend\n\nwhen flag clicked\ngo to [back v] layer\nforever\n    go to x: (-185) y: (-75)\n    go to x: (-171) y: ((-75) + (([sin v] of ((timer) * (200)) ) * (7)))\n    if <touching (player v)?> then\n        set [speedrunbutton touch v] to [1]\n        set [brightness v] effect to (25)\n        if <<key (down arrow v) pressed?> or <(DOWN ARROW YES?) = [1]>> then\n            set [speedrunbutton touch v] to [0]\n            broadcast (STARTING SPEEDRUN!!! v)\n            hide\n            stop [this script v]\n        end\n    else\n        set [speedrunbutton touch v] to [0]\n        set [brightness v] effect to (0)\n    end\n    if <(Level) = [1]> then\n        show\n    else\n        hide\n    end\nend\n\n@Text\n\nwhen flag clicked\nforever\n    hide\n    wait until <(Speedrunbutton touch) = [1]>\n    set [ghost v] effect to (100)\n    show\n    repeat until <(Speedrunbutton touch) = [0]>\n        repeat (20)\n            change [ghost v] effect by (-5)\n        end\n        repeat (20)\n            change [ghost v] effect by (5)\n        end\n    end\nend\n\nwhen flag clicked\nswitch costume to (kostium1 v)\nforever\n    if <(Speedrunbutton touch) = [1]> then\n        show\n    else\n        hide\n    end\nend\n\nwhen I receive [starting speedrun!!! v]\nstop [other scripts in sprite v]\nset [ghost v] effect to (100)\nshow\nwait (0.7) seconds\nswitch costume to (kostium2 v)\nrepeat until <<key (any v) pressed?> or <mouse down?>>\n    repeat (20)\n        change [ghost v] effect by (-5)\n    end\n    repeat (20)\n        change [ghost v] effect by (5)\n    end\nend\n\nwhen I receive [yes v]\n\nstop [other scripts in sprite v]\nset [ghost v] effect to (100)\nshow\nswitch costume to (beated v)\nforever\n    repeat (20)\n        change [ghost v] effect by (-5)\n    end\n    repeat (20)\n        change [ghost v] effect by (5)\n    end\nend\n\nwhen I receive [no v]\n\nstop [other scripts in sprite v]\nset [ghost v] effect to (100)\nshow\nswitch costume to (no beated v)\nforever\n    repeat (20)\n        change [ghost v] effect by (-5)\n    end\n    repeat (20)\n        change [ghost v] effect by (5)\n    end\nend\n\n@shadow\n\nwhen I receive [moved v]\nshadow\n\ndefine shadow\ngo to [back v] layer\nswitch costume to (hitbox v)\ngo to (player v)\nrepeat until <<touching (level v)?> or <(y position) < [-165]>>\n    change y by (-1)\nend\nif <<(y position) > [0]> or <touching (_edge_ v)?>> then\n    set [ghost v] effect to (100)\nelse\n    set [ghost v] effect to (50)\nend\nswitch costume to (big v)\nset size to ((120) + ((-2) - (distance to [player v]))) %\nswitch costume to (shadow v)\n\n@Thumbail\n\nwhen flag clicked\nshow variable [level v]\nforever\n    switch costume to (#4 thumbail v)\n    set [ghost v] effect to (100)\n    go to [front v] layer\n    show\n    go to x: (0) y: (0)\nend\n\n@Blue platform fix\n\nwhen flag clicked\nset [ghost v] effect to (100)\nforever\n    if <<(Level) = [24]> or <(Level) = [21]>> then\n        show\n    else\n        hide\n    end\n    switch costume to (Level)\nend\n\n@Bounce platforms fix\n\nwhen flag clicked\nset [ghost v] effect to (100)\nswitch costume to (scene-1 v)\nforever\n    switch costume to (join [Scene-] (Level))\nend\n\n@Pink platforms fix\n\nwhen flag clicked\nset [ghost v] effect to (100)\nforever\n    if <<(Level) = [22]> or <(Level) = [21]>> then\n        show\n    else\n        hide\n    end\n    switch costume to (Level)\nend\n\n@Snow\n\nwhen flag clicked\nhide\nforever\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\ngo to [front v] layer\ngo to x: (pick random (-180) to (180)) y: (999)\nset size to (pick random (100) to (150)) %\nswitch costume to (pick random (1) to (3))\nrepeat until <(y position) < [-175]>\n    change y by (-3)\nend\ndelete this clone\n\nwhen I start as a clone\nforever\n    if <<[33] < (Level)> and <(Level) < [41]>> then\n        show\n    else\n        hide\n    end\nend\n\n@Mobile /\\n\nwhen flag clicked\nset [ghost v] effect to (30)\nset size to (90) %\ngo to x: (200) y: (-145)\nforever\n    if <<touching (mouse-pointer v)?> and <mouse down?>> then\n        set [ghost v] effect to (0)\n        set [mobile controls = jump v] to [1]\n    else\n        set [ghost v] effect to (30)\n        set [mobile controls = jump v] to [0]\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Mobile controls on/off?) = [1]> then\n        show\n    else\n        hide\n    end\nend\n\n@Mobile >\n\nwhen flag clicked\nset [ghost v] effect to (30)\ngo to x: (-125) y: (-145)\nset size to (90) %\nforever\n    if <<touching (mouse-pointer v)?> and <mouse down?>> then\n        set [ghost v] effect to (0)\n        set [mobile controls = right v] to [1]\n    else\n        set [ghost v] effect to (30)\n        set [mobile controls = right v] to [0]\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Mobile controls on/off?) = [1]> then\n        show\n    else\n        hide\n    end\nend\n\n@Mobile <\n\nwhen flag clicked\nset [ghost v] effect to (30)\ngo to x: (-200) y: (-145)\nforever\n    if <<touching (mouse-pointer v)?> and <mouse down?>> then\n        set [ghost v] effect to (0)\n        set [mobile controls = left v] to [1]\n    else\n        set [ghost v] effect to (30)\n        set [mobile controls = left v] to [0]\n    end\nend\n\n\n\nwhen flag clicked\nforever\n    if <(Mobile controls on/off?) = [1]> then\n        show\n    else\n        hide\n    end\nend\n\n@DOWN ARROW\n\nwhen flag clicked\nset [ghost v] effect to (30)\ngo to x: (120) y: (-145)\nset size to (90) %\nset [down arrow yes? v] to [0]\nforever\n    if <<(Speedrunbutton touch) = [1]> and <(Mobile controls on/off?) = [1]>> then\n        show\n        if <<touching (mouse-pointer v)?> and <mouse down?>> then\n            set [ghost v] effect to (0)\n            set [down arrow yes? v] to [1]\n        else\n            set [ghost v] effect to (30)\n            set [down arrow yes? v] to [0]\n        end\n    else\n        hide\n    end\nend\n\n\n\n@Mobile controls\n\nwhen flag clicked\ngo to [back v] layer\nset [mobile controls on/off? v] to [0]\nforever\n    if <(Level) = [1]> then\n        show\n    else\n        hide\n    end\n    if <touching (mouse-pointer v)?> then\n        set [brightness v] effect to (25)\n    else\n        set [brightness v] effect to (0)\n    end\nend\n\nwhen this sprite clicked\nchange [mobile controls on/off? v] by (1)\nCheck var settings\n\ndefine Check var settings\nif <[1] < (Mobile controls on/off?)> then\n    set [mobile controls on/off? v] to [0]\nend\n\n@PROS LEVELS\n\nwhen flag clicked\ngo to [back v] layer\nforever\n    if <(Level) = [40]> then\n        show\n    else\n        hide\n    end\nend\n\n@Wyznacznik 2\n\nwhen flag clicked\nhide\nwait until <(Level) = [40]>\nshow\nset [ghost v] effect to (100)\nwait until <touching (player v)?>\nbroadcast (PRO LEVELS v)\nhide\nset [level v] to [41]\n\nset [level v] to [34]\nwait (0) seconds\nset [level v] to [40]\n\n