Notebook - Platformer #games

Instructions: CONTROLS:\nArrow Keys/WASD/Mobile Controls to move around.\nAvoid spikes, liquid fire and turrets.\nBounce on trampolines to get to high places.\nGet to the flag to advance.\nGo into the red and green portals to become a different size.\nEnjoy! 

@Stage\n\nwhen flag clicked\nswitch backdrop to (page v)\nwait until <(Level) = [15]>\nswitch backdrop to (page2 v)\n\nwhen I receive [intro done v]\nswitch backdrop to (page v)\nwait until <(Level) = [15]>\nswitch backdrop to (page2 v)\n\n@Player\n\nwhen flag clicked\nset volume to (50) %\nset [level v] to [1]\nhide\n\ndefine Platformer Physics (speed) (friction) (jump height)\nchange [y velocity v] by (-1)\nif <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <(mouse x) > (x position)>>> then\n    change [x velocity v] by (speed)\nend\nif <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <(mouse x) < (x position)>>> then\n    change [x velocity v] by ((0) - (speed))\nend\nset [x velocity v] to ((X Velocity) * (friction))\nchange x by (X Velocity)\nset [slope v] to [0]\nif <touching (level v)?> then\n    repeat until <<not <touching (level v)?>> or <(Slope) = [-8]>>\n        change [slope v] by (-1)\n        change y by (1)\n    end\nend\nif <touching (level v)?> then\n    change y by (Slope)\n    repeat until <not <touching (level v)?>>\n        change x by ((0) - (([abs v] of (X Velocity) ) / (X Velocity)))\n    end\n    set [x velocity v] to [0]\nend\nchange y by (Y Velocity)\nif <touching (level v)?> then\n    repeat until <not <touching (level v)?>>\n        change y by ((([abs v] of (Y Velocity) ) / (Y Velocity)) * (-1))\n    end\n    set [y velocity v] to [0]\nend\nchange y by (-1)\nif <<<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > (y position)>>> and <touching (level v)?>> then\n    set [y velocity v] to (jump height)\nend\nchange y by (1)\n\ndefine Detection\nif <touching (flag v)?> then\n    start sound [Ding Sound Effect v]\n    set [level v] to ((Level) + (1))\n    set [x velocity v] to [0]\n    set [y velocity v] to [0]\n    go to x: (-205) y: (-82)\nend\nif <<<<touching (danger v)?> or <touching (bullet v)?>> or <(y position) = [-179]>> and <not <(CHEAT) = [1]>>> then\n    start sound [Oops v]\n    repeat (3)\n        hide\n        wait (0.11) seconds\n        show\n        wait (0.11) seconds\n    end\n    hide\n    wait (0.11) seconds\n    show\n    go to x: (-205) y: (-82)\n    set [x velocity v] to [0]\n    set [y velocity v] to [0]\nend\nif <touching (bouncy v)?> then\n    start sound [Big Boing v]\n    set [y velocity v] to [18]\nend\nif <touching color (#ff3b3b)?> then\n    set size to (70) %\nend\nif <touching color (#68ff7a)?> then\n    set size to (100) %\nend\n\nwhen I receive [intro done v]\nset size to (100) %\nset [cheat v] to [0]\nwait (0.1) seconds\nshow\ngo [forward v] (88) layers\ngo to x: (-205) y: (-82)\nset [level v] to [1]\nset [x velocity v] to [0]\nset [y velocity v] to [0]\nforever\n    if <touching (activate v)?> then\n        Platformer Physics [0.95] [0.9] [16]\n        Detection\n    else\n        if <(size) = [70]> then\n            Platformer Physics [0.95] [0.88] [9.99]\n            Detection\n        else\n            if <(size) = [100]> then\n                Platformer Physics [0.95] [0.9] [11.5]\n                Detection\n            end\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    Cheats Menu\nend\n\ndefine Cheats Menu\nif <<<key (1 v) pressed?> and <<(username) = [250119code2]> or <(username) = [250119test2]>>> and <not <(CHEAT) = [1]>>> then\n    set [cheat v] to [1]\n    wait (1) seconds\nelse\n    if <<key (1 v) pressed?> and <(CHEAT) = [1]>> then\n        set [cheat v] to [0]\n        wait (1) seconds\n    end\nend\nif <<key (up arrow v) pressed?> and <(CHEAT) = [1]>> then\n    set [y velocity v] to [7]\nend\nif <<key (down arrow v) pressed?> and <(CHEAT) = [1]>> then\n    set [y velocity v] to [-6]\nend\n\n@Level\n\nwhen flag clicked\nforever\n    switch costume to (Level)\nend\n\n@Danger\n\nwhen flag clicked\nforever\n    switch costume to (Level)\n    go to [back v] layer\nend\n\n@Text\n\nwhen flag clicked\nclear graphic effects\nforever\n    switch costume to (Level)\n    if <touching (player v)?> then\n        set [ghost v] effect to (30)\n    else\n        set [ghost v] effect to (0)\n    end\nend\n\n@Bouncy\n\nwhen flag clicked\nforever\n    switch costume to (Level)\nend\n\n@Flag\n\nwhen flag clicked\nforever\n    switch costume to (Level)\nend\n\n@Turret\n\nwhen flag clicked\nhide\nforever\n    point towards (player v)\nend\n\nwhen I receive [intro done v]\nhide\nwait until <(Level) = [4]>\ngo to x: (-198) y: (137)\nshow\nrepeat until <not <(Level) = [4]>>\n    create clone of (bullet v)\n    wait (0.8) seconds\nend\nhide\nwait until <(Level) = [6]>\ngo to x: (-198) y: (137)\nshow\nrepeat until <not <(Level) = [6]>>\n    create clone of (bullet v)\n    wait (2) seconds\nend\nhide\nwait until <(Level) = [9]>\ngo to x: (-198) y: (137)\nshow\nrepeat until <not <(Level) = [9]>>\n    create clone of (bullet v)\n    wait (0.7) seconds\nend\nhide\nwait until <(Level) = [12]>\ngo to x: (-198) y: (137)\nshow\nrepeat until <not <(Level) = [12]>>\n    create clone of (bullet v)\n    wait (0.8) seconds\nend\nhide\n\nwhen flag clicked\nhide\n\nwhen I receive [intro done v]\nwait until <(Level) = [5]>\nhide\n\nwhen I receive [intro done v]\nwait until <(Level) = [7]>\nhide\n\n@Bullet\n\nwhen flag clicked\nhide\n\nwhen I start as a clone\nshow\ngo to [back v] layer\ngo to (turret v)\npoint in direction ([direction v] of [turret v])\nrepeat until <<<touching (player v)?> or <touching (level v)?>> or <touching (_edge_ v)?>>\n    move (4.5) steps\nend\ndelete this clone\n\n@Activate\n\nwhen flag clicked\nforever\n    switch costume to (Level)\nend\n\n@text\n\nwhen flag clicked\nhide\ngo to [front v] layer\nwait (2.4) seconds\ngo to x: (0) y: (-60)\nset size to (100) %\nset [ghost v] effect to (100)\nshow\nset [rotation v] to [-10]\nrepeat (70)\n    change [ghost v] effect by (rotation)\n    change [rotation v] by (-1)\n    wait (0.01) seconds\nend\nset [ghost v] effect to (0)\n\nwhen I receive [message1 v]\nhide\n\nwhen I receive [intro done v]\nhide\n\n@Intro\n\nwhen flag clicked\nset [id v] to [1]\ncreate clone of (_myself_ v)\nset [id v] to [2]\ncreate clone of (_myself_ v)\nset [id v] to [3]\ncreate clone of (_myself_ v)\nset [id v] to [4]\ncreate clone of (_myself_ v)\nstart sound [Never Mind v]\nswitch costume to (1 v)\nshow\ngo to x: (0) y: (0)\npoint in direction (-90)\nset size to (300) %\nset [sine v] to [30]\nrepeat (40)\n    change size by (((100) - (size)) * (1))\n    turn right (((90) - (direction)) * (0.18)) degrees\nend\nset [glide v] to [7]\nrepeat (20)\n    change y by ((glide) - (1))\n    change [glide v] by (-0.34)\nend\nwait (5.8) seconds\nhide\n\nwhen I start as a clone\nif <(id) = [1]> then\n    clear graphic effects\n    show\n    go to x: (0) y: (0)\n    point in direction (90)\n    set size to (100) %\n    switch costume to (bg v)\nelse\n    if <(id) = [2]> then\n        id 2\n    else\n        if <(id) = [3]> then\n            id 3\n        else\n            id 4\n        end\n    end\nend\n\ndefine id 2\ngo to x: (0) y: (0)\nswitch costume to (dot2 v)\nhide\nclear graphic effects\ngo to [front v] layer\nwait (7) seconds\nshow\nset size to (0.5) %\nset [vel v] to [1]\nswitch costume to (dot v)\nrepeat (50)\n    switch costume to (dot2 v)\n    change [vel v] by ((size) / (50))\n    change size by (vel)\n    switch costume to (dot v)\nend\nbroadcast (Intro Done v)\n\nwhen I receive [intro done v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\n\ndefine id 3\ngo to x: (0) y: (0)\nswitch costume to (dot2 v)\nhide\nclear graphic effects\ngo to [front v] layer\nwait (7.2) seconds\nshow\nset size to (0.5) %\nset [vel v] to [1]\nswitch costume to (dot v)\nrepeat (50)\n    switch costume to (dot2 v)\n    change [vel v] by ((size) / (50))\n    change size by (vel)\n    switch costume to (smaller dot v)\nend\n\ndefine id 4\ngo to x: (0) y: (0)\nswitch costume to (dot2 v)\nhide\nclear graphic effects\ngo to [front v] layer\nwait (7.4) seconds\nshow\nset size to (0.5) %\nset [vel v] to [1]\nswitch costume to (dot v)\nrepeat (50)\n    switch costume to (dot2 v)\n    change [vel v] by ((size) / (50))\n    change size by (vel)\n    switch costume to (crazy dot v)\n    turn left (1) degrees\nend\n\n@Portal\n\nwhen flag clicked\ngo to [back v] layer\nhide\nwait until <(Level) = [8]>\nshow\ngo to x: (-115) y: (-111)\nswitch costume to (costume1 v)\nwait until <(Level) = [9]>\nhide\nwait until <(Level) = [10]>\nshow\ngo to x: (-75) y: (-60)\nswitch costume to (costume2 v)\nwait until <(Level) = [11]>\nshow\ngo to x: (-213) y: (-86)\nswitch costume to (costume1 v)\nwait until <(Level) = [12]>\nhide\nwait until <(Level) = [14]>\nshow\ngo to x: (-215) y: (-106)\nswitch costume to (costume2 v)\nwait until <(Level) = [15]>\nhide\n\nwhen flag clicked\nhide\n\nwhen flag clicked\nforever\n    go to [back v] layer\nend\n\n@Music\n\nwhen flag clicked\nhide\nwait (8) seconds\nswitch costume to (costume1 v)\ngo to x: (-206) y: (-150)\nset volume to (50) %\nplay sound [no chance of me telling song name v] until done\nset size to (80) %\n\nwhen flag clicked\nforever\n    if <touching (mouse-pointer v)?> then\n        set [brightness v] effect to (10)\n    else\n        set [brightness v] effect to (0)\n    end\nend\n\nwhen [m v] key pressed\nif <(volume) = [50]> then\n    set volume to (0) %\n    switch costume to (costume2 v)\nelse\n    switch costume to (costume1 v)\n    set volume to (50) %\nend\n\n@TN\n\nwhen flag clicked\nshow\ngo to x: (0) y: (0)\nset [ghost v] effect to (100)\nforever\n    go to [front v] layer\nend\n\n