Super Mario Advanced 4 || A Platformer
@Stage\n\nwhen flag clicked\nforever\n    play sound [Athletic BGM - Super Mario Bros. 3 v] until done\nend\n\nwhen flag clicked\nswitch backdrop to (blue v)\n\n@Player\n\nif <(AllowPlayerMovement) = [1]> then\n    switch costume to (playercentre v)\n    set [sliding v] to [0]\n    set [slidingfunction v] to [0]\n    set [crouching v] to [0]\n    change [tanookicooldown v] by ((-1) / (30))\n    change [statueswapcooldown v] by ((-1) / (10))\n    if <touching (water v)?> then\n        if <(Powerup) = [Frog]> then\n            if <<key (w v) pressed?> or <key (up arrow v) pressed?>> then\n                change [yvel v] by (1.8)\n            end\n            if <<key (s v) pressed?> or <key (down arrow v) pressed?>> then\n                change [yvel v] by (-1.8)\n            end\n            if <<key (d v) pressed?> or <key (right arrow v) pressed?>> then\n                change [xvel v] by (1.5)\n                point in direction (90)\n            end\n            if <<key (a v) pressed?> or <key (left arrow v) pressed?>> then\n                change [xvel v] by (-1.5)\n                point in direction (-90)\n            end\n            if <(YVel) > [0]> then\n                switch costume to (frogswimmingtop v)\n            else\n                switch costume to (allbottom v)\n            end\n            change y by (YVel)\n            if <<touching (map v)?> or <<<touching (semisolids v)?> or <touching (platforms v)?>> and <not <(YVel) > [0]>>>> then\n                change y by ((YVel) * (-1))\n                if <(YVel) > [0]> then\n                    FindCeilingV2\n                    set [yvel v] to [0]\n                else\n                    FindFloor\n                    set [yvel v] to [0]\n                end\n            end\n            switch costume to (frogswimmingsides v)\n            change x by (XVel)\n            YSmoothing\n            if <touching (map v)?> then\n                set [playerx v] to ((x position) - (MapX))\n                FindXPosition\n                set [xvel v] to [0]\n            end\n            if <([abs v] of (XVel) ) > [4.499999]> then\n                set [xvel v] to ((XVel) / (1.3))\n                set [yvel v] to ((YVel) / (1.3))\n            else\n                set [xvel v] to ((XVel) / (1.5))\n                set [yvel v] to ((YVel) / (1.5))\n            end\n            set [playerx v] to ((x position) - (MapX))\n            set [playery v] to ((y position) - (MapY))\n        else\n            if <(YVel) > [-2.5]> then\n                change [yvel v] by (-0.41)\n            end\n            if <(YVel) < [-2.5]> then\n                set [yvel v] to [-2.5]\n            end\n            if <<<key (w v) pressed?> or <key (up arrow v) pressed?>> and <<(Statue) = [0]> and <<(YVel) < [-1.3]> or <(YVel) = [-0.41]>>>> then\n                if <not <(YVel) = [-1.41]>> then\n                    start sound [Swim v]\n                end\n                set [yvel v] to [6]\n            end\n            if <(YVel) > [0]> then\n                if <<(Powerup) = [None]> or <(Crouching) = [1]>> then\n                    switch costume to (nonetop v)\n                else\n                    switch costume to (bigtop v)\n                end\n            else\n                switch costume to (allbottom v)\n            end\n            change y by (YVel)\n            if <<touching (map v)?> or <<<touching (semisolids v)?> or <touching (platforms v)?>> and <not <(YVel) > [0]>>>> then\n                change y by ((YVel) * (-1))\n                if <(YVel) > [0]> then\n                    FindCeilingV2\n                    set [yvel v] to [-1]\n                else\n                    FindFloor\n                    if <<(Statue) = [0]> and <<key (s v) pressed?> or <key (down arrow v) pressed?>>> then\n                        set [crouching v] to [1]\n                    end\n                    set [yvel v] to [0]\n                end\n            end\n            if <<(Statue) = [0]> and <<(SlidingFunction) = [0]> and <(Crouching) = [0]>>> then\n                if <<<key (d v) pressed?> or <key (right arrow v) pressed?>> and <not <<key (a v) pressed?> or <key (left arrow v) pressed?>>>> then\n                    change [xvel v] by (2)\n                    point in direction (90)\n                    if <(YVel) = [0]> then\n                        if <([abs v] of (XVel) ) > [2]> then\n                            if <(XVel) > [0]> then\n                                set [xvel v] to [2]\n                            else\n                                set [xvel v] to [-2]\n                            end\n                        end\n                    else\n                        if <([abs v] of (XVel) ) > [4.5]> then\n                            if <(XVel) > [0]> then\n                                set [xvel v] to [4.5]\n                            else\n                                set [xvel v] to [-4.5]\n                            end\n                        end\n                    end\n                    if <(XVel) < [2]> then\n                        if <(YVel) = [0]> then\n                            change [xvel v] by (-1.9)\n                        else\n                            change [xvel v] by (-1.75)\n                        end\n                    end\n                end\n                if <<<key (a v) pressed?> or <key (left arrow v) pressed?>> and <not <<key (d v) pressed?> or <key (right arrow v) pressed?>>>> then\n                    change [xvel v] by (-2)\n                    point in direction (-90)\n                    if <(YVel) = [0]> then\n                        if <([abs v] of (XVel) ) > [2]> then\n                            if <(XVel) > [0]> then\n                                set [xvel v] to [2]\n                            else\n                                set [xvel v] to [-2]\n                            end\n                        end\n                    else\n                        if <([abs v] of (XVel) ) > [4.5]> then\n                            if <(XVel) > [0]> then\n                                set [xvel v] to [4.5]\n                            else\n                                set [xvel v] to [-4.5]\n                            end\n                        end\n                    end\n                    if <(XVel) > [-2]> then\n                        if <(YVel) = [0]> then\n                            change [xvel v] by (1.9)\n                        else\n                            change [xvel v] by (1.75)\n                        end\n                    end\n                end\n            end\n            if <<(Powerup) = [None]> or <(Crouching) = [1]>> then\n                switch costume to (nonesides v)\n            else\n                switch costume to (bigsides v)\n            end\n            if <<(Statue) = [0]> and <(SlidingFunction) = [0]>> then\n                change x by (XVel)\n                YSmoothing\n                if <touching (map v)?> then\n                    set [playerx v] to ((x position) - (MapX))\n                    FindXPosition\n                    set [xvel v] to [0]\n                end\n            end\n            set [xvel v] to ((XVel) / (1.05))\n            set [playerx v] to ((x position) - (MapX))\n            set [playery v] to ((y position) - (MapY))\n            if <<(Powerup) = [Fire]> and <(TanookiCooldown) < [0]>> then\n                if <key (space v) pressed?> then\n                    start sound [Fireball v]\n                    add ((((x position) + (((direction) / (90)) * (8))) - (MapX)) / (28)) to [fireballx v]\n                    add (((y position) - (MapY)) / (28)) to [firebally v]\n                    add (direction) to [fireballdir v]\n                    add [1] to [fireballtype v]\n                    add [0] to [fireballbounces v]\n                    set [tanookicooldown v] to [0.5]\n                end\n            end\n        end\n        switch costume to (playercentre v)\n        if <not <touching (water v)?>> then\n            if <<key (w v) pressed?> or <key (up arrow v) pressed?>> then\n                set [yvel v] to [12]\n                if <([abs v] of (XVel) ) > [1.5]> then\n                    set [xvel v] to ((direction) / (60))\n                end\n            end\n        end\n    else\n        if <(Powerup) = [Frog]> then\n            if <<<(YVel) > [-12]> and <(Statue) = [0]>> or <<(YVel) > [-16]> and <(Statue) = [1]>>> then\n                change [yvel v] by ((Gravity) / (3.2))\n                if <<(YVel) > [0]> and <not <<key (w v) pressed?> or <key (up arrow v) pressed?>>>> then\n                    set [yvel v] to ((YVel) / (1.3))\n                end\n            end\n            switch costume to (allbottom v)\n            change y by (Gravity)\n            if <<touching (map v)?> or <<<touching (semisolids v)?> or <touching (platforms v)?>> and <not <(YVel) > [0]>>>> then\n                change y by ((Gravity) * (-1))\n                set [yvel v] to [0]\n                if <<key (w v) pressed?> or <key (up arrow v) pressed?>> then\n                    start sound [Jump v]\n                    if <([abs v] of (XVel) ) > [2]> then\n                        set [yvel v] to [20]\n                    else\n                        set [yvel v] to [18]\n                    end\n                end\n                FindFloor\n            end\n            if <(YVel) > [0]> then\n                switch costume to (bigtop v)\n            else\n                switch costume to (allbottom v)\n            end\n            change y by (YVel)\n            if <<touching (map v)?> or <<<touching (semisolids v)?> or <touching (platforms v)?>> and <not <(YVel) > [0]>>>> then\n                if <(YVel) > [0]> then\n                    FindCeiling\n                    set [yvel v] to [3]\n                else\n                    change y by ((YVel) * (-1))\n                    FindFloor\n                    set [yvel v] to [0]\n                end\n            end\n            if <<(Statue) = [0]> and <<(SlidingFunction) = [0]> and <(Crouching) = [0]>>> then\n                if <<<key (d v) pressed?> or <key (right arrow v) pressed?>> and <not <<key (a v) pressed?> or <key (left arrow v) pressed?>>>> then\n                    change [xvel v] by (1)\n                    point in direction (90)\n                end\n                if <<<key (a v) pressed?> or <key (left arrow v) pressed?>> and <not <<key (d v) pressed?> or <key (right arrow v) pressed?>>>> then\n                    change [xvel v] by (-1)\n                    point in direction (-90)\n                end\n            end\n            switch costume to (bigsides v)\n            change x by (XVel)\n            YSmoothing\n            if <touching (map v)?> then\n                set [playerx v] to ((x position) - (MapX))\n                FindXPosition\n                set [xvel v] to [0]\n            end\n            if <<(Crouching) = [1]> or <(Sliding) = [1]>> then\n                set [xvel v] to ((XVel) / (1.1))\n            else\n                if <(YVel) = [0]> then\n                    set [xvel v] to ((XVel) / (1.2))\n                    if <(([floor v] of (((PlayerCostumeNo.) * (2.5)) mod (4)) ) + (1)) = [1]> then\n                        if <([abs v] of (XVel) ) > [1]> then\n                            if <(XVel) > [0]> then\n                                set [xvel v] to [1]\n                            else\n                                set [xvel v] to [-1]\n                            end\n                        end\n                    end\n                else\n                    set [xvel v] to ((XVel) / (1.15))\n                end\n            end\n            if <<<([abs v] of (XVel) ) > [4]> and <(TanookiFlying) = [1]>> and <<(YVel) = [-0.4]> and <<key (w v) pressed?> or <key (up arrow v) pressed?>>>> then\n                if <(XVel) > [0]> then\n                    set [xvel v] to [4]\n                else\n                    set [xvel v] to [-4]\n                end\n            end\n            set [playerx v] to ((x position) - (MapX))\n            set [playery v] to ((y position) - (MapY))\n        else\n            if <<<(YVel) > [-12]> and <(Statue) = [0]>> or <<(YVel) > [-16]> and <(Statue) = [1]>>> then\n                if <<(TanookiFlying) = [1]> and <(Statue) = [0]>> then\n                    if <(YVel) > [0]> then\n                        change [yvel v] by ((Gravity) / (3.4))\n                    else\n                        if <<key (w v) pressed?> or <key (up arrow v) pressed?>> then\n                            change [yvel v] by ((Gravity) / (6))\n                            if <(YVel) < [-0.4]> then\n                                set [yvel v] to [-0.4]\n                            end\n                        else\n                            change [yvel v] by ((Gravity) / (3.4))\n                        end\n                    end\n                else\n                    if <(Statue) = [1]> then\n                        change [yvel v] by ((Gravity) / (1))\n                    else\n                        change [yvel v] by ((Gravity) / (2.9))\n                        if <<(YVel) > [0]> and <not <<key (w v) pressed?> or <key (up arrow v) pressed?>>>> then\n                            set [yvel v] to ((YVel) / (1.3))\n                        end\n                    end\n                end\n            end\n            switch costume to (allbottom v)\n            if <<<(AllowTanookiFlightStart) = [1]> and <<(Powerup) = [Tanooki]> and <(Statue) = [0]>>> and <([abs v] of (XVel) ) > [2]>> then\n                if <<key (w v) pressed?> or <key (up arrow v) pressed?>> then\n                    set [allowtanookiflightstart v] to [0]\n                    set [tanookiflying v] to [1]\n                end\n            end\n            set [allowtanookiflightstart v] to [1]\n            change y by (Gravity)\n            if <<touching (map v)?> or <<<touching (semisolids v)?> or <touching (platforms v)?>> and <not <(YVel) > [0]>>>> then\n                change y by ((Gravity) * (-1))\n                set [yvel v] to [0]\n                set [tanookiflying v] to [0]\n                set [allowtanookiflightstart v] to [0]\n                set [allowtanookiflight v] to [0]\n                set [tanookiusesleft v] to [10]\n                if <(TanookiFlying) = [0]> then\n                    if <(Statue) = [0]> then\n                        if <<key (w v) pressed?> or <key (up arrow v) pressed?>> then\n                            start sound [Jump v]\n                            if <([abs v] of (XVel) ) > [2]> then\n                                set [yvel v] to [20]\n                            else\n                                set [yvel v] to [18]\n                            end\n                        else\n                            if <<key (s v) pressed?> or <key (down arrow v) pressed?>> then\n                                set [crouching v] to [1]\n                            end\n                        end\n                    end\n                end\n                FindFloor\n            end\n            if <not <(Powerup) = [Tanooki]>> then\n                set [tanookiflying v] to [0]\n            end\n            if <<<(TanookiFlying) = [1]> and <(YVel) < [-8]>> and <not <<<key (w v) pressed?> or <key (up arrow v) pressed?>> or <<<key (d v) pressed?> or <key (right arrow v) pressed?>> or <<key (a v) pressed?> or <key (left arrow v) pressed?>>>>>> then\n                set [tanookiflying v] to [0]\n                set [allowtanookiflightstart v] to [0]\n                set [allowtanookiflight v] to [0]\n            end\n            if <<(AllowTanookiFlight) = [0]> and <(TanookiFlying) = [1]>> then\n                if <not <<key (w v) pressed?> or <key (up arrow v) pressed?>>> then\n                    set [allowtanookiflight v] to [1]\n                    set [tanookiflying v] to [1]\n                end\n            end\n            if <<<key (w v) pressed?> or <key (up arrow v) pressed?>> and <<<(AllowTanookiFlight) = [1]> and <<(Powerup) = [Tanooki]> and <(Statue) = [0]>>> and <<(TanookiUsesLeft) > [0]> and <(TanookiCooldown) < [0]>>>> then\n                set [yvel v] to [11]\n                set [allowtanookiflight v] to [0]\n                set [tanookicooldown v] to [0.12]\n                change [tanookiusesleft v] by (-1)\n            end\n            if <(YVel) > [0]> then\n                if <<(Powerup) = [None]> or <(Crouching) = [1]>> then\n                    switch costume to (nonetop v)\n                else\n                    switch costume to (bigtop v)\n                end\n            else\n                switch costume to (allbottom v)\n            end\n            change y by (YVel)\n            if <<touching (map v)?> or <<<touching (semisolids v)?> or <touching (platforms v)?>> and <not <(YVel) > [0]>>>> then\n                if <(YVel) > [0]> then\n                    FindCeiling\n                    set [yvel v] to [3]\n                else\n                    change y by ((YVel) * (-1))\n                    FindFloor\n                    set [yvel v] to [0]\n                end\n            end\n            if <<(Statue) = [0]> and <<(SlidingFunction) = [0]> and <(Crouching) = [0]>>> then\n                if <<<key (d v) pressed?> or <key (right arrow v) pressed?>> and <not <<key (a v) pressed?> or <key (left arrow v) pressed?>>>> then\n                    change [xvel v] by (2)\n                    point in direction (90)\n                    if <(XVel) < [2]> then\n                        change [xvel v] by (-1.99)\n                    end\n                end\n                if <<<key (a v) pressed?> or <key (left arrow v) pressed?>> and <not <<key (d v) pressed?> or <key (right arrow v) pressed?>>>> then\n                    change [xvel v] by (-2)\n                    point in direction (-90)\n                    if <(XVel) > [-2]> then\n                        change [xvel v] by (1.99)\n                    end\n                end\n            end\n            if <(SlidingFunction) = [0]> then\n                if <<(Powerup) = [None]> or <(Crouching) = [1]>> then\n                    switch costume to (nonesides v)\n                else\n                    switch costume to (bigsides v)\n                end\n                change x by (XVel)\n                YSmoothing\n                if <touching (map v)?> then\n                    set [playerx v] to ((x position) - (MapX))\n                    FindXPosition\n                    set [xvel v] to [0]\n                end\n            end\n            if <<(Crouching) = [1]> or <(Sliding) = [1]>> then\n                set [xvel v] to ((XVel) / (1.1))\n            else\n                if <([abs v] of (XVel) ) < [3.99999999999]> then\n                    set [xvel v] to ((XVel) / (2))\n                else\n                    if <(YVel) = [0]> then\n                        set [xvel v] to ((XVel) / (1.4))\n                    else\n                        set [xvel v] to ((XVel) / (1.3))\n                    end\n                end\n            end\n            if <<<([abs v] of (XVel) ) > [4]> and <(TanookiFlying) = [1]>> and <<(YVel) = [-0.4]> and <<key (w v) pressed?> or <key (up arrow v) pressed?>>>> then\n                if <(XVel) > [0]> then\n                    set [xvel v] to [4]\n                else\n                    set [xvel v] to [-4]\n                end\n            end\n            set [playerx v] to ((x position) - (MapX))\n            set [playery v] to ((y position) - (MapY))\n            if <<(Powerup) = [Fire]> and <(TanookiCooldown) < [0]>> then\n                if <key (space v) pressed?> then\n                    add ((((x position) + (((direction) / (90)) * (12))) - (MapX)) / (28)) to [fireballx v]\n                    add (((y position) - (MapY)) / (28)) to [firebally v]\n                    add (direction) to [fireballdir v]\n                    add [1] to [fireballtype v]\n                    add [0] to [fireballbounces v]\n                    set [tanookicooldown v] to [0.5]\n                    start sound [Fireball v]\n                end\n            end\n        end\n    end\n    if <<(Powerup) = [None]> or <(Crouching) = [1]>> then\n        switch costume to (nonesides v)\n    else\n        if <<(Powerup) = [Frog]> and <touching (water v)?>> then\n            switch costume to (frogswimmingsides v)\n        else\n            switch costume to (bigsides v)\n        end\n    end\nend\nif <(AllowPlayerMovement) = [1]> then\n    if <<(y position) < [-172]> and <(Dead) = [0]>> then\n        broadcast (Death v)\n    end\nend\nif <<(Dead) = [1]> or <(PassedGoal) = [1]>> then\n    set [spinning v] to [0]\n    set [statue v] to [0]\nend\nif <(Dead) = [0]> then\n    if <<(Level) = [8]> and <(Underground) = [0]>> then\n        change [mapx v] by (-1)\n    else\n        change [mapx v] by (round ((((PlayerX) * (-1)) - (MapX)) / (4)))\n        change [mapy v] by ([floor v] of (((((PlayerY) + (-32)) * (-1)) - (MapY)) / (4)) )\n    end\nend\nif <(MapX) > [600]> then\n    set [mapx v] to [600]\nend\nif <(MapX) < [-5640]> then\n    set [mapx v] to [-5640]\nend\nif <(Level) = [7]> then\n    if <(MapX) < [-3848]> then\n        set [mapx v] to [-3848]\n    end\nend\nif <(Underground) = [1]> then\n    if <<(Level) = [4]> or <(Level) = [8]>> then\n        set [mapx v] to [-2254]\n    end\n    if <(Level) = [8]> then\n        set [mapy v] to [400]\n    end\n    if <(MapY) < [222]> then\n        set [mapy v] to [222]\n    end\n    if <(MapY) > [428]> then\n        set [mapy v] to [428]\n    end\nelse\n    if <(MapY) > [-138]> then\n        set [mapy v] to [-138]\n    end\n    if <(MapY) < [-450]> then\n        set [mapy v] to [-450]\n    end\n    if <(Level) = [8]> then\n        set [mapy v] to [-153]\n        change [mapy v] by (([sin v] of ((GlobalCostumeNo.) * (24)) ) * (15))\n        if <(MapX) < [-2280]> then\n            set [mapx v] to [-2280]\n        end\n        if <(x position) > [0]> then\n            change [mapx v] by ((x position) / (-24))\n        end\n    end\nend\nif <<(Powerup) = [Tanooki]> and <<(Dead) = [0]> and <(PassedGoal) = [0]>>> then\n    if <<<<key (space v) pressed?> and <not <touching (water v)?>>> and <<(Spinning) = [0]> and <<(Statue) = [0]> and <(StatueSwapCooldown) < [-0.6]>>>> or <<(TanookiCooldown) < [-0.3]> and <(Spinning) = [1]>>> then\n        set [statue v] to [0]\n        set [tanookiflying v] to [0]\n        set [tanookiusesleft v] to [0]\n        if <(Spinning) = [1]> then\n            set [statue v] to [0]\n            set [allowplayerdamage v] to [1]\n            set [tanookicooldown v] to [0]\n            set [spinning v] to [0]\n        else\n            start sound [Spin v]\n            set [allowplayerdamage v] to [0]\n            set [tanookicooldown v] to [0]\n            set [spinning v] to [1]\n            set [playercostumeno. v] to [0.5]\n        end\n        set [statueswapcooldown v] to [0]\n    else\n        if <<<<key (m v) pressed?> or <key (e v) pressed?>> and <(StatueSwapCooldown) < [0]>> or <<(Statue) = [1]> and <(TanookiCooldown) < [-5]>>> then\n            set [spinning v] to [0]\n            set [tanookiflying v] to [0]\n            set [tanookiusesleft v] to [0]\n            if <(Statue) = [1]> then\n                set [statue v] to [0]\n                set [allowplayerdamage v] to [1]\n                set [tanookicooldown v] to [0]\n            else\n                set [statue v] to [1]\n                set [yvel v] to [-5]\n                set [allowplayerdamage v] to [0]\n                set [tanookicooldown v] to [0]\n            end\n            set [statueswapcooldown v] to [1]\n        end\n    end\nelse\n    set [statue v] to [0]\n    set [spinning v] to [0]\nend\nchange y by (-1)\nif <(Dead) = [0]> then\n    broadcast (PlayerUpdated v)\nend\nbroadcast (CostumeEverything v)\n\nwhen flag clicked\n\nwhen backdrop switches to [blue16 v]\nhide\n\ndefine Platform Gravity (gravity) Jump Height (jump height) Side Movement Speed (movement speed) Friction (friction) Slope (slope)\nchange [gravity y v] by (gravity)\nchange y by (GRAVITY Y)\nif <touching (level v)?> then\n    repeat until <not <touching (level v)?>>\n        change y by ((([abs v] of (GRAVITY Y) ) / (GRAVITY Y)) * (-1))\n    end\n    set [gravity y v] to (<<key (up arrow v) pressed?> and <(([abs v] of (GRAVITY Y) ) / (GRAVITY Y)) = [-1]>> * (jump height))\n    start sound [Jump v]\nend\nset [gravity x v] to ((((GRAVITY X) + (<key (left arrow v) pressed?> * ((movement speed) * (-1)))) + (<key (right arrow v) pressed?> * (movement speed))) * (friction))\nchange x by (GRAVITY X)\nif <touching (level v)?> then\n    change y by (SLOPE)\n    repeat until <not <touching (level v)?>>\n        change x by ((([abs v] of (GRAVITY X) ) / (GRAVITY X)) * (-1))\n    end\nend\nset [slope v] to [0]\nrepeat until <<(SLOPE) = ((slope) * (-1))> or <not <touching (level v)?>>>\n    change y by (1)\n    change [slope v] by (-1)\nend\n\nwhen flag clicked\nshow\n\nwhen flag clicked\nshow\ngo to x: (-174) y: (-95)\nforever\n    Platform Gravity [-1] Jump Height [13] Side Movement Speed [2.5] Friction [0.7] Slope [8]\n    if <touching (flag v)?> then\n        next backdrop\n        go to x: (-197) y: (-97)\n    end\n    if <touching color (#4c0909)?> then\n        broadcast (Death v)\n    end\n    if <touching color (#ffaa5a)?> then\n        go to x: (-153) y: (-46)\n    end\n    if <touching color (#483f08)?> then\n        broadcast (Death2 v)\n    end\n    if <touching color (#2d2704)?> then\n        broadcast (Death3 v)\n    end\n    if <touching color (#f2ecff)?> then\n        broadcast (Death4 v)\n    end\n    if <touching (water v)?> then\n        start sound [Swim v]\n        go to x: (-191) y: (-64)\n    end\n    if <touching (thwomps v)?> then\n        go to x: (-191) y: (-64)\n    end\n    if <touching (thwomps2 v)?> then\n        go to x: (-191) y: (-64)\n    end\n    if <touching (thwomps3 v)?> then\n        go to x: (-191) y: (-64)\n    end\n    if <touching (piranhaplants v)?> then\n        go to x: (-191) y: (-64)\n    end\n    if <touching (piranhaplants2 v)?> then\n        go to x: (-191) y: (-64)\n    end\n    if <touching (larry v)?> then\n        go to x: (-191) y: (-64)\n    end\nend\n\nwhen flag clicked\nforever\n    if <key (right arrow v) pressed?> then\n        point in direction (90)\n        switch costume to (walk1none v)\n        wait (0.07) seconds\n        switch costume to (walk2none v)\n        wait (0.07) seconds\n        switch costume to (walk3none v)\n    end\n    if <key (left arrow v) pressed?> then\n        point in direction (-90)\n        switch costume to (walk1none v)\n        wait (0.07) seconds\n        switch costume to (walk2none v)\n        wait (0.07) seconds\n        switch costume to (walk3none v)\n    end\n    if <not <<key (left arrow v) pressed?> and <key (right arrow v) pressed?>>> then\n        switch costume to (idle1none v)\n    end\nend\n\nwhen flag clicked\nforever\n    if <touching (bug fix v)?> then\n        go to x: (-197) y: (-97)\n        Platform Gravity [-1] Jump Height [13] Side Movement Speed [2.5] Friction [0.7] Slope [8]\n    end\nend\n\n@Tiles\n\nwhen flag clicked\nhide\n\n@level\n\nwhen flag clicked\nshow\ngo to x: (-32) y: (-50)\nswitch costume to (costume1 v)\n\nwhen backdrop switches to [blue2 v]\nswitch costume to (costume2 v)\n\nwhen backdrop switches to [blue3 v]\nswitch costume to (costume3 v)\n\nwhen backdrop switches to [blue4 v]\nswitch costume to (costume4 v)\n\nwhen backdrop switches to [blue5 v]\nswitch costume to (costume5 v)\n\nwhen backdrop switches to [blue6 v]\nswitch costume to (costume6 v)\n\nwhen backdrop switches to [blue7 v]\nswitch costume to (costume7 v)\n\nwhen backdrop switches to [blue8 v]\nswitch costume to (costume8 v)\n\nwhen backdrop switches to [blue9 v]\nswitch costume to (costume9 v)\n\nwhen backdrop switches to [blue10 v]\nswitch costume to (costume10 v)\n\nwhen backdrop switches to [blue11 v]\nswitch costume to (costume11 v)\n\nwhen backdrop switches to [blue12 v]\nswitch costume to (costume12 v)\n\nwhen backdrop switches to [blue13 v]\nswitch costume to (costume13 v)\n\nwhen backdrop switches to [blue14 v]\nswitch costume to (costume14 v)\n\nwhen backdrop switches to [blue15 v]\nswitch costume to (costume15 v)\n\nwhen backdrop switches to [blue16 v]\nswitch costume to (costume16 v)\n\nwhen backdrop switches to [blue17 v]\nswitch costume to (costume17 v)\n\nwhen backdrop switches to [blue18 v]\nswitch costume to (costume18 v)\n\nwhen backdrop switches to [blue19 v]\nswitch costume to (costume19 v)\n\nwhen backdrop switches to [blue20 v]\nswitch costume to (costume20 v)\n\nwhen backdrop switches to [victory v]\nhide\n\n@bug fix\n\nwhen flag clicked\nshow\ngo to x: (-31) y: (-52)\nswitch costume to (costume1 v)\ngo to [back v] layer\n\nwhen backdrop switches to [blue16 v]\nswitch costume to (costume2 v)\n\nwhen backdrop switches to [blue18 v]\ngo to x: (-27) y: (-59)\n\nwhen backdrop switches to [victory v]\nhide\n\n@Flag\n\nwhen flag clicked\nset size to (150) %\nswitch costume to (costume1 v)\nshow\ngo to x: (217) y: (-109)\n\nwhen backdrop switches to [blue7 v]\ngo to x: (193) y: (16)\n\nwhen backdrop switches to [blue8 v]\ngo to x: (217) y: (-109)\n\nwhen backdrop switches to [blue13 v]\ngo to x: (-165) y: (103)\n\nwhen backdrop switches to [blue14 v]\ngo to x: (-183) y: (105)\n\nwhen backdrop switches to [blue15 v]\ngo to x: (226) y: (-114)\n\nwhen backdrop switches to [blue17 v]\nswitch costume to (costume2 v)\nset size to (100) %\ngo to x: (208) y: (-6)\n\nwhen backdrop switches to [blue18 v]\nswitch costume to (costume3 v)\nset size to (150) %\ngo to x: (187) y: (-11)\n\nwhen backdrop switches to [blue19 v]\ngo to x: (-201) y: (111)\n\nwhen backdrop switches to [blue20 v]\ngo to x: (154) y: (24)\n\nwhen backdrop switches to [victory v]\nhide\n\n@Goombas\n\nwhen flag clicked\nswitch costume to (1 v)\ngo to x: (173) y: (-100)\nshow\nforever\n    change x by (-1)\n    if <touching (_edge_ v)?> then\n        hide\n    end\nend\n\nwhen I receive [death v]\nstart sound [Stomp v]\nswitch costume to (3 v)\nwait (0.1) seconds\nhide\n\nwhen backdrop switches to [blue2 v]\nhide\n\n@Sprite1\n\nwhen flag clicked\nhide\n\nwhen backdrop switches to [blue2 v]\nshow\ngo to x: (25) y: (-30)\n\nwhen flag clicked\ngo [forward v] (50) layers\nforever\n    next costume\n    wait (0.05) seconds\nend\n\nwhen flag clicked\nforever\n    if <touching color (#0a0000)?> then\n        hide\n    end\nend\n\nwhen backdrop switches to [blue3 v]\nhide\ngo to x: (-120) y: (-58)\n\nwhen backdrop switches to [blue5 v]\nshow\ngo to x: (-120) y: (-58)\n\nwhen backdrop switches to [blue6 v]\nhide\ngo to x: (-120) y: (-58)\n\nwhen backdrop switches to [blue12 v]\nshow\ngo to x: (-48) y: (-45)\n\nwhen backdrop switches to [blue13 v]\nhide\n\nwhen backdrop switches to [blue7 v]\ngo to x: (-120) y: (-58)\n\n@Sprite2\n\nwhen flag clicked\nhide\n\n@Goombas2\n\nwhen flag clicked\nhide\n\nwhen I receive [death v]\nstart sound [Stomp2 v]\nswitch costume to (3 v)\nwait (0.1) seconds\nhide\n\nwhen backdrop switches to [blue3 v]\ngo [forward v] (1) layers\nswitch costume to (1 v)\ngo to x: (173) y: (-100)\nshow\nforever\n    change x by (-2)\n    if <touching (_edge_ v)?> then\n        hide\n    end\nend\n\nwhen backdrop switches to [blue4 v]\nhide\n\n@Goombas3\n\nwhen flag clicked\ngo [forward v] (50) layers\nhide\n\nwhen I receive [death2 v]\nstart sound [Stomp v]\nswitch costume to (3 v)\nwait (0.1) seconds\nhide\n\nwhen backdrop switches to [blue3 v]\nswitch costume to (1 v)\nshow\ngo to x: (163) y: (-98)\nforever\n    change x by (-3)\n    if <touching (_edge_ v)?> then\n        hide\n    end\nend\n\nwhen backdrop switches to [blue4 v]\nhide\n\n@Koopas2\n\nwhen flag clicked\nhide\n\nwhen backdrop switches to [blue4 v]\ngo to x: (117) y: (-98)\nswitch costume to (2g v)\nshow\nforever\n    change x by (-2)\n    if <touching (_edge_ v)?> then\n        hide\n    end\nend\n\nwhen I receive [death3 v]\nstart sound [Kick v]\nhide\n\nwhen backdrop switches to [blue5 v]\nhide\n\n@Koopas3\n\nwhen flag clicked\nhide\n\nwhen backdrop switches to [blue4 v]\ngo to x: (23) y: (-98)\nshow\nforever\n    change x by (-3)\n    if <touching (_edge_ v)?> then\n        hide\n    end\nend\n\nwhen I receive [death4 v]\nstart sound [Kick v]\nhide\n\nwhen backdrop switches to [blue5 v]\nhide\n\n@Player2\n\nif <(AllowPlayerMovement) = [1]> then\n    switch costume to (playercentre v)\n    set [sliding v] to [0]\n    set [slidingfunction v] to [0]\n    set [crouching v] to [0]\n    change [tanookicooldown v] by ((-1) / (30))\n    change [statueswapcooldown v] by ((-1) / (10))\n    if <touching (water v)?> then\n        if <(Powerup) = [Frog]> then\n            if <<key (w v) pressed?> or <key (up arrow v) pressed?>> then\n                change [yvel v] by (1.8)\n            end\n            if <<key (s v) pressed?> or <key (down arrow v) pressed?>> then\n                change [yvel v] by (-1.8)\n            end\n            if <<key (d v) pressed?> or <key (right arrow v) pressed?>> then\n                change [xvel v] by (1.5)\n                point in direction (90)\n            end\n            if <<key (a v) pressed?> or <key (left arrow v) pressed?>> then\n                change [xvel v] by (-1.5)\n                point in direction (-90)\n            end\n            if <(YVel) > [0]> then\n                switch costume to (frogswimmingtop v)\n            else\n                switch costume to (allbottom v)\n            end\n            change y by (YVel)\n            if <<touching (map v)?> or <<<touching (semisolids v)?> or <touching (platforms v)?>> and <not <(YVel) > [0]>>>> then\n                change y by ((YVel) * (-1))\n                if <(YVel) > [0]> then\n                    FindCeilingV2\n                    set [yvel v] to [0]\n                else\n                    FindFloor\n                    set [yvel v] to [0]\n                end\n            end\n            switch costume to (frogswimmingsides v)\n            change x by (XVel)\n            YSmoothing\n            if <touching (map v)?> then\n                set [playerx v] to ((x position) - (MapX))\n                FindXPosition\n                set [xvel v] to [0]\n            end\n            if <([abs v] of (XVel) ) > [4.499999]> then\n                set [xvel v] to ((XVel) / (1.3))\n                set [yvel v] to ((YVel) / (1.3))\n            else\n                set [xvel v] to ((XVel) / (1.5))\n                set [yvel v] to ((YVel) / (1.5))\n            end\n            set [playerx v] to ((x position) - (MapX))\n            set [playery v] to ((y position) - (MapY))\n        else\n            if <(YVel) > [-2.5]> then\n                change [yvel v] by (-0.41)\n            end\n            if <(YVel) < [-2.5]> then\n                set [yvel v] to [-2.5]\n            end\n            if <<<key (w v) pressed?> or <key (up arrow v) pressed?>> and <<(Statue) = [0]> and <<(YVel) < [-1.3]> or <(YVel) = [-0.41]>>>> then\n                if <not <(YVel) = [-1.41]>> then\n                    start sound [Swim v]\n                end\n                set [yvel v] to [6]\n            end\n            if <(YVel) > [0]> then\n                if <<(Powerup) = [None]> or <(Crouching) = [1]>> then\n                    switch costume to (nonetop v)\n                else\n                    switch costume to (bigtop v)\n                end\n            else\n                switch costume to (allbottom v)\n            end\n            change y by (YVel)\n            if <<touching (map v)?> or <<<touching (semisolids v)?> or <touching (platforms v)?>> and <not <(YVel) > [0]>>>> then\n                change y by ((YVel) * (-1))\n                if <(YVel) > [0]> then\n                    FindCeilingV2\n                    set [yvel v] to [-1]\n                else\n                    FindFloor\n                    if <<(Statue) = [0]> and <<key (s v) pressed?> or <key (down arrow v) pressed?>>> then\n                        set [crouching v] to [1]\n                    end\n                    set [yvel v] to [0]\n                end\n            end\n            if <<(Statue) = [0]> and <<(SlidingFunction) = [0]> and <(Crouching) = [0]>>> then\n                if <<<key (d v) pressed?> or <key (right arrow v) pressed?>> and <not <<key (a v) pressed?> or <key (left arrow v) pressed?>>>> then\n                    change [xvel v] by (2)\n                    point in direction (90)\n                    if <(YVel) = [0]> then\n                        if <([abs v] of (XVel) ) > [2]> then\n                            if <(XVel) > [0]> then\n                                set [xvel v] to [2]\n                            else\n                                set [xvel v] to [-2]\n                            end\n                        end\n                    else\n                        if <([abs v] of (XVel) ) > [4.5]> then\n                            if <(XVel) > [0]> then\n                                set [xvel v] to [4.5]\n                            else\n                                set [xvel v] to [-4.5]\n                            end\n                        end\n                    end\n                    if <(XVel) < [2]> then\n                        if <(YVel) = [0]> then\n                            change [xvel v] by (-1.9)\n                        else\n                            change [xvel v] by (-1.75)\n                        end\n                    end\n                end\n                if <<<key (a v) pressed?> or <key (left arrow v) pressed?>> and <not <<key (d v) pressed?> or <key (right arrow v) pressed?>>>> then\n                    change [xvel v] by (-2)\n                    point in direction (-90)\n                    if <(YVel) = [0]> then\n                        if <([abs v] of (XVel) ) > [2]> then\n                            if <(XVel) > [0]> then\n                                set [xvel v] to [2]\n                            else\n                                set [xvel v] to [-2]\n                            end\n                        end\n                    else\n                        if <([abs v] of (XVel) ) > [4.5]> then\n                            if <(XVel) > [0]> then\n                                set [xvel v] to [4.5]\n                            else\n                                set [xvel v] to [-4.5]\n                            end\n                        end\n                    end\n                    if <(XVel) > [-2]> then\n                        if <(YVel) = [0]> then\n                            change [xvel v] by (1.9)\n                        else\n                            change [xvel v] by (1.75)\n                        end\n                    end\n                end\n            end\n            if <<(Powerup) = [None]> or <(Crouching) = [1]>> then\n                switch costume to (nonesides v)\n            else\n                switch costume to (bigsides v)\n            end\n            if <<(Statue) = [0]> and <(SlidingFunction) = [0]>> then\n                change x by (XVel)\n                YSmoothing\n                if <touching (map v)?> then\n                    set [playerx v] to ((x position) - (MapX))\n                    FindXPosition\n                    set [xvel v] to [0]\n                end\n            end\n            set [xvel v] to ((XVel) / (1.05))\n            set [playerx v] to ((x position) - (MapX))\n            set [playery v] to ((y position) - (MapY))\n            if <<(Powerup) = [Fire]> and <(TanookiCooldown) < [0]>> then\n                if <key (space v) pressed?> then\n                    start sound [Fireball v]\n                    add ((((x position) + (((direction) / (90)) * (8))) - (MapX)) / (28)) to [fireballx v]\n                    add (((y position) - (MapY)) / (28)) to [firebally v]\n                    add (direction) to [fireballdir v]\n                    add [1] to [fireballtype v]\n                    add [0] to [fireballbounces v]\n                    set [tanookicooldown v] to [0.5]\n                end\n            end\n        end\n        switch costume to (playercentre v)\n        if <not <touching (water v)?>> then\n            if <<key (w v) pressed?> or <key (up arrow v) pressed?>> then\n                set [yvel v] to [12]\n                if <([abs v] of (XVel) ) > [1.5]> then\n                    set [xvel v] to ((direction) / (60))\n                end\n            end\n        end\n    else\n        if <(Powerup) = [Frog]> then\n            if <<<(YVel) > [-12]> and <(Statue) = [0]>> or <<(YVel) > [-16]> and <(Statue) = [1]>>> then\n                change [yvel v] by ((Gravity) / (3.2))\n                if <<(YVel) > [0]> and <not <<key (w v) pressed?> or <key (up arrow v) pressed?>>>> then\n                    set [yvel v] to ((YVel) / (1.3))\n                end\n            end\n            switch costume to (allbottom v)\n            change y by (Gravity)\n            if <<touching (map v)?> or <<<touching (semisolids v)?> or <touching (platforms v)?>> and <not <(YVel) > [0]>>>> then\n                change y by ((Gravity) * (-1))\n                set [yvel v] to [0]\n                if <<key (w v) pressed?> or <key (up arrow v) pressed?>> then\n                    start sound [Jump v]\n                    if <([abs v] of (XVel) ) > [2]> then\n                        set [yvel v] to [20]\n                    else\n                        set [yvel v] to [18]\n                    end\n                end\n                FindFloor\n            end\n            if <(YVel) > [0]> then\n                switch costume to (bigtop v)\n            else\n                switch costume to (allbottom v)\n            end\n            change y by (YVel)\n            if <<touching (map v)?> or <<<touching (semisolids v)?> or <touching (platforms v)?>> and <not <(YVel) > [0]>>>> then\n                if <(YVel) > [0]> then\n                    FindCeiling\n                    set [yvel v] to [3]\n                else\n                    change y by ((YVel) * (-1))\n                    FindFloor\n                    set [yvel v] to [0]\n                end\n            end\n            if <<(Statue) = [0]> and <<(SlidingFunction) = [0]> and <(Crouching) = [0]>>> then\n                if <<<key (d v) pressed?> or <key (right arrow v) pressed?>> and <not <<key (a v) pressed?> or <key (left arrow v) pressed?>>>> then\n                    change [xvel v] by (1)\n                    point in direction (90)\n                end\n                if <<<key (a v) pressed?> or <key (left arrow v) pressed?>> and <not <<key (d v) pressed?> or <key (right arrow v) pressed?>>>> then\n                    change [xvel v] by (-1)\n                    point in direction (-90)\n                end\n            end\n            switch costume to (bigsides v)\n            change x by (XVel)\n            YSmoothing\n            if <touching (map v)?> then\n                set [playerx v] to ((x position) - (MapX))\n                FindXPosition\n                set [xvel v] to [0]\n            end\n            if <<(Crouching) = [1]> or <(Sliding) = [1]>> then\n                set [xvel v] to ((XVel) / (1.1))\n            else\n                if <(YVel) = [0]> then\n                    set [xvel v] to ((XVel) / (1.2))\n                    if <(([floor v] of (((PlayerCostumeNo.) * (2.5)) mod (4)) ) + (1)) = [1]> then\n                        if <([abs v] of (XVel) ) > [1]> then\n                            if <(XVel) > [0]> then\n                                set [xvel v] to [1]\n                            else\n                                set [xvel v] to [-1]\n                            end\n                        end\n                    end\n                else\n                    set [xvel v] to ((XVel) / (1.15))\n                end\n            end\n            if <<<([abs v] of (XVel) ) > [4]> and <(TanookiFlying) = [1]>> and <<(YVel) = [-0.4]> and <<key (w v) pressed?> or <key (up arrow v) pressed?>>>> then\n                if <(XVel) > [0]> then\n                    set [xvel v] to [4]\n                else\n                    set [xvel v] to [-4]\n                end\n            end\n            set [playerx v] to ((x position) - (MapX))\n            set [playery v] to ((y position) - (MapY))\n        else\n            if <<<(YVel) > [-12]> and <(Statue) = [0]>> or <<(YVel) > [-16]> and <(Statue) = [1]>>> then\n                if <<(TanookiFlying) = [1]> and <(Statue) = [0]>> then\n                    if <(YVel) > [0]> then\n                        change [yvel v] by ((Gravity) / (3.4))\n                    else\n                        if <<key (w v) pressed?> or <key (up arrow v) pressed?>> then\n                            change [yvel v] by ((Gravity) / (6))\n                            if <(YVel) < [-0.4]> then\n                                set [yvel v] to [-0.4]\n                            end\n                        else\n                            change [yvel v] by ((Gravity) / (3.4))\n                        end\n                    end\n                else\n                    if <(Statue) = [1]> then\n                        change [yvel v] by ((Gravity) / (1))\n                    else\n                        change [yvel v] by ((Gravity) / (2.9))\n                        if <<(YVel) > [0]> and <not <<key (w v) pressed?> or <key (up arrow v) pressed?>>>> then\n                            set [yvel v] to ((YVel) / (1.3))\n                        end\n                    end\n                end\n            end\n            switch costume to (allbottom v)\n            if <<<(AllowTanookiFlightStart) = [1]> and <<(Powerup) = [Tanooki]> and <(Statue) = [0]>>> and <([abs v] of (XVel) ) > [2]>> then\n                if <<key (w v) pressed?> or <key (up arrow v) pressed?>> then\n                    set [allowtanookiflightstart v] to [0]\n                    set [tanookiflying v] to [1]\n                end\n            end\n            set [allowtanookiflightstart v] to [1]\n            change y by (Gravity)\n            if <<touching (map v)?> or <<<touching (semisolids v)?> or <touching (platforms v)?>> and <not <(YVel) > [0]>>>> then\n                change y by ((Gravity) * (-1))\n                set [yvel v] to [0]\n                set [tanookiflying v] to [0]\n                set [allowtanookiflightstart v] to [0]\n                set [allowtanookiflight v] to [0]\n                set [tanookiusesleft v] to [10]\n                if <(TanookiFlying) = [0]> then\n                    if <(Statue) = [0]> then\n                        if <<key (w v) pressed?> or <key (up arrow v) pressed?>> then\n                            start sound [Jump v]\n                            if <([abs v] of (XVel) ) > [2]> then\n                                set [yvel v] to [20]\n                            else\n                                set [yvel v] to [18]\n                            end\n                        else\n                            if <<key (s v) pressed?> or <key (down arrow v) pressed?>> then\n                                set [crouching v] to [1]\n                            end\n                        end\n                    end\n                end\n                FindFloor\n            end\n            if <not <(Powerup) = [Tanooki]>> then\n                set [tanookiflying v] to [0]\n            end\n            if <<<(TanookiFlying) = [1]> and <(YVel) < [-8]>> and <not <<<key (w v) pressed?> or <key (up arrow v) pressed?>> or <<<key (d v) pressed?> or <key (right arrow v) pressed?>> or <<key (a v) pressed?> or <key (left arrow v) pressed?>>>>>> then\n                set [tanookiflying v] to [0]\n                set [allowtanookiflightstart v] to [0]\n                set [allowtanookiflight v] to [0]\n            end\n            if <<(AllowTanookiFlight) = [0]> and <(TanookiFlying) = [1]>> then\n                if <not <<key (w v) pressed?> or <key (up arrow v) pressed?>>> then\n                    set [allowtanookiflight v] to [1]\n                    set [tanookiflying v] to [1]\n                end\n            end\n            if <<<key (w v) pressed?> or <key (up arrow v) pressed?>> and <<<(AllowTanookiFlight) = [1]> and <<(Powerup) = [Tanooki]> and <(Statue) = [0]>>> and <<(TanookiUsesLeft) > [0]> and <(TanookiCooldown) < [0]>>>> then\n                set [yvel v] to [11]\n                set [allowtanookiflight v] to [0]\n                set [tanookicooldown v] to [0.12]\n                change [tanookiusesleft v] by (-1)\n            end\n            if <(YVel) > [0]> then\n                if <<(Powerup) = [None]> or <(Crouching) = [1]>> then\n                    switch costume to (nonetop v)\n                else\n                    switch costume to (bigtop v)\n                end\n            else\n                switch costume to (allbottom v)\n            end\n            change y by (YVel)\n            if <<touching (map v)?> or <<<touching (semisolids v)?> or <touching (platforms v)?>> and <not <(YVel) > [0]>>>> then\n                if <(YVel) > [0]> then\n                    FindCeiling\n                    set [yvel v] to [3]\n                else\n                    change y by ((YVel) * (-1))\n                    FindFloor\n                    set [yvel v] to [0]\n                end\n            end\n            if <<(Statue) = [0]> and <<(SlidingFunction) = [0]> and <(Crouching) = [0]>>> then\n                if <<<key (d v) pressed?> or <key (right arrow v) pressed?>> and <not <<key (a v) pressed?> or <key (left arrow v) pressed?>>>> then\n                    change [xvel v] by (2)\n                    point in direction (90)\n                    if <(XVel) < [2]> then\n                        change [xvel v] by (-1.99)\n                    end\n                end\n                if <<<key (a v) pressed?> or <key (left arrow v) pressed?>> and <not <<key (d v) pressed?> or <key (right arrow v) pressed?>>>> then\n                    change [xvel v] by (-2)\n                    point in direction (-90)\n                    if <(XVel) > [-2]> then\n                        change [xvel v] by (1.99)\n                    end\n                end\n            end\n            if <(SlidingFunction) = [0]> then\n                if <<(Powerup) = [None]> or <(Crouching) = [1]>> then\n                    switch costume to (nonesides v)\n                else\n                    switch costume to (bigsides v)\n                end\n                change x by (XVel)\n                YSmoothing\n                if <touching (map v)?> then\n                    set [playerx v] to ((x position) - (MapX))\n                    FindXPosition\n                    set [xvel v] to [0]\n                end\n            end\n            if <<(Crouching) = [1]> or <(Sliding) = [1]>> then\n                set [xvel v] to ((XVel) / (1.1))\n            else\n                if <([abs v] of (XVel) ) < [3.99999999999]> then\n                    set [xvel v] to ((XVel) / (2))\n                else\n                    if <(YVel) = [0]> then\n                        set [xvel v] to ((XVel) / (1.4))\n                    else\n                        set [xvel v] to ((XVel) / (1.3))\n                    end\n                end\n            end\n            if <<<([abs v] of (XVel) ) > [4]> and <(TanookiFlying) = [1]>> and <<(YVel) = [-0.4]> and <<key (w v) pressed?> or <key (up arrow v) pressed?>>>> then\n                if <(XVel) > [0]> then\n                    set [xvel v] to [4]\n                else\n                    set [xvel v] to [-4]\n                end\n            end\n            set [playerx v] to ((x position) - (MapX))\n            set [playery v] to ((y position) - (MapY))\n            if <<(Powerup) = [Fire]> and <(TanookiCooldown) < [0]>> then\n                if <key (space v) pressed?> then\n                    add ((((x position) + (((direction) / (90)) * (12))) - (MapX)) / (28)) to [fireballx v]\n                    add (((y position) - (MapY)) / (28)) to [firebally v]\n                    add (direction) to [fireballdir v]\n                    add [1] to [fireballtype v]\n                    add [0] to [fireballbounces v]\n                    set [tanookicooldown v] to [0.5]\n                    start sound [Fireball v]\n                end\n            end\n        end\n    end\n    if <<(Powerup) = [None]> or <(Crouching) = [1]>> then\n        switch costume to (nonesides v)\n    else\n        if <<(Powerup) = [Frog]> and <touching (water v)?>> then\n            switch costume to (frogswimmingsides v)\n        else\n            switch costume to (bigsides v)\n        end\n    end\nend\nif <(AllowPlayerMovement) = [1]> then\n    if <<(y position) < [-172]> and <(Dead) = [0]>> then\n        broadcast (Death v)\n    end\nend\nif <<(Dead) = [1]> or <(PassedGoal) = [1]>> then\n    set [spinning v] to [0]\n    set [statue v] to [0]\nend\nif <(Dead) = [0]> then\n    if <<(Level) = [8]> and <(Underground) = [0]>> then\n        change [mapx v] by (-1)\n    else\n        change [mapx v] by (round ((((PlayerX) * (-1)) - (MapX)) / (4)))\n        change [mapy v] by ([floor v] of (((((PlayerY) + (-32)) * (-1)) - (MapY)) / (4)) )\n    end\nend\nif <(MapX) > [600]> then\n    set [mapx v] to [600]\nend\nif <(MapX) < [-5640]> then\n    set [mapx v] to [-5640]\nend\nif <(Level) = [7]> then\n    if <(MapX) < [-3848]> then\n        set [mapx v] to [-3848]\n    end\nend\nif <(Underground) = [1]> then\n    if <<(Level) = [4]> or <(Level) = [8]>> then\n        set [mapx v] to [-2254]\n    end\n    if <(Level) = [8]> then\n        set [mapy v] to [400]\n    end\n    if <(MapY) < [222]> then\n        set [mapy v] to [222]\n    end\n    if <(MapY) > [428]> then\n        set [mapy v] to [428]\n    end\nelse\n    if <(MapY) > [-138]> then\n        set [mapy v] to [-138]\n    end\n    if <(MapY) < [-450]> then\n        set [mapy v] to [-450]\n    end\n    if <(Level) = [8]> then\n        set [mapy v] to [-153]\n        change [mapy v] by (([sin v] of ((GlobalCostumeNo.) * (24)) ) * (15))\n        if <(MapX) < [-2280]> then\n            set [mapx v] to [-2280]\n        end\n        if <(x position) > [0]> then\n            change [mapx v] by ((x position) / (-24))\n        end\n    end\nend\nif <<(Powerup) = [Tanooki]> and <<(Dead) = [0]> and <(PassedGoal) = [0]>>> then\n    if <<<<key (space v) pressed?> and <not <touching (water v)?>>> and <<(Spinning) = [0]> and <<(Statue) = [0]> and <(StatueSwapCooldown) < [-0.6]>>>> or <<(TanookiCooldown) < [-0.3]> and <(Spinning) = [1]>>> then\n        set [statue v] to [0]\n        set [tanookiflying v] to [0]\n        set [tanookiusesleft v] to [0]\n        if <(Spinning) = [1]> then\n            set [statue v] to [0]\n            set [allowplayerdamage v] to [1]\n            set [tanookicooldown v] to [0]\n            set [spinning v] to [0]\n        else\n            start sound [Spin v]\n            set [allowplayerdamage v] to [0]\n            set [tanookicooldown v] to [0]\n            set [spinning v] to [1]\n            set [playercostumeno. v] to [0.5]\n        end\n        set [statueswapcooldown v] to [0]\n    else\n        if <<<<key (m v) pressed?> or <key (e v) pressed?>> and <(StatueSwapCooldown) < [0]>> or <<(Statue) = [1]> and <(TanookiCooldown) < [-5]>>> then\n            set [spinning v] to [0]\n            set [tanookiflying v] to [0]\n            set [tanookiusesleft v] to [0]\n            if <(Statue) = [1]> then\n                set [statue v] to [0]\n                set [allowplayerdamage v] to [1]\n                set [tanookicooldown v] to [0]\n            else\n                set [statue v] to [1]\n                set [yvel v] to [-5]\n                set [allowplayerdamage v] to [0]\n                set [tanookicooldown v] to [0]\n            end\n            set [statueswapcooldown v] to [1]\n        end\n    end\nelse\n    set [statue v] to [0]\n    set [spinning v] to [0]\nend\nchange y by (-1)\nif <(Dead) = [0]> then\n    broadcast (PlayerUpdated v)\nend\nbroadcast (CostumeEverything v)\n\nwhen backdrop switches to [blue16 v]\nshow\ngo to x: (-174) y: (-95)\nforever\n    Platform Gravity [-1] Jump Height [13] Side Movement Speed [2.5] Friction [0.7] Slope [8]\n    if <touching (flag v)?> then\n        next backdrop\n        go to x: (-197) y: (-97)\n    end\n    if <touching color (#4c0909)?> then\n        broadcast (Death v)\n    end\n    if <touching color (#ffaa5a)?> then\n        go to x: (-153) y: (-46)\n    end\n    if <touching color (#483f08)?> then\n        broadcast (Death2 v)\n    end\n    if <touching color (#2d2704)?> then\n        broadcast (Death3 v)\n    end\n    if <touching color (#f2ecff)?> then\n        broadcast (Death4 v)\n    end\n    if <touching (de v)?> then\n        go to x: (-153) y: (-46)\n    end\n    if <touching (background v)?> then\n        start sound [Swim v]\n        go to x: (-153) y: (-46)\n    end\nend\n\ndefine Platform Gravity (gravity) Jump Height (jump height) Side Movement Speed (movement speed) Friction (friction) Slope (slope)\nchange [gravity y v] by (gravity)\nchange y by (GRAVITY Y)\nif <touching (level v)?> then\n    repeat until <not <touching (level v)?>>\n        change y by ((([abs v] of (GRAVITY Y) ) / (GRAVITY Y)) * (-1))\n    end\n    set [gravity y v] to (<<key (up arrow v) pressed?> and <(([abs v] of (GRAVITY Y) ) / (GRAVITY Y)) = [-1]>> * (jump height))\n    start sound [Jump v]\nend\nset [gravity x v] to ((((GRAVITY X) + (<key (left arrow v) pressed?> * ((movement speed) * (-1)))) + (<key (right arrow v) pressed?> * (movement speed))) * (friction))\nchange x by (GRAVITY X)\nif <touching (level v)?> then\n    change y by (SLOPE)\n    repeat until <not <touching (level v)?>>\n        change x by ((([abs v] of (GRAVITY X) ) / (GRAVITY X)) * (-1))\n    end\nend\nset [slope v] to [0]\nrepeat until <<(SLOPE) = ((slope) * (-1))> or <not <touching (level v)?>>>\n    change y by (1)\n    change [slope v] by (-1)\nend\n\nwhen flag clicked\nshow\n\nwhen flag clicked\nhide\n\nwhen flag clicked\nforever\n    if <key (right arrow v) pressed?> then\n        point in direction (90)\n        switch costume to (walk1frog v)\n        wait (0.07) seconds\n        switch costume to (walk2frog v)\n        wait (0.07) seconds\n        switch costume to (walk3frog v)\n        wait (0.07) seconds\n        switch costume to (walk4frog v)\n    end\n    if <key (left arrow v) pressed?> then\n        point in direction (-90)\n        switch costume to (walk1frog v)\n        wait (0.07) seconds\n        switch costume to (walk2frog v)\n        wait (0.07) seconds\n        switch costume to (walk3frog v)\n        wait (0.07) seconds\n        switch costume to (walk4frog v)\n    end\n    if <not <<key (left arrow v) pressed?> and <key (right arrow v) pressed?>>> then\n        switch costume to (idle1frog v)\n    end\nend\n\nwhen flag clicked\nforever\n    if <touching (bug fix v)?> then\n        go to x: (-197) y: (-97)\n        Platform Gravity [-1] Jump Height [13] Side Movement Speed [2.5] Friction [0.7] Slope [8]\n    end\nend\n\nwhen backdrop switches to [victory v]\nhide\n\n@Goombas4\n\nwhen flag clicked\nhide\n\ngo to x: (173) y: (-100)\nshow\nforever\n    change x by (-1)\n    if <touching (_edge_ v)?> then\n        hide\n    end\nend\n\nwhen I receive [death v]\nstart sound [Stomp v]\nswitch costume to (3 v)\nwait (0.1) seconds\nhide\n\nwhen backdrop switches to [blue5 v]\nshow\nswitch costume to (1 v)\ngo to x: (107) y: (-8)\nforever\n    if <(x position) = [107]> then\n        repeat (40)\n            change x by (-3)\n        end\n    end\n    if <(x position) = [-13]> then\n        repeat (40)\n            change x by (3)\n        end\n    end\nend\n\nwhen backdrop switches to [blue6 v]\nhide\n\n@Goombas5\n\nwhen flag clicked\nhide\n\nwhen I receive [death2 v]\nstart sound [Stomp v]\nswitch costume to (3 v)\nwait (0.1) seconds\nhide\n\nwhen backdrop switches to [blue5 v]\nshow\nswitch costume to (1 v)\ngo to x: (175) y: (-101)\nforever\n    change x by (-3)\n    if <touching (_edge_ v)?> then\n        hide\n    end\nend\n\nwhen backdrop switches to [blue6 v]\nhide\n\n@water\n\nwhen flag clicked\nhide\n\nwhen backdrop switches to [blue7 v]\nshow\ngo to x: (207) y: (-137)\n\nwhen backdrop switches to [blue8 v]\nhide\n\nwhen backdrop switches to [blue13 v]\ngo to x: (282) y: (-138)\nshow\n\nwhen backdrop switches to [blue14 v]\ngo to x: (258) y: (-139)\n\nhide\n\nwhen backdrop switches to [blue15 v]\nhide\n\n@Thwomps\n\nwhen flag clicked\nhide\n\nwhen backdrop switches to [blue8 v]\nshow\ngo to x: (4) y: (131)\nforever\n    if <(y position) = [131]> then\n        repeat (67)\n            switch costume to (3 v)\n            change y by (-3)\n        end\n    end\n    if <(y position) = [-70]> then\n        repeat (67)\n            switch costume to (2 v)\n            change y by (3)\n        end\n    end\nend\n\nwhen backdrop switches to [blue9 v]\nhide\n\n@Thwomps2\n\nwhen flag clicked\nhide\n\nwhen backdrop switches to [blue8 v]\n\nshow\n\ngo to x: (4) y: (131)\n\nwhen backdrop switches to [blue9 v]\nshow\ngo to x: (-113) y: (138)\nforever\n    if <(y position) = [138]> then\n        repeat (68)\n            switch costume to (3 v)\n            change y by (-3)\n        end\n    end\n    if <(y position) = [-66]> then\n        repeat (68)\n            switch costume to (2 v)\n            change y by (3)\n        end\n    end\nend\n\nwhen backdrop switches to [blue10 v]\nhide\n\n@Thwomps3\n\nwhen flag clicked\nhide\n\nwhen backdrop switches to [blue9 v]\nshow\ngo to x: (101) y: (-72)\nforever\n    if <(y position) = [-72]> then\n        repeat (67)\n            switch costume to (3 v)\n            change y by (3)\n        end\n    end\n    if <(y position) = [129]> then\n        repeat (67)\n            switch costume to (2 v)\n            change y by (-3)\n        end\n    end\nend\n\nwhen backdrop switches to [blue9 v]\nshow\n\nwhen backdrop switches to [blue10 v]\nhide\n\n@Goombas6\n\nwhen flag clicked\nhide\n\nwhen I receive [death2 v]\nstart sound [Stomp v]\nswitch costume to (3 v)\nwait (0.1) seconds\nhide\n\nwhen backdrop switches to [blue10 v]\nshow\nswitch costume to (1 v)\ngo to x: (52) y: (-98)\nforever\n    if <(x position) = [52]> then\n        repeat (68)\n            change x by (-2)\n        end\n    end\n    if <(x position) = [-84]> then\n        repeat (68)\n            change x by (2)\n        end\n    end\nend\n\nchange x by (-3)\nif <touching (_edge_ v)?> then\n    hide\nend\n\nwhen backdrop switches to [blue6 v]\nhide\n\nwhen backdrop switches to [blue11 v]\nhide\n\n@PiranhaPlants\n\nwhen flag clicked\nhide\n\nwhen backdrop switches to [blue10 v]\nshow\ngo to [back v] layer\ngo to x: (-121) y: (-92)\nforever\n    if <(y position) = [-92]> then\n        wait (1) seconds\n        repeat (27)\n            change y by (2)\n        end\n    end\n    if <(y position) = [-38]> then\n        wait (1) seconds\n        repeat (27)\n            change y by (-2)\n        end\n    end\n    if <(y position) = [-38]> then\n    end\nend\n\nrepeat (27)\n    change y by (2)\nend\n\nforever\nend\n\nwhen flag clicked\nforever\n    next costume\n    wait (0.5) seconds\nend\n\nwhen backdrop switches to [blue11 v]\nhide\n\n@PiranhaPlants2\n\nwhen flag clicked\nhide\n\nwhen backdrop switches to [blue10 v]\nshow\ngo to [back v] layer\ngo to x: (96) y: (-89)\nforever\n    if <(y position) = [-89]> then\n        wait (1) seconds\n        repeat (27)\n            change y by (2)\n        end\n    end\n    if <(y position) = [-35]> then\n        wait (1) seconds\n        repeat (27)\n            change y by (-2)\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    next costume\n    wait (0.5) seconds\nend\n\nwhen backdrop switches to [blue11 v]\nhide\n\n@Setting\n\nwhen flag clicked\nhide\n\n@Thumbnail\n\nwhen flag clicked\ngo to x: (36) y: (28)\nset [ghost v] effect to (100)\ngo to [front v] layer\nshow\n\n@Larry\n\nwhen flag clicked\nhide\n\nwhen backdrop switches to [blue12 v]\nshow\ngo to x: (128) y: (-98)\nforever\n    if <(x position) = [128]> then\n        glide (1.23) secs to x: (50) y: (110)\n    end\n    if <(y position) = [110]> then\n        glide (0.6) secs to x: (52) y: (-99)\n    end\n    if <(x position) = [52]> then\n        glide (1) secs to x: (-19) y: (14)\n    end\n    if <(y position) = [14]> then\n        glide (0.7) secs to x: (-26) y: (-18)\n    end\n    if <(y position) = [-18]> then\n        glide (1) secs to x: (-123) y: (30)\n    end\n    if <(y position) = [30]> then\n        glide (0.6) secs to x: (-133) y: (-101)\n    end\n    if <(x position) = [-133]> then\n        repeat (25)\n            change x by (-4)\n        end\n        if <touching (_edge_ v)?> then\n            hide\n        end\n    end\nend\n\nset rotation style [left-right v]\n\nwhen backdrop switches to [blue13 v]\nhide\n\n@Goombas7\n\nwhen flag clicked\nhide\n\nwhen I receive [death2 v]\nstart sound [Stomp v]\nswitch costume to (3 v)\nwait (0.1) seconds\nhide\n\nwhen backdrop switches to [blue14 v]\nswitch costume to (1 v)\nshow\ngo to x: (38) y: (-22)\nforever\n    if <(x position) = [38]> then\n        repeat (50)\n            change x by (-2)\n        end\n    end\n    if <(x position) = [-62]> then\n        repeat (50)\n            change x by (2)\n        end\n    end\nend\n\nwhen backdrop switches to [blue15 v]\nhide\n\n@Koopas4\n\nwhen flag clicked\nhide\n\nwhen I receive [death4 v]\nstart sound [Kick v]\nhide\n\nwhen backdrop switches to [blue14 v]\nshow\ngo to x: (32) y: (97)\npoint in direction (-90)\nforever\n    if <(x position) = [32]> then\n        point in direction (-90)\n        repeat (35)\n            change x by (-3)\n        end\n    end\n    if <(x position) = [-73]> then\n        point in direction (90)\n        repeat (35)\n            change x by (3)\n        end\n    end\nend\n\nwhen backdrop switches to [blue15 v]\nhide\n\n@de\n\nwhen flag clicked\nhide\n\nwhen backdrop switches to [blue16 v]\nshow\ngo to x: (21) y: (-73)\n\nwhen backdrop switches to [blue17 v]\nhide\n\n@Background\n\nwhen flag clicked\nhide\nforever\n    next costume\n    wait (0.1) seconds\nend\n\nwhen backdrop switches to [blue18 v]\nshow\ngo to x: (731) y: (-92)\n\nwhen backdrop switches to [blue19 v]\ngo to x: (697) y: (-91)\n\nwhen backdrop switches to [victory v]\nhide\n\n
——————INSTRUCTIONS—————\n• Arrow keys to move\n• You can now crush goombas and koompas\n• Avoid water, lava, larry\n•Avoid other dangerous looking creatures as well\n• For some reason you will turn into a frog :p\n————————————————————————\n•No Ads\n