Spider-Man - A Scrolling Platformer - DEMO

Instructions: Spider-Man, Spider-Man, does whatever the instructions can.\nhttps://forkphorus.github.io/#422948217 for less lag\n- [W][A][S][D] or <^> to move.\n- [S] or down arrow to go down in the air\n- You can wall jump by pressing jump and a sideways \n movement key against a wall.\n- Click to grapple, release to unhook.\n- Use [W][A][S][D] or <^> to move around while grappled.\n- Press [p] to skip a level\n\nGreen/Brown is ground, red is death.\nYou are spider-man, for those who can't tell.\n\nHINT: If you're hanging on to something and can't get up, use S or down arrow to go down and get launched up.

@Stage\n\nwhen flag clicked\nset volume to (30) %\nforever\n    play sound [Mission Impossible v] until done\nend\n\n@Grapple Guy\n\nwhen flag clicked\npoint in direction (90)\ngo to x: (0) y: (0)\nset size to (10) %\nclear graphic effects\nforever\n    if <<not <(grapple x) = [0]>> and <not <(grapple y) = [0]>>> then\n        turn right ((x) * (0.6)) degrees\n    else\n        turn right ((x) * (0.3)) degrees\n    end\n    point in direction (((direction) * (0.7777777777777)) + (20))\nend\n\n@Grapple\n\nwhen flag clicked\ndo apple\n\nwhen I receive [dead v]\nstop [other scripts in sprite v]\nbroadcast (new grapple v)\n\nwhen I receive [new grapple v]\ndo apple\n\ndefine do apple\nset size to (10) %\nset [grapple speed v] to [100]\nforever\n    clear graphic effects\n    go to x: (0) y: (0)\n    hide\n    set [grapplexvelchange v] to [0]\n    set [grappleyvelchange v] to [0]\n    set [grappling? v] to [0]\n    if <mouse down?> then\n        set [grappling? v] to [1]\n        go to x: (0) y: (0)\n        point towards (mouse-pointer v)\n        switch costume to (costume1 v)\n        show\n        move (20) steps\n        change x by (() - (x))\n        change y by (() - (y))\n        repeat until <<<touching (obstacles v)?> or <<<touching (ground v)?> or <touching (_edge_ v)?>> or <not <mouse down?>>>> or <touching (enemy v)?>>\n            move (20) steps\n            change x by (() - (x))\n            change y by (() - (y))\n        end\n        if <touching (ground v)?> then\n            set [grapple x v] to ((x position) - ([x position v] of [ground v]))\n            set [grapple y v] to ((y position) - ([y position v] of [ground v]))\n            repeat until <not <mouse down?>>\n                go to x: ((grapple x) + ([x position v] of [ground v])) y: ((grapple y) + ([y position v] of [ground v]))\n                set [grapple x v] to ((x position) - ([x position v] of [ground v]))\n                set [grapple y v] to ((y position) - ([y position v] of [ground v]))\n                set [grapplexvelchange v] to ((((grapple x) + ([x position v] of [ground v])) / ((150) - (grapple speed))) - ())\n                set [grappleyvelchange v] to ((((grapple y) + ([y position v] of [ground v])) / ((150) - (grapple speed))) - ())\n            end\n        end\n        if <touching (enemy v)?> then\n            set [enemy alize v] to [0]\n        end\n        set [grapplexvelchange v] to [0]\n        set [grappleyvelchange v] to [0]\n        set [grapple x v] to [0]\n        set [grapple y v] to [0]\n    end\n    switch costume to (costume1 v)\nend\n\n@pEN\n\nwhen flag clicked\ngo to (grapple guy v)\ngo to [back v] layer\nforever\n    erase all\n    go to (grapple guy v)\n    if <(grappling?) = [1]> then\n        pen down\n        set pen color to (#f5f5f5)\n        set pen size to (2)\n        go to (grapple v)\n    end\nend\n\nset language to (en v)::tts\n\n@Ground\n\ndefine Platformer engine\nswitch costume to (none v)\nset size to (1000) %\nswitch costume to (costume1 v)\npoint in direction (90)\nchange [y v] by (-1)\nif <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n    change [x v] by (-1)\nend\nif <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n    change [x v] by (1)\nend\nchange [x v] by (grapplexvelchange)\nchange [y v] by (grappleyvelchange)\nset [x v] to ((x) * (0.9))\nchange x by ((x) * (-1))\nif <touching (grapple guy v)?> then\n    change y by (-1)\n    if <touching (grapple guy v)?> then\n        change y by (-1)\n        if <touching (grapple guy v)?> then\n            change y by (-1)\n            if <touching (grapple guy v)?> then\n                change y by (-1)\n                if <touching (grapple guy v)?> then\n                    change y by (-1)\n                    if <touching (grapple guy v)?> then\n                        change y by (-1)\n                        if <touching (grapple guy v)?> then\n                            change y by (6)\n                            change x by ((x) * (1))\n                            if <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n                                set [y v] to [10]\n                                if <(x) > [0]> then\n                                    set [x v] to [-10]\n                                else\n                                    set [x v] to [10]\n                                end\n                            else\n                                set [x v] to [0]\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\nchange y by ((y) * (-1))\nif <touching (grapple guy v)?> then\n    change y by ((y) * (1))\n    set [y v] to [0]\nend\nchange y by (1)\nif <<touching (grapple guy v)?> and <<key (up arrow v) pressed?> or <key (w v) pressed?>>> then\n    set [y v] to [12]\nend\nif <<key (down arrow v) pressed?> or <key (s v) pressed?>> then\n    change [y v] by (-2)\nend\nchange y by (-1)\n\nwhen flag clicked\nset [x v] to [0]\nset [y v] to [0]\ngo to x: (-500) y: (100)\nset size to (100) %\nswitch costume to (costume1 v)\nforever\n    Platformer engine\nend\n\ngo to x: (x position) y: ((y position) - (1000))\n\nwhen I receive [dead v]\ngo to x: (CheckpointX) y: (CheckpointY)\nset [x v] to [0]\nset [y v] to [0]\n\nwhen [p v] key pressed\nif <<[-1450] < (CheckpointX)> and <(CheckpointX) < [-1150]>> then\n    if <<[-300] < (CheckpointY)> and <(CheckpointY) < [-150]>> then\n        set [checkpointx v] to [-2150]\n        set [checkpointy v] to [100]\n        broadcast (dead v)\n    end\nend\nif <<[-1100] < (CheckpointX)> and <(CheckpointX) < [-900]>> then\n    if <<[-1800] < (CheckpointY)> and <(CheckpointY) < [-1600]>> then\n        set [checkpointx v] to [-1300]\n        set [checkpointy v] to [-200]\n        broadcast (dead v)\n    end\nend\nif <<[1300] < (CheckpointX)> and <(CheckpointX) < [1600]>> then\n    if <<[-1750] < (CheckpointY)> and <(CheckpointY) < [-1600]>> then\n        set [checkpointx v] to [-1000]\n        set [checkpointy v] to [-1750]\n        broadcast (dead v)\n    end\nend\nif <<[1800] < (CheckpointX)> and <(CheckpointX) < [2150]>> then\n    if <<[-600] < (CheckpointY)> and <(CheckpointY) < [-400]>> then\n        set [checkpointx v] to [1500]\n        set [checkpointy v] to [-1675]\n        broadcast (dead v)\n    end\nend\nif <<[-600] < (CheckpointX)> and <(CheckpointX) < [205]>> then\n    if <<[-90] < (CheckpointY)> and <(CheckpointY) < [140]>> then\n        set [checkpointx v] to [2000]\n        set [checkpointy v] to [-430]\n        broadcast (dead v)\n    end\nend\n\n@enemy\n\nwhen flag clicked\nset [enemy alize v] to [0]\nforever\n    if <(enemy alize) = [1]> then\n        show\n        point towards (grapple guy v)\n        move (1) steps\n    else\n        hide\n    end\nend\n\n@Obstacles\n\nwhen flag clicked\nforever\n    go to x: ([x position v] of [ground v]) y: ([y position v] of [ground v])\n    switch costume to (none v)\n    go to [back v] layer\n    set size to (1000) %\n    switch costume to (costume1 v)\n    if <touching (grapple guy v)?> then\n        broadcast (dead v)\n    end\nend\n\n@tumbthail\n\nwhen flag clicked\nshow\nclear graphic effects\nshow\nclear graphic effects\nswitch costume to (costume2 v)\nset size to (100) %\nswitch costume to (costume3 v)\ngo to [front v] layer\ngo to x: (0) y: (0)\nwait (2) seconds\nrepeat (50)\n    change [ghost v] effect by (2)\nend\nhide\nswitch costume to (costume2 v)\nset size to (100) %\nswitch costume to (costume1 v)\n\nwhen flag clicked\nforever\n    reset timer\nend\n\nwhen [timer v] > (0.05)\nchange [timer v] by (0.1)\nif <not <(username) = [Yobo-Hobo]>> then\n    forever\n        show\n        clear graphic effects\n        switch costume to (costume2 v)\n        set size to ((90) + ((15) * ([sin v] of ((timer) * (100)) ))) %\n        switch costume to (costume1 v)\n        go to [front v] layer\n        go to x: (0) y: (0)\n        change [timer v] by (0.05)\n        reset timer\n    end\nend\nshow\nclear graphic effects\nswitch costume to (costume2 v)\nset size to ((90) + ((15) * ([sin v] of ((timer) * (100)) ))) %\nswitch costume to (costume1 v)\ngo to [front v] layer\ngo to x: (0) y: (0)\nchange [timer v] by (0.05)\n\nshow\nclear graphic effects\nswitch costume to (costume2 v)\nset size to (100) %\nswitch costume to (costume3 v)\ngo to [front v] layer\ngo to x: (0) y: (0)\n\n@Checkpoints\n\nwhen flag clicked\nset [checkpointx v] to [-500]\nset [checkpointy v] to [100]\nforever\n    go to [back v] layer\n    go to x: ([x position v] of [ground v]) y: ([y position v] of [ground v])\n    switch costume to (none v)\n    set size to (1000) %\n    switch costume to (costume1 v)\n    if <touching (grapple guy v)?> then\n        set [checkpointx v] to ([x position v] of [ground v])\n        set [checkpointy v] to ([y position v] of [ground v])\n    end\nend\n\n