MARIO PLATFORMER

Instructions: Use WASD or arrow keys to move.\nComplete 25 levels of this simple platformer to win! The levels get harder!\n\n❤️ + ⭐ if you liked this game!\nFollow me for more games!\n\nThere is a challenge with 5 hard levels! All the levels are possible. There is a personal record and a world record. This is mobile friendly.\n\nCredits:\n@janek-polski for platformer engine\nOrbs inspired by Geometry Dash\n\nMusic:\nGonna Fly Now - Rocky\nPump It Instrumental\n\nThis is so generic... This was made to appear here #platformer

@Stage\n\nwhen flag clicked\nset volume to (10) %\nforever\n    play sound [Wake Me up When September Ends v] until done\nend\n\nwhen flag clicked\nforever\n    broadcast (Tick v)\nend\n\nwhen flag clicked\nforever\n    set volume to ((MUSIC VOLUME) - (70)) %\n    if <(LEVEL) < [5]> then\n        switch backdrop to (normal v)\n    else\n        switch backdrop to (cave v)\n    end\n    if <(LEVEL) = [4]> then\n        switch backdrop to (fade v)\n    end\n    if <(LEVEL) = [7]> then\n        switch backdrop to (fade v)\n    end\n    if <(LEVEL) = [8]> then\n        switch backdrop to (normal v)\n    end\n    if <(LEVEL) = [9]> then\n        switch backdrop to (normal v)\n    end\n    if <(LEVEL) = [10]> then\n        switch backdrop to (normal v)\n    end\n    if <(LEVEL) = [11]> then\n        switch backdrop to (fade2 v)\n    end\n    if <(LEVEL) = [12]> then\n        switch backdrop to (fade2 v)\n    end\nend\n\n@Grunge\n\nwhen flag clicked\ngo to x: (0) y: (0)\nshow\ngo to [front v] layer\nset [ghost v] effect to (90)\nbroadcast (Layer v)\n\nrepeat until <(timer) > [5]>\nend\n\nwhen I receive [layer v]\ngo to [back v] layer\n\n@Sprite1\n\ndefine Reset\npoint in direction (90)\nset size to (20) %\nset rotation style [left-right v]\nif <(LEVEL) = [9]> then\n    go to x: (-200) y: (-100)\nelse\n    go to x: (-200) y: (0)\nend\nshow\nset [speed y v] to [0]\nset [falling? v] to [10]\n\nwhen I receive [green flag clicked v]\nReset\nset [level v] to [1]\nforever\n    go to [back v] layer\n    Platforming Engine\n    if <<touching (moving spikes v)?> or <<touching (spikes v)?> or <touching (right/left v)?>>> then\n        switch costume to (die  v)\n        if <(SFX VOLUME) = [1]> then\n            start sound [whoop v]\n        end\n        Go down\n        repeat (11)\n            next costume\n        end\n        repeat (20)\n            change [ghost v] effect by (5)\n        end\n        broadcast (Retry v)\n        set [ghost v] effect to (0)\n        go to x: (-200) y: (0)\n    end\nend\n\ndefine Walk (direction) (speed)\npoint in direction (direction)\nchange x by (speed)\nset [slope v] to [0]\nrepeat until <<(slope) = [8]> or <not <<touching (ground v)?> or <touching (moving platforms v)?>>>>\n    change y by (1)\n    change [slope v] by (1)\nend\nif <(slope) = [8]> then\n    change x by ((0) - (speed))\n    change y by ((0) - (slope))\n    if <<<key (w v) pressed?> or <<key (space v) pressed?> or <<key (up arrow v) pressed?> or <<mouse down?> and <(mouse y) > (y position)>>>>> and <([abs v] of (speed) ) > [3]>> then\n        if <(SFX VOLUME) = [1]> then\n            start sound [Jump v]\n        end\n        if <(Wall Jump) = [0]> then\n            set [speed x v] to ((-1.2) * (speed))\n            set [max bounce v] to [11]\n            set [speed y v] to [11]\n            set [falling? v] to [6]\n            set [wall jump v] to [15]\n        end\n    else\n        set [speed x v] to [0]\n    end\nend\nif <(speed) < [0]> then\n    change [frame v] by ((speed) / (-8))\nelse\n    change [frame v] by ((speed) / (8))\nend\n\nwhen I receive [retry v]\nReset\n\nwhen I receive [next level v]\nReset\n\ndefine Set Costume\nif <(falling?) < [6]> then\n    if <(frame) = [0]> then\n        switch costume to ([floor v] of ((13) + ((Idle Frame) mod (15))) )\n        change [idle frame v] by (pick random (0.3) to (0.7))\n    else\n        switch costume to ([floor v] of ((29) + ((frame) mod (15))) )\n    end\nelse\n    if <touching (ladder v)?> then\n        switch costume to ([floor v] of ((61) + (((timer) * (10)) mod (3))) )\n    else\n        switch costume to ([floor v] of ((((15) / ((Max Bounce) * (2))) * ((speed y) + (Max Bounce))) + (45)) )\n    end\nend\nif <<(costume [number v]) = [29]> or <(costume [number v]) = [37]>> then\n    if <(SFX VOLUME) = [1]> then\n        start sound (join [Walking Sound] (pick random (2) to (8)))\n    end\nend\n\ndefine Touch Ground <up?>\nchange [falling? v] by (1)\nrepeat until <not <<touching (moving platforms v)?> or <touching (ground v)?>>>\n    if <up?> then\n        change y by (-1)\n    else\n        change y by (1)\n        set [falling? v] to [0]\n    end\n    set [speed y v] to [0]\nend\n\nwhen flag clicked\nhide\n\ndefine Go down\nrepeat until <<touching (ground v)?> or <<touching (moving platforms v)?> or <touching (_edge_ v)?>>>\n    change y by (-2)\nend\n\nwhen flag clicked\nset [level v] to [1]\n\ndefine Platforming Engine\nswitch costume to (hitbox v)\nif <<(speed y) < [4]> or <<key (w v) pressed?> or <<key (space v) pressed?> or <<key (up arrow v) pressed?> or <<mouse down?> and <(mouse y) > (y position)>>>>>> then\n    change [speed y v] by (-1)\nelse\n    change [speed y v] by (-2)\nend\nif <touching (water v)?> then\n    if <<key (w v) pressed?> or <<key (space v) pressed?> or <<key (up arrow v) pressed?> or <<mouse down?> and <(mouse y) > (y position)>>>>> then\n        change [speed y v] by (5)\n    end\n    set [speed y v] to ((speed y) * (0.6))\n    change [speed y v] by (-1)\nend\nchange y by (speed y)\nTouch Ground <(speed y) > [0]>\nif <(Wall Jump) > [0]> then\n    change [wall jump v] by (-1)\nelse\n    set [speed x v] to ((speed x) * (0.7))\n    if <<key (left arrow v) pressed?> or <<key (a v) pressed?> or <<mouse down?> and <(x position) > (mouse x)>>>> then\n        change [speed x v] by (-1.5)\n    end\n    if <<key (right arrow v) pressed?> or <<key (d v) pressed?> or <<mouse down?> and <(mouse x) > (x position)>>>> then\n        change [speed x v] by (1.5)\n    end\nend\nif <(speed x) < [-0.5]> then\n    Walk (-90) (speed x)\nelse\n    if <(speed x) > [0.5]> then\n        Walk (90) (speed x)\n    else\n        set [frame v] to [0]\n    end\nend\nif <<key (w v) pressed?> or <<key (space v) pressed?> or <<key (up arrow v) pressed?> or <<mouse down?> and <(mouse y) > (y position)>>>>> then\n    if <<(jump key) = [0]> and <(falling?) < [3]>> then\n        if <(SFX VOLUME) = [1]> then\n            start sound [Jump v]\n        end\n        set [max bounce v] to [14]\n        set [speed y v] to [14]\n        set [falling? v] to [6]\n        set [jump key v] to [1]\n    end\nelse\n    set [jump key v] to [0]\nend\nif <(y position) < [-180]> then\n    go to x: (-200) y: (0)\n    broadcast (Retry v)\n    set [speed y v] to [0]\nend\nif <touching (portal v)?> then\n    if <not <(LEVEL) = (MAX LEVEL)>> then\n        broadcast (Respawn v)\n        if <(SFX VOLUME) = [1]> then\n            start sound [Connect v]\n        end\n        go to x: (-200) y: (0)\n        change [level v] by (1)\n        Reset\n    end\nend\nif <touching (bounce v)?> then\n    if <(SFX VOLUME) = [1]> then\n        start sound [Jump v]\n    end\n    set [max bounce v] to [25]\n    set [speed y v] to [25]\nend\nif <(x position) < [-190]> then\n    set x to (-190)\nend\nif <<<key (w v) pressed?> or <<key (space v) pressed?> or <<key (up arrow v) pressed?> or <<mouse down?> and <(mouse y) > (y position)>>>>> and <touching (ladder v)?>> then\n    set [speed y v] to [5]\nend\nSet Costume\n\nbroadcast (Green Flag clicked v)\n\nwhen I receive [retry v]\nReset\n\nwhen I receive [green flag clicked v]\nforever\n    if <<touching (moving platforms v)?> and <(LEVEL) = [6]>> then\n        change x by ((([x position v] of [moving platforms v]) - (x position)) / (4))\n    end\nend\n\nif <[] = [right]> then\n    change x by (3)\nelse\n    change x by (-3)\nend\n\nset x to (-190)\n\nwhen I receive [layer v]\ngo to [back v] layer\n\n@Ground\n\nwhen flag clicked\nswitch costume to (level 1 v)\nforever\n    switch costume to (LEVEL)\nend\n\nwhen I receive [layer v]\ngo to [back v] layer\n\n@Text\n\nwhen flag clicked\nbroadcast (Green Flag clicked v)\nforever\n    go to [back v] layer\n    switch costume to (LEVEL)\nend\n\n@grass\n\ndefine Grass from (xpos1) to (xpos2) (y)\nshow\ngo to x: (xpos1) y: (y)\npoint in direction (90)\nrepeat until <(x position) = (xpos2)>\n    change x by (1)\n    set size to (pick random (80) to (100)) %\n    if <not <(pick random (1) to (2)) = [1]>> then\n        create clone of (_myself_ v)\n    end\nend\nhide\n\nwhen I start as a clone\nPosition Grass [3]\nforever\n    if <touching (sprite1 v)?> then\n        Sway\n        wait until <not <touching (sprite1 v)?>>\n    end\nend\n\ndefine Position Grass (x pos amount)\nswitch costume to (base hitbox v)\nif <touching (ground v)?> then\n    repeat until <<not <touching (ground v)?>> or <touching (_edge_ v)?>>\n        change y by (1)\n    end\n    if <touching (_edge_ v)?> then\n        delete this clone\n    end\nelse\n    repeat until <touching (ground v)?>\n        change y by (-2)\n        if <touching (_edge_ v)?> then\n            delete this clone\n        end\n    end\nend\nchange y by (-5)\nchange x by ((0) - (x pos amount))\nif <not <touching (ground v)?>> then\n    delete this clone\nend\nchange x by ((2) * (x pos amount))\nif <not <touching (ground v)?>> then\n    delete this clone\nend\nchange x by ((0) - (x pos amount))\nswitch costume to (pick random (1) to (5))\nchange y by (10)\nif <touching (water v)?> then\n    delete this clone\nend\nchange y by (-10)\n\ndefine Sway\nset [velocity v] to ((([speed x v] of [sprite1 v]) + (pick random (-2.0) to (2.0))) * (6))\nset [sine v] to [0]\nrepeat until <<[0] = (round ((Velocity) * (2)))> or <<touching (sprite1 v)?> and <([abs v] of (Velocity) ) < ([abs v] of ((speed x2) * (2)) )>>>\n    point in direction ((90) - (([sin v] of (Sine) ) * (Velocity)))\n    change [sine v] by (-10)\n    set [velocity v] to ((0.95) * (Velocity))\nend\n\nwhen flag clicked\nwait (0.05) seconds\nGrass from [-240] to [240] [150]\n\nwhen I receive [--explosion-- v]\n\nwhen [space v] key pressed\nbroadcast (--Explosion-- v)\n\nGrass from [-28] to [240] [-150]\n\nwhen I receive [respawn v]\ndelete this clone\n\nwhen I receive [respawn v]\nwait (0.05) seconds\nRespawn\nwait (0.1) seconds\nif <(LEVEL) = [5]> then\n    Grass from [-240] to [240] [0]\nend\nif <(LEVEL) = [6]> then\n    Grass from [-240] to [240] [0]\nend\n\nwhen I receive [retry v]\nbroadcast (Respawn v)\n\ndefine Respawn\nGrass from [-240] to [240] [150]\nif <(LEVEL) = [4]> then\n    Grass from [100] to [240] [0]\nend\n\nwhen I receive [layer v]\ngo to [back v] layer\n\n@1s GUI\n\nwhen flag clicked\nhide\nClone\n\ndefine Clone\nset [menu showing? v] to [0]\ngo to x: (-220) y: (160)\nswitch costume to (skip level v)\nrepeat (4)\n    create clone of (_myself_ v)\n    change x by (30)\n    next costume\nend\ngo to x: (-220) y: (-160)\n\nwhen I start as a clone\nshow\nset [old x v] to (x position)\nset [old y v] to (y position)\nset [target x v] to (x position)\nset [target y v] to (y position)\nset [ghost v] to [60]\nset [size vel v] to [0]\nif <(costume [number v]) = [4]> then\n    go to [front v] layer\nend\nforever\n    Tick\nend\n\nwhen this sprite clicked\nClicked Action\n\nwhen I receive [close menu v]\nif <(costume [number v]) < [5]> then\n    set [target x v] to (Old X)\n    set [target y v] to (Old Y)\nend\n\nwhen I receive [close settings v]\nif <[4] < (costume [number v])> then\n    set [target x v] to (Old X)\n    set [target y v] to (Old Y)\nend\n\nchange [ghost v] by (1)\n\ndefine Clicked Action\nif <(SFX VOLUME) = [1]> then\n    start sound [Mouse Click v]\nend\nif <(costume [number v]) = [10]> then\n    switch costume to (music on v)\nend\nif <(costume [number v]) = [6]> then\n    switch costume to (music off v)\nend\nif <(costume [number v]) = [9]> then\n    switch costume to (sfx on v)\nend\nif <(costume [number v]) = [5]> then\n    switch costume to (sfx off v)\nend\nif <(costume [number v]) = [1]> then\n    if <not <(LEVEL) = [12]>> then\n        broadcast (Retry v)\n        change [level v] by (1)\n    end\nend\nif <(costume [number v]) = [2]> then\n    broadcast (Retry v)\nend\nif <(costume [number v]) = [4]> then\n    if <(MENU SHOWING?) = [1]> then\n        set [menu showing? v] to [0]\n    else\n        set [menu showing? v] to [1]\n        broadcast (Close menu v)\n    end\nend\nif <(costume [number v]) = [7]> then\n    if <(SETTINGS SHOWING?) = [1]> then\n        set [settings showing? v] to [0]\n    else\n        set [settings showing? v] to [1]\n        broadcast (Close Settings v)\n    end\nend\nif <(costume [number v]) = [3]> then\n    switch costume to (help menu v)\n    set [ghost v] to [100]\n    set [ghost v] effect to (Ghost)\n    set [old x v] to (x position)\n    set [old y v] to (y position)\n    go to x: (0) y: (0)\n    set size to (100) %\n    go to [front v] layer\n    repeat (10)\n        change [ghost v] by (((-1000) - (Ghost)) / (3))\n        set [ghost v] effect to (Ghost)\n    end\n    wait (3) seconds\n    set [target x v] to (Old X)\n    set [target y v] to (Old Y)\n    switch costume to (help v)\n    repeat (10)\n        change [ghost v] by (((60) - (Ghost)) / (2))\n        set [ghost v] effect to (Ghost)\n    end\nend\n\ndefine Tick\nif <not <(costume [number v]) = [8]>> then\n    set [ghost v] effect to (Ghost)\n    go to x: ((x position) + (((Target X) - (x position)) / (3))) y: ((y position) + (((Target Y) - (y position)) / (3)))\n    if <<(MENU SHOWING?) = [0]> and <(costume [number v]) < [5]>> then\n        set [target x v] to [-220]\n        set [target y v] to [160]\n        if <(costume [number v]) = [4]> then\n            if <touching (mouse-pointer v)?> then\n                change [ghost v] by (((40) - (Ghost)) / (2))\n                change size by (((120) - (size)) / (2))\n            else\n                change [ghost v] by (((60) - (Ghost)) / (2))\n                change size by (((100) - (size)) / (2))\n            end\n        else\n            change [ghost v] by (((100) - (Ghost)) / (2))\n            change size by (((100) - (size)) / (2))\n        end\n    else\n        if <touching (mouse-pointer v)?> then\n            change [ghost v] by (((40) - (Ghost)) / (2))\n            change size by (((120) - (size)) / (2))\n        else\n            change [ghost v] by (((60) - (Ghost)) / (2))\n            change size by (((100) - (size)) / (2))\n        end\n    end\nend\nif <<(SETTINGS SHOWING?) = [0]> and <(costume [number v]) > [4]>> then\n    set [target x v] to [-220]\n    set [target y v] to [-160]\nend\nif <(costume [number v]) > [4]> then\n    if <(costume [number v]) = [7]> then\n        change [ghost v] by (((60) - (Ghost)) / (2))\n        change size by (((100) - (size)) / (2))\n    else\n        if <(SETTINGS SHOWING?) = [0]> then\n            change [ghost v] by (((150) - (Ghost)) / (2))\n            change size by (((100) - (size)) / (2))\n        end\n    end\nend\nif <(costume [name v]) = [Music Off]> then\n    set [music volume v] to [0]\nend\nif <(costume [name v]) = [Music On]> then\n    set [music volume v] to [100]\nend\nif <(costume [name v]) = [SFX Off]> then\n    set [sfx volume v] to [0]\nend\nif <(costume [name v]) = [SFX On]> then\n    set [sfx volume v] to [1]\nend\n\nwhen I start as a clone\nforever\n\nwait until <<touching (mouse-pointer v)?> and <mouse down?>>\nwait until <not <<touching (mouse-pointer v)?> and <mouse down?>>>\n\nwhen I receive [tick v]\nif <<(costume [number v]) = [4]> or <(costume [number v]) = [7]>> then\n    go to [front v] layer\nend\n\nwhen I receive [layer v]\ngo to [front v] layer\n\n@Portal\n\nwhen flag clicked\ngo to x: (200) y: (-50)\nset [ghost v] effect to (70)\ncreate clone of (_myself_ v)\nforever\n    set size to (50) %\n    turn right (5) degrees\nend\n\nwhen I start as a clone\nforever\n    turn left (5) degrees\n    set size to (50) %\nend\n\ndefine Position Portal (level)\nshow\nif <(level) < [4]> then\n    go to x: (200) y: (-50)\nend\nif <(level) = [4]> then\n    go to x: (200) y: (-30)\nend\nif <(level) = [6]> then\n    go to x: (200) y: (-10)\nend\nif <(level) = [7]> then\n    go to x: (200) y: (50)\nend\nif <(level) = [8]> then\n    go to x: (200) y: (-50)\nend\nif <(level) = [9]> then\n    go to x: (-50) y: (100)\nend\nif <(level) = [10]> then\n    go to x: (200) y: (-100)\nend\nif <(level) = [11]> then\n    go to x: (-50) y: (120)\nend\nif <(level) = [12]> then\n    hide\nend\n\nwhen I receive [tick v]\nPosition Portal (LEVEL)\n\n@Spikes\n\nwhen flag clicked\nforever\n    switch costume to (LEVEL)\nend\n\nwhen flag clicked\nrepeat (20)\n    go to [back v] layer\nend\n\n@Water\n\nwhen flag clicked\nclear graphic effects\nhide\ngo to x: (0) y: (0)\nset [me v] to [1]\nrepeat (3)\n    create clone of (_myself_ v)\n    change y by (-5)\n    change [brightness v] effect by (-10)\n    change [me v] by (1)\nend\n\nwhen I start as a clone\nshow\nforever\n    set [ghost v] effect to (60)\n    go to [back v] layer\n    switch costume to (LEVEL)\n    set y to ((([sin v] of (((timer) + (me)) * (300)) ) * (8)) - ((me) * (10)))\nend\n\n@Torches\n\ndefine Make torch (x) (y)\ngo to x: (x) y: (y)\nswitch costume to (costume2 v)\nset [ghost v] effect to (90)\nSet size to [100]\nSet size to [150]\nSet size to [200]\nSet size to [250]\ncreate clone of (_myself_ v)\n\ndefine Set size to (size)\nset size to ((size) + (([sin v] of (((timer) + ((size) / (100))) * (300)) ) * (10))) %\nstamp\n\nwhen I start as a clone\nset size to (pick random (80) to (90)) %\nshow\nswitch costume to (costume1 v)\nset [color v] effect to (pick random (-10) to (10))\nset [ghost v] effect to (pick random (40) to (60))\nset [rotation v] to (pick random (-10) to (10))\nset [xv v] to (pick random (-5) to (5))\nset [yv v] to (pick random (-5) to (5))\nrepeat until <<touching (ground v)?> or <touching (_edge_ v)?>>\n    turn right (Rotation) degrees\n    go to x: ((x position) + (Xv)) y: ((y position) + (Yv))\n    change [yv v] by (-1)\nend\ngo to [front v] layer\nrepeat (10)\n    change [ghost v] effect by (5)\nend\ndelete this clone\n\nwhen flag clicked\nforever\n    set [mouse v] to (join (mouse x) (join [,] (mouse y)))\n    Refresh\nend\n\ndefine Refresh\nerase all\nif <(LEVEL) = [5]> then\n    Make torch [21] [-63]\n    Make torch [-226] [62]\nend\nif <(LEVEL) = [6]> then\n    Make torch [-126] [-111]\n    Make torch [165] [-73]\nend\nif <(LEVEL) = [10]> then\n    Make torch [29] [11]\nend\nif <(LEVEL) = [11]> then\n    Make torch [-138] [12]\nend\n\nwhen [space v] key pressed\nsay (join (mouse x) (join [,] (mouse y))) for (2) seconds\n\n@Decor\n\nwhen flag clicked\ngo to [back v] layer\nforever\n    switch costume to (LEVEL)\nend\n\n@Moving Platforms\n\nwhen flag clicked\nforever\n    if <(LEVEL) = [6]> then\n        show\n    else\n        hide\n    end\nend\n\nwhen flag clicked\nforever\n    if <(LEVEL) = [6]> then\n        set y to (-110)\n        repeat until <(x position) > [110]>\n            change x by (3)\n            set [direction #2 v] to [right]\n        end\n        repeat until <[-110] > (x position)>\n            change x by (-3)\n            set [direction #2 v] to [left]\n        end\n    end\nend\n\n@Moving Spikes\n\nwhen flag clicked\nforever\n    repeat until <(y position) < [0]>\n        change y by (-3)\n    end\n    repeat until <[70] < (y position)>\n        change y by (3)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(LEVEL) = [8]> then\n        show\n    else\n        hide\n    end\nend\n\n@Thumbnail\n\nwhen flag clicked\nhide\n\nshow\ngo to [front v] layer\nset [ghost v] effect to (0)\ngo to x: (0) y: (0)\n\n