The Avengers, A Platformer

Instructions: PART 2 OUT NOW               https://scratch.mit.edu/projects/391239663\nPlains 2.5 OUT NOW \nhttps://scratch.mit.edu/projects/392049195\nPART 3 OUT NOW \nhttps://scratch.mit.edu/projects/396651098\nWelcome to Plains - Platformer \n\n1 Love = Free nonexistent stuff\n\nInstructions: Arrow keys or just tap around on mobile. \nThere are currently 15 levels. \n\nStory: You are searching for the Treasure of\n the Plains. Watch out for spikes and lava on your journey. \n\nI spend hours on making this platformer, so please love, favorite and follow? Can we get 1500 loves?\n\nAll artwork and programming by myself = @sushi10000\n\nMusic: Athletic Theme - Super Mario 3D Land OST\n\nUpdate log\n2.5 Release \nMusic Added\nClouds Added\nInstructions Panel Added\n\nNO ADVERTISING \n\n###\n#platformer #platform #platformgames #game #games #sushi10000 #sushigames #sushi #10000 #plains #can #we #get #this #to #top #loved 

@Stage\n\nwhen flag clicked\nswitch backdrop to (pick random (1) to (3))\n\n@blank\n\n@player\n\nwhen flag clicked\nset [scene v] to [1]\nbroadcast (new scene v)\nbroadcast (reset v)\n\ndefine vertical\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 <(Touching) = [1]> then\n    if <<(JUMPED) = [0]> and <key (up arrow v) pressed?>> then\n        if <(super jump) = [1]> then\n            start sound [jump v]\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            else\n                start sound [jump v]\n                set [speed y v] to [12]\n            end\n        end\n        set [falling v] to [10]\n        set [jumped v] to [1]\n    end\nend\nif <<(speed y) > [0]> and <not <key (up arrow v) pressed?>>> then\n    change [speed y v] by (-0.5)\nend\nif <not <key (up arrow v) pressed?>> then\n    set [jumped v] to [0]\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?> - <key (left arrow v) pressed?>)\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: (-45)\nset [speed x v] to [0]\nset [speed y v] to [0]\nset [platform v] to [0]\nswitch costume to (hitbox - main v)\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\nwhen I receive [bounce v]\nif <key (up arrow v) pressed?> then\n    set [speed y v] to [10]\nelse\n    set [speed y v] to [5]\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\n@level\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\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)?>\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) + (() - (distance to [player v]))) %\nswitch costume to (shadow v)\n\n