Notebook Platformer

Instructions: 1. Click the green flag.\n2. WASD or Cursor key to move.\n3. Avoid the spikes.\n4. In some of the levels, you can draw a line to let the stick man get past.\n5.click c to erase your lines\n6. Have fun!\n7. Love❤ or Favourite⭐ or follow❤ or I will steal your candy!\n8. Enjoy!

@Stage\n\nwhen flag clicked\nswitch backdrop to (level backdrop v)\n\nwhen flag clicked\nforever\n    if <(Level) = [11]> then\n        switch backdrop to (level backdrop v)\n    end\nend\n\n@Player\n\ndefine None\nswitch costume to (hitbox v)\nif <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n    point in direction (90)\n    change [x velocity v] by (running speed)\nend\nif <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n    point in direction (-90)\n    change [x velocity v] by ((running speed) * (-1))\nend\nset [x velocity v] to ((X Velocity) * (friction))\nchange x by (X Velocity)\nif <<<touching (level v)?> or <touching color (#0000ff)?>> or <touching color (#000000)?>> then\n    set [slope v] to [0]\n    repeat until <<(Slope) = [8]> or <not <<<touching (level v)?> or <touching color (#0000ff)?>> or <touching color (#000000)?>>>>\n        change [slope v] by (1)\n        change y by (1)\n    end\n    if <<<touching (level v)?> or <touching color (#0000ff)?>> or <touching color (#000000)?>> then\n        change y by ((Slope) * (-1))\n        repeat ([ceiling v] of ([abs v] of (X Velocity) ) )\n            if <<<touching (level v)?> or <touching color (#0000ff)?>> or <touching color (#000000)?>> then\n                change x by ((([abs v] of (X Velocity) ) / (X Velocity)) * (-1))\n            end\n        end\n        set [x velocity v] to [0]\n    end\nend\nchange y by (Y Velocity)\nif <<<touching (level v)?> or <touching color (#0000ff)?>> or <touching color (#000000)?>> then\n    repeat ([ceiling v] of ([abs v] of (Y Velocity) ) )\n        if <<<touching (level v)?> or <touching color (#0000ff)?>> or <touching color (#000000)?>> then\n            change y by ((([abs v] of (Y Velocity) ) / (Y Velocity)) * (-1))\n        end\n    end\n    if <<(([abs v] of (Y Velocity) ) / (Y Velocity)) = [-1]> and <<key (up arrow v) pressed?> or <key (w v) pressed?>>> then\n        set [y velocity v] to (jump height)\n    else\n        set [y velocity v] to [0]\n    end\nelse\n    change [y velocity v] by (-1)\nend\nswitch costume to (idle v)\nif <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<key (right arrow v) pressed?> or <key (d v) pressed?>>> then\n    switch costume to (Walk)\nend\nif <(Y Velocity) > [2.5]> then\n    switch costume to (jump v)\nend\nif <(Y Velocity) < [-2.5]> then\n    switch costume to (fall v)\nend\n\nwhen flag clicked\nset [walk v] to [5]\nforever\n    change [walk v] by (1)\n    if <(Walk) > [8]> then\n        set [walk v] to [5]\n    end\n    wait (0.08) seconds\nend\n\nwhen backdrop switches to [level backdrop v]\nshow\n\nwhen flag clicked\nforever\n    if <(x position) > [239]> then\n        change [level v] by (1)\n        go to x: ((x position) * (-1)) y: (-149)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Level) = [3]> then\n        if <touching (spikes level 3 v)?> then\n            go to x: (-205) y: (-149)\n        end\n    end\n    if <(Level) = [4]> then\n        if <touching (spikes level 4 v)?> then\n            go to x: (-205) y: (-149)\n        end\n    end\n    if <(Level) = [5]> then\n        if <touching (spikes level 5 v)?> then\n            go to x: (-205) y: (-149)\n        end\n    end\n    if <(Level) = [6]> then\n        if <touching (spikes level 6 v)?> then\n            go to x: (-205) y: (-149)\n        end\n    end\n    if <(Level) = [7]> then\n        if <touching (spikes level 7 v)?> then\n            go to x: (-205) y: (-149)\n        end\n    end\n    if <(Level) = [8]> then\n        broadcast (Level 8 v)\n    end\n    if <(Level) = [8]> then\n        if <touching (spikes level 8 v)?> then\n            go to x: (-205) y: (-149)\n        end\n    end\n    if <(Level) = [9]> then\n        broadcast (Level 9 v)\n    end\n    if <(Level) = [9]> then\n        if <touching (spikes level 9 v)?> then\n            go to x: (-205) y: (-149)\n        end\n    end\n    if <(Level) = [10]> then\n        switch backdrop to (level backdrop2 v)\n    end\n    if <<<<(Level) = [10]> or <(Level) = [14]>> or <(Level) = [15]>> and <(y position) < [-160]>> then\n        go to x: (-205) y: (-149)\n    end\n    if <(Level) = [11]> then\n        broadcast (Level 11 v)\n    end\n    if <(Level) = [11]> then\n        if <touching (spikes level 11 v)?> then\n            go to x: (-205) y: (-149)\n        end\n    end\n    if <key (r v) pressed?> then\n        go to x: (-205) y: (-149)\n    end\n    if <(Level) = [15]> then\n        broadcast (Level 15 v)\n    end\n    if <(Level) = [16]> then\n        broadcast (Level 16 v)\n    end\n    if <key (n v) pressed?> then\n        if <not <(Level) = [16]>> then\n            change [level v] by (1)\n            wait (1) seconds\n        else\n            change [level v] by (0)\n        end\n    end\nend\n\nwhen flag clicked\nshow\ngo to [front v] layer\nset size to (150) %\ngo to x: (-205) y: (-149)\nset [x velocity v] to [0]\nset [y velocity v] to [0]\nset [scroll y v] to [0]\nset [scroll x v] to [0]\nforever\n    Platform (12) (-1) (0.7) (3)\nend\n\nwhen flag clicked\nforever\n    pen up\nend\n\nwhen flag clicked\nforever\n    if <(Level) = [3]> then\n        if <<(y position) < [-121]> and <<(x position) < [190]> and <(x position) > [67]>>> then\n            broadcast (Level 3 suprise text appear v)\n        end\n    end\n    if <(Level) = [10]> then\n        if <(x position) > [116]> then\n            broadcast (Level 10 Surprise Text v)\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Level) = [13]> then\n        wait (2) seconds\n        ask [2+3: What's the Answer?] and wait\n        if <(answer) = [5]> then\n            broadcast (Show 5 v)\n            say [Good Job! Hope you showed your work...] for (2) seconds\n            stop [this script v]\n        end\n    end\nend\n\nhide\n\nif  then\nelse\nend\nsay [Oh Come On! You Know your Math!] for (2) seconds\nask [2+3: What's the Answer?] and wait\n\nstop [this script v]\n\n@Level\n\nwhen flag clicked\nset [level v] to [1]\ngo to x: (0) y: (0)\nshow\n\nwhen flag clicked\nforever\n    switch costume to (Level)\nend\n\nwhen flag clicked\nforever\n    if <(Level) = [16]> then\n        broadcast (game end v)\n    end\nend\n\n@Spikes Level 3\n\nwhen flag clicked\ngo to x: (4) y: (-159)\nforever\n    if <(Level) = [3]> then\n        show\n    else\n        hide\n    end\nend\n\n@Level 2 surprise text\n\nwhen flag clicked\ngo to x: (133) y: (-52)\nhide\nforever\n    if <(Level) = [4]> then\n        hide\n    end\nend\n\nwhen I receive [level 3 suprise text appear v]\nshow\n\n@Spikes Level 4\n\nwhen flag clicked\ngo to x: (90) y: (-160)\nforever\n    if <(Level) = [4]> then\n        show\n    else\n        hide\n    end\nend\n\n@Spikes Level 5\n\nwhen flag clicked\ngo to x: (90) y: (-160)\nforever\n    if <(Level) = [5]> then\n        show\n    else\n        hide\n    end\nend\n\n@Spikes Level 6\n\nwhen flag clicked\ngo to x: (213) y: (-160)\nforever\n    if <(Level) = [6]> then\n        show\n    else\n        hide\n    end\nend\n\n@Spikes Level 7\n\nwhen flag clicked\ngo to x: (195) y: (-160)\nforever\n    if <(Level) = [7]> then\n        show\n    else\n        hide\n    end\nend\n\n@Sprite1\n\nwhen flag clicked\nset pen size to (3)\nhide\nerase all\npen up\nset pen color to (#0000ff)\nforever\n    go to (mouse-pointer v)\nend\n\nwhen I receive [level 8 v]\nforever\n    if <mouse down?> then\n        pen down\n        wait until <not <mouse down?>>\n    else\n        pen up\n    end\n    wait until <(Level) = [9]>\n    erase all\n    stop [this script v]\nend\n\nwhen I receive [level 9 v]\nforever\n    if <mouse down?> then\n        pen down\n        wait until <not <mouse down?>>\n    else\n        pen up\n    end\n    wait until <(Level) = [10]>\n    erase all\n    stop [this script v]\nend\n\nwhen flag clicked\nforever\n    if <key (c v) pressed?> then\n        erase all\n    end\nend\n\nwhen I receive [level 11 v]\nforever\n    if <mouse down?> then\n        pen down\n        wait until <not <mouse down?>>\n    else\n        pen up\n    end\n    wait until <(Level) = [12]>\n    erase all\n    stop [this script v]\nend\n\nwhen I receive [level 15 v]\nforever\n    if <mouse down?> then\n        pen down\n        wait until <not <mouse down?>>\n    else\n        pen up\n    end\n    wait until <(Level) = [16]>\n    erase all\n    stop [this script v]\nend\n\nwhen I receive [level 16 v]\nforever\n    if <mouse down?> then\n        pen down\n        wait until <not <mouse down?>>\n    else\n        pen up\n    end\nend\n\nwait until <(Level) = [16]>\nerase all\nstop [this script v]\n\n@Spikes Level 8\n\nwhen flag clicked\ngo to x: (131) y: (-160)\nforever\n    if <(Level) = [8]> then\n        show\n    else\n        hide\n    end\nend\n\n@Spikes Level 9\n\nwhen flag clicked\ngo to x: (0) y: (-4)\nforever\n    if <(Level) = [9]> then\n        show\n    else\n        hide\n    end\nend\n\n@Level 2 surprise text2\n\nwhen flag clicked\ngo to x: (174) y: (-71)\nhide\nforever\n    if <(Level) = [11]> then\n        hide\n    end\nend\n\nwhen I receive [level 10 surprise text v]\nshow\n\n@Spikes Level 11\n\nwhen flag clicked\ngo to x: (35) y: (103)\nforever\n    if <(Level) = [11]> then\n        show\n    else\n        hide\n    end\nend\n\n@Sprite2\n\nwhen I receive [show 5 v]\nshow\ngo to x: (134) y: (34)\n\nwhen flag clicked\nhide\n\nwhen flag clicked\nforever\n    if <(Level) = [14]> then\n        hide\n    end\nend\n\n@Sprite3\n\nwhen flag clicked\nhide\n\nwhen flag clicked\nforever\n    if <(Level) = [12]> then\n        show\n    end\n    if <(Level) = [13]> then\n        hide\n    end\nend\n\n@Player2\n\nwhen flag clicked\ngo to x: (0) y: (0)\nset size to (100) %\nhide\n\n