Crafts a platformer
@Stage\n\n@player\n\ndefine Controls - Left and Right\nset [speed x v] to ((speed x) * (0.7))\nif <<<key (a v) pressed?> or <key (left arrow v) pressed?>> or <<mouse down?> and <(x position) > (mouse x)>>> then\n    change [speed x v] by (-1.5)\nend\nif <<<key (d v) pressed?> or <key (right arrow v) pressed?>> or <<mouse down?> and <(mouse x) > (x position)>>> then\n    change [speed x v] by (1.5)\nend\n\ndefine Walk (direction) (speed) max step (step)\npoint in direction (direction)\nchange x by (speed)\nchange [frame v] by (([abs v] of (speed) ) / (8))\nset [slope v] to [0]\nGet Touching <(in platforrm) = [1]>\nrepeat until <<(slope) = (step)> or <(touch) = [0]>>\n    change y by (1)\n    change [slope v] by (1)\n    Get Touching <(in platforrm) = [1]>\nend\nif <(slope) = (step)> then\n    change x by ((0) - (speed))\n    change y by ((0) - (slope))\n    if <<(touch) = [1]> and <(in platforrm) = [1]>> then\n        set [in platforrm v] to [2]\n        Walk (direction) (speed) max step (step)\n        if <(speed x) = [0]> then\n            set [in platforrm v] to [1]\n        end\n    else\n        if <<<<<key (w v) pressed?> or <key (up arrow v) pressed?>> or <<mouse down?> and <(mouse y) > (y position)>>> and <([abs v] of (speed) ) > [3.5]>> and <(touch) > [1]>> then\n            set [speed x v] to ((-1.2) * (speed))\n            set [speed y v] to [11]\n            set [falling? v] to [6]\n            set [wall jump v] to [15]\n        else\n            set [speed x v] to [0]\n        end\n    end\nend\n\ndefine Controls - Jump, Crouch\nif <<key (w v) pressed?> or <<<mouse down?> and <(mouse y) > (y position)>> or <key (up arrow v) pressed?>>> then\n    if <<(jump key) = [0]> and <(falling?) < [3]>> then\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 <key (s v) pressed?> then\n    set [in platforrm v] to [2]\nend\n\ndefine Gravity\nif <<(speed y) < [4]> or <<<key (w v) pressed?> or <key (up arrow v) pressed?>> or <<mouse down?> and <(mouse y) > (y position)>>>> then\n    if <<key (u v) pressed?> and <(username) = [dn_scrtch]>> then\n        change [speed y v] by (1)\n    else\n        change [speed y v] by (-1)\n    end\nelse\n    change [speed y v] by (-2)\nend\nchange y by (speed y)\nchange [falling? v] by (1)\n\ndefine Get Touching <check platform?>\nif <touching (scrolling platforms v)?> then\n    set [touch v] to [9]\n    change [vx v] by ([x v] of [scrolling platforms v])\nelse\n    if <touching (ground v)?> then\n        set [touch v] to [9]\n    else\n        if <<check platform?> and <touching (platforms v)?>> then\n            set [touch v] to [1]\n        else\n            set [touch v] to [0]\n        end\n    end\nend\n\ndefine Reset Level\ngo to [front v] layer\nset size to (25) %\nset rotation style [left-right v]\ngo to x: (0) y: (0)\nreset timer\nshow\nset [scrollx v] to [950]\nset [scrolly v] to [0]\nset [speed x v] to [0]\nset [speed y v] to [0]\nset [falling? v] to [10]\nset [in platforrm v] to [1]\nset [frame v] to [0]\nset [wall jump v] to [0]\n\ndefine Check Hit Ceiling / Floor <up?>\nGet Touching \nif <(touch) = [0]> then\n    set [in platforrm v] to [1]\nelse\n    if <<up?> and <(touch) = [1]>> then\n        set [in platforrm v] to [2]\n    end\nend\nrepeat until <(touch) < (in platforrm)>\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    Get Touching <not <up?>>\n    set [speed y v] to [0]\nend\n\nwhen flag clicked\nset [level v] to [1]\nReset Level\nforever\n    go to [front v] layer\n    go [backward v] (3) layers\n    if <touching (trampoline v)?> then\n        set [speed y v] to [30]\n    end\n    if <<<touching color (#ff2b00)?> or <touching (saw v)?>> or <touching (spikes v)?>> then\n        Reset Level\n        if <(counter...) = [0]> then\n            broadcast (reset v)\n        end\n    end\n    if <<touching (finish v)?> and <(coins collected) = [3]>> then\n        change [level v] by (1)\n        Reset Level\n        set [coins collected v] to [0]\n    end\n    switch costume to (hitbox v)\n    Controls - Jump, Crouch\n    Gravity\n    Check Hit Ceiling / Floor <(speed y) > [0]>\n    switch costume to (costume1 v)\n    if <(wall jump) > [0]> then\n        change [wall jump v] by (-1)\n    else\n        Controls - Left and Right\n    end\n    if <(speed x) < [-0.5]> then\n        Walk (-90) (speed x) max step (([ceiling v] of ([abs v] of ((speed x) * (1.3)) ) ) + (1))\n    else\n        if <(speed x) > [0.5]> then\n            Walk (90) (speed x) max step (([ceiling v] of ([abs v] of ((speed x) * (1.3)) ) ) + (1))\n        else\n            set [frame v] to [0]\n        end\n    end\n    change [scrollx v] by (() - (round ((x position) / (10))))\n    change x by ((0) - (round ((x position) / (10))))\n    change [scrolly v] by (() - (round ((y position) / (10))))\n    change y by ((0) - (round ((y position) / (10))))\n    broadcast (tick v) and wait\nend\n\n@Ground\n\ndefine Hack Zoom to (percent)\nif <(percent) > [100]> then\n    set [#costume v] to (costume [number v])\n    switch costume to (dot v)\n    set size to (percent) %\n    switch costume to (#costume)\nelse\n    set size to (percent) %\nend\n\nwhen flag clicked\nset [level v] to [1]\nswitch costume to (costume1 v)\nshow\ngo [backward v] (100) layers\nHack Zoom to (500)\ngo to x: (0) y: (0)\nforever\n    go to [front v] layer\n    go [backward v] (6) layers\n    go to x: (ScrollX) y: (ScrollY)\n    switch costume to (level)\nend\n\n@lava\n\ndefine Hack Zoom to (percent)\nif <(percent) > [100]> then\n    set [#costume v] to (costume [number v])\n    switch costume to (dot v)\n    set size to (percent) %\n    switch costume to (#costume)\nelse\n    set size to (percent) %\nend\n\nwhen flag clicked\nswitch costume to (costume1 v)\nshow\ngo [backward v] (100) layers\nHack Zoom to (500)\ngo to x: (0) y: (0)\nforever\n    go to x: (ScrollX) y: ((ScrollY) + (([sin v] of ((timer) * (100)) ) * (10)))\n    go to [back v] layer\n    if <(level) = [1]> then\n        show\n    else\n        hide\n    end\nend\n\n@Sprite1\n\nwhen flag clicked\nhide\n\nwhen flag clicked\nset [id v] to [1]\ncreate clone of (_myself_ v)\nwait (0.1) seconds\nset [id v] to [2]\ncreate clone of (_myself_ v)\nwait (0.1) seconds\nset [id v] to [5]\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\ngo to [front v] layer\ngo [backward v] (2) layers\nset size to (108) %\nshow\nswitch costume to (costume3 v)\nif <(id) = [1]> then\n    forever\n        set [current_dir v] to (direction)\n        point in direction ((90) + (([speed x v] of [player v]) * ((([speed x v] of [player v]) * (-2)) * ([sin v] of ((timer) * (500)) ))))\n        if <not <([falling? v] of [player v]) = [0]>> then\n            point in direction ((45) - (([speed y v] of [player v]) * (-2)))\n        end\n        go to (player v)\n    end\nend\nif <(id) = [2]> then\n    forever\n        set [current_dir v] to (direction)\n        point in direction ((90) + (([speed x v] of [player v]) * ((([speed x v] of [player v]) * (2)) * ([sin v] of ((timer) * (500)) ))))\n        if <not <([falling? v] of [player v]) = [0]>> then\n            point in direction ((135) - (([speed y v] of [player v]) * (2)))\n        end\n        go to (player v)\n    end\nend\nif <(id) = [3]> then\n    forever\n        set [current_dir v] to (direction)\n        go to (player v)\n        change y by (25)\n        if <<<(m) = [jump]> or <(m) = [fall]>> or <(m) = [walljump]>> then\n            point in direction ((45) + ((vy) * (2)))\n            go to (player v)\n            change y by (25)\n        end\n        if <(m) = [stand]> then\n            point in direction ((65) + ((5) * ([sin v] of ((timer) * (100)) )))\n            go to (player v)\n            change y by (25)\n        end\n        if <<(m) = [run]> or <(m) = [slide]>> then\n            point in direction ((90) + ((vx) * (((vx) * (-2)) * ([sin v] of ((timer) * (500)) ))))\n            go to (player v)\n            change y by (25)\n        end\n    end\nend\nif <(id) = [4]> then\n    forever\n        set [current_dir v] to (direction)\n        go to (player v)\n        change y by (25)\n        if <<<(m) = [jump]> or <(m) = [fall]>> or <(m) = [walljump]>> then\n            point in direction ((135) - ((vy) * (2)))\n            go to (player v)\n            change y by (25)\n        end\n        if <(m) = [stand]> then\n            point in direction ((115) + ((-5) * ([sin v] of ((timer) * (100)) )))\n            go to (player v)\n            change y by (25)\n        end\n        if <<(m) = [run]> or <(m) = [slide]>> then\n            point in direction ((90) + ((vx) * (((vx) * (2)) * ([sin v] of ((timer) * (500)) ))))\n            go to (player v)\n            change y by (25)\n        end\n    end\nend\nif <(id) = [5]> then\n    set size to (108) %\n    switch costume to (costume2 v)\n    forever\n        go to [front v] layer\n        go to x: ((([x position v] of [player v]) + ()) + (([speed x v] of [player v]) * (0.7))) y: ((([y position v] of [player v]) + (1)) + (([speed y v] of [player v]) * (0.5)))\n    end\nend\n\nset [level v] to [2]\n\n@Sprite2\n\nwhen flag clicked\nforever\n    go to [front v] layer\n    go to x: (0) y: (0)\nend\n\ngo [backward v] (6) layers\n\n@Sprite3\n\nwhen flag clicked\nset [coins collected v] to [0]\ngo to [front v] layer\nhide\nset [clone_id v] to [0]\nrepeat (3)\n    change [clone_id v] by (1)\n    create clone of (_myself_ v)\n    wait (0.1) seconds\nend\n\nwhen I start as a clone\ngo to [front v] layer\nshow\nif <(clone_id) = [1]> then\n    go to x: (130) y: (160)\n    forever\n        go to [front v] layer\n        if <(coins collected) > [0]> then\n            switch costume to (costume2 v)\n        else\n            switch costume to (costume1 v)\n        end\n    end\nend\nif <(clone_id) = [2]> then\n    go to x: (170) y: (160)\n    forever\n        go to [front v] layer\n        if <(coins collected) > [1]> then\n            switch costume to (costume2 v)\n        else\n            switch costume to (costume1 v)\n        end\n    end\nend\nif <(clone_id) = [3]> then\n    go to x: (210) y: (160)\n    forever\n        go to [front v] layer\n        if <(coins collected) > [2]> then\n            switch costume to (costume2 v)\n        else\n            switch costume to (costume1 v)\n        end\n    end\nend\n\n@Sprite4\n\nwhen flag clicked\nset [coins collected v] to [0]\ngo to [back v] layer\nhide\nset [clones v] to [0]\nrepeat (6)\n    change [clones v] by (1)\n    create clone of (_myself_ v)\n    wait (0.1) seconds\nend\nforever\n    hide\nend\n\nwhen I start as a clone\nshow\nif <(CLONES) = [1]> then\n    set [x v] to [219]\n    set [y v] to [90]\n    forever\n        if <(level) = [2]> then\n            hide\n        end\n        go to [back v] layer\n        go [forward v] (1) layers\n        go to x: ((ScrollX) - (x)) y: (((ScrollY) - (y)) + (([sin v] of ((timer) * (100)) ) * (3)))\n        if <touching (player v)?> then\n            hide\n            change [coins collected v] by (1)\n        end\n    end\nend\nif <(CLONES) = [2]> then\n    set [x v] to [426]\n    set [y v] to [-500]\n    forever\n        if <(level) = [2]> then\n            hide\n        end\n        go to [back v] layer\n        go [forward v] (1) layers\n        go to x: ((ScrollX) - (x)) y: (((ScrollY) - (y)) + (([sin v] of ((timer) * (100)) ) * (3)))\n        if <touching (player v)?> then\n            hide\n            change [coins collected v] by (1)\n        end\n    end\nend\nif <(CLONES) = [3]> then\n    set [x v] to [-143]\n    set [y v] to [-163]\n    forever\n        if <(level) = [2]> then\n            hide\n        end\n        go to [back v] layer\n        go [forward v] (1) layers\n        go to x: ((ScrollX) - (x)) y: (((ScrollY) - (y)) + (([sin v] of ((timer) * (100)) ) * (3)))\n        if <touching (player v)?> then\n            hide\n            change [coins collected v] by (1)\n        end\n    end\nend\nif <(CLONES) = [4]> then\n    repeat until <(level) = [2]>\n        hide\n    end\n    show\n    forever\n        set [x v] to [-250]\n        set [y v] to [1065]\n        go to [front v] layer\n        go [backward v] (7) layers\n        go to x: ((ScrollX) - (x)) y: (((ScrollY) - (y)) + (([sin v] of ((timer) * (100)) ) * (3)))\n        if <touching (player v)?> then\n            hide\n            change [coins collected v] by (1)\n        end\n    end\nend\nif <(CLONES) = [5]> then\n    repeat until <(level) = [2]>\n        hide\n    end\n    show\n    forever\n        set [x v] to [-1000]\n        set [y v] to [95]\n        go to [front v] layer\n        go [backward v] (5) layers\n        go to x: ((ScrollX) - (x)) y: (((ScrollY) - (y)) + (([sin v] of ((timer) * (100)) ) * (3)))\n        if <touching (player v)?> then\n            hide\n            change [coins collected v] by (1)\n        end\n    end\nend\nif <(CLONES) = [6]> then\n    repeat until <(level) = [2]>\n        hide\n    end\n    show\n    forever\n        set [x v] to [-168]\n        set [y v] to [-150]\n        go to [front v] layer\n        go [backward v] (5) layers\n        go to x: ((ScrollX) - (x)) y: (((ScrollY) - (y)) + (([sin v] of ((timer) * (100)) ) * (3)))\n        if <touching (player v)?> then\n            hide\n            change [coins collected v] by (1)\n        end\n    end\nend\n\nwhen I receive [reset v]\nset [coins collected v] to [0]\nshow\n\n@scrolling platforms\n\nwhen flag clicked\nset [clone_id3 v] to [0]\nrepeat (2)\n    change [clone_id3 v] by (1)\n    create clone of (_myself_ v)\n    wait (0.1) seconds\nend\n\nwhen I start as a clone\nif <(clone_ID3) = [1]> then\n    set [x v] to [750]\n    set [y v] to [-620]\n    forever\n        repeat until <(x) > [1200]>\n            go to x: ((ScrollX) - (x)) y: ((ScrollY) - (y))\n            change [x v] by (2.5)\n        end\n        repeat until <[750] > (x)>\n            go to x: ((ScrollX) - (x)) y: ((ScrollY) - (y))\n            change [x v] by (-2.5)\n        end\n    end\nend\nif <(clone_ID3) = [2]> then\n    set [x v] to [215]\n    set [y v] to [-630]\n    forever\n        repeat until <(x) > [500]>\n            go to x: ((ScrollX) - (x)) y: ((ScrollY) - (y))\n            change [x v] by (2.5)\n        end\n        repeat until <[215] > (x)>\n            go to x: ((ScrollX) - (x)) y: ((ScrollY) - (y))\n            change [x v] by (-2.5)\n        end\n    end\nend\n\n@trampoline\n\ndefine Hack Zoom to (percent)\nif <(percent) > [100]> then\n    set [#costume v] to (costume [number v])\n    switch costume to (dot v)\n    set size to (percent) %\n    switch costume to (#costume)\nelse\n    set size to (percent) %\nend\n\nwhen flag clicked\nset [y--- v] to [0]\nset [level v] to [1]\nswitch costume to (costume1 v)\nshow\ngo [backward v] (100) layers\nHack Zoom to (500)\ngo to x: (0) y: (0)\nforever\n    go to x: (ScrollX) y: ((ScrollY) - (y---))\n    switch costume to (level)\n    if <touching (player v)?> then\n        set [y--- v] to [25]\n    end\n    set [y--- v] to ((y---) * (0.88))\n    if <(level) = [2]> then\n        hide\n    end\nend\n\n@controls\n\ndefine Hack Zoom to (percent)\nif <(percent) > [100]> then\n    go to [back v] layer\n    set [#costume v] to (costume [number v])\n    switch costume to (dot v)\n    set size to (percent) %\n    switch costume to (#costume)\nelse\n    set size to (percent) %\nend\n\nwhen flag clicked\nset [level v] to [1]\nswitch costume to (costume1 v)\nshow\ngo [backward v] (100) layers\nHack Zoom to (500)\ngo to x: (0) y: (0)\nforever\n    go to x: (ScrollX) y: (ScrollY)\n    switch costume to (level)\nend\n\n@plants\n\ndefine Hack Zoom to (percent)\nif <(percent) > [100]> then\n    set [#costume v] to (costume [number v])\n    switch costume to (dot v)\n    set size to (percent) %\n    switch costume to (#costume)\nelse\n    set size to (percent) %\nend\n\nwhen flag clicked\nset [level v] to [1]\nswitch costume to (costume1 v)\nshow\ngo [backward v] (100) layers\nHack Zoom to (500)\ngo to x: (0) y: (0)\nforever\n    go to x: (ScrollX) y: (ScrollY)\n    switch costume to (level)\n    go to [back v] layer\nend\n\n@finish\n\nwhen flag clicked\nset [clone_id4 v] to [0]\nhide\nset [x v] to [1400]\nset [y v] to [-751]\nchange [clone_id4 v] by (1)\ncreate clone of (_myself_ v)\nwait (0.1) seconds\nchange [clone_id4 v] by (1)\ncreate clone of (_myself_ v)\nwait (0.1) seconds\nchange [clone_id4 v] by (1)\ncreate clone of (_myself_ v)\nwait until <(level) = [2]>\nset [x v] to [347]\nset [y v] to [717]\n\nwhen I start as a clone\nshow\nif <(clone_id4) = [1]> then\n    forever\n        go to x: ((ScrollX) - (X)) y: ((ScrollY) - (Y))\n        point in direction ((timer) * (80))\n        go to [back v] layer\n        go [forward v] (10) layers\n        switch costume to (costume1 v)\n        if <(coins collected) = [3]> then\n            set [ghost v] effect to (0)\n        else\n            set [ghost v] effect to (70)\n        end\n    end\nend\nif <(clone_id4) = [2]> then\n    forever\n        go to [back v] layer\n        go [forward v] (10) layers\n        go to x: ((ScrollX) - (X)) y: ((ScrollY) - (Y))\n        point in direction ((timer) * (-80))\n        switch costume to (costume1 v)\n        if <(coins collected) = [3]> then\n            set [ghost v] effect to (0)\n        else\n            set [ghost v] effect to (70)\n        end\n    end\nend\nif <(clone_id4) = [3]> then\n    forever\n        set size to (200) %\n        go to [front v] layer\n        go [backward v] (100) layers\n        go to x: ((ScrollX) - (X)) y: ((ScrollY) - (Y))\n        point in direction (90)\n        switch costume to (costume2 v)\n        if <(coins collected) = [3]> then\n            hide\n        else\n            show\n        end\n    end\nend\n\nif <(level) = [2]> then\n    set size to (200) %\n    go to [front v] layer\n    go [backward v] (100) layers\n    go to x: ((ScrollX) - (X)) y: ((ScrollY) - (Y))\n    point in direction (90)\n    switch costume to (costume2 v)\n    if <(coins collected) = [3]> then\n        hide\n    else\n        show\n    end\nend\n\n@saw\n\ndefine Hack Zoom to (percent)\nif <(percent) > [100]> then\n    set [#costume v] to (costume [number v])\n    switch costume to (dot v)\n    set size to (percent) %\n    switch costume to (#costume)\nelse\n    set size to (percent) %\nend\n\nwhen flag clicked\nset [level v] to [1]\nswitch costume to (costume1 v)\nshow\ngo [backward v] (100) layers\nHack Zoom to (500)\ngo to x: (0) y: (0)\nset [x v] to [792]\nset [y v] to [70]\nforever\n    go to [back v] layer\n    go [forward v] (15) layers\n    go to x: ((ScrollX) - (x)) y: ((ScrollY) - (y))\n    turn right (20) degrees\n    if <(level) = [1]> then\n        set [x v] to [792]\n        set [y v] to [70]\n    end\n    if <(level) = [2]> then\n        set [x v] to [-296]\n        set [y v] to [1120]\n    end\nend\n\n@Sprite5\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\n\nwhen I receive [reset v]\nset [counter... v] to [1]\ngo to x: (0) y: (180)\ngo to x: (0) y: (372)\nshow\nrepeat until <([abs v] of (y position) ) < [2]>\n    change y by (((0) - (y position)) / (4))\n    go to [front v] layer\n    go [forward v] (100000000) layers\nend\nset x to (0)\ngo to x: (0) y: (0)\nwait (0.4) seconds\nshow\nrepeat until <[371] < ([abs v] of (y position) )>\n    change y by (((372) - (y position)) / (8))\n    go to [front v] layer\n    go [forward v] (100000000) layers\nend\nhide\nset [counter... v] to [0]\n\n@spikes\n\ndefine Hack Zoom to (percent)\nif <(percent) > [100]> then\n    set [#costume v] to (costume [number v])\n    switch costume to (dot v)\n    set size to (percent) %\n    switch costume to (#costume)\nelse\n    set size to (percent) %\nend\n\nwhen flag clicked\nset [level v] to [1]\nswitch costume to (costume1 v)\nshow\ngo [backward v] (100) layers\nHack Zoom to (500)\ngo to x: (0) y: (0)\nforever\n    go to [front v] layer\n    go [backward v] (6) layers\n    go to x: (ScrollX) y: (ScrollY)\n    switch costume to (level)\nend\n\n@Sprite6\n\nwhen flag clicked\nset [level v] to [1]\nhide\nwait until <(level) = [3]>\nforever\n    show\n    go to x: (0) y: (0)\n    go to [front v] layer\n    go [forward v] (1000000000) layers\nend\n\n@Sprite7\n\nwhen flag clicked\nforever\n    go to [back v] layer\n    go [backward v] (1) layers\n    go to x: ((ScrollX) / (7)) y: (((ScrollY) / (7)) - (150))\nend\n\n
This is my first platform game so it's not gonna be perfect. It's crazy how my project is still getting more views to this day! I feel so proud of myself LOL!  **Also please check the notes for credits.**\n---------------------------------------------------------------------------------\n**UPDATES**\nI add new levels every now and then because this is an old game so i'm not really gonna be active with this.\n---------------------------------------------------------------------------------\n**CONTROLS**\nUse WASD keys or arrow keys to move.\n---------------------------------------------------------------------------------\n**GOAL**\nHave fun completing the levels! Compete with friends and family. :D\n---------------------------------------------------------------------------------\n**FEATURES**\nClick the budgie to change the color.\nCurrently there are 8 budgie colors in the game. \n**THESE ARE ONLY AVAILABLE IN THE OLD VERSION**\n---------------------------------------------------------------------------------\n**NOTES**\n- currently there's 9 levels in the game.\n- credits to @UnEtheral for the new art style and code. If you want to see my art style before this was added go to my profile and look for Budgies! A Platformer game (old version).\n---------------------------------------------------------------------------------