-Jungle Ninja- Platformer

Instructions: You are a Ninja in the jungle trying to escape,\nCan you?\n\nRed - Lava\nYellow - Bouncy\nBlue - Water\n\n

@Stage\n\n@player\n\nwhen flag clicked\nset [level v] to [1]\nset [x velocity v] to [0]\nset [y velocity v] to [0]\nset [brightness v] effect to (0)\ngo to x: (-214) y: (-111)\nwait (.01) seconds\nwait until <not <(Game) = [lobby]>>\nforever\n    if <not <touching (water v)?>> then\n        Platform Gravity: [-1] Jump Height: [15] Side Movement Speed [3] Friction [.7] Slope: [8]\n    else\n        Platform Gravity: [-.05] Jump Height: [0] Side Movement Speed [1] Friction [.7] Slope: [8]\n        if <key (up arrow v) pressed?> then\n            set [y velocity v] to [1.5]\n        end\n    end\n    if <touching (lava v)?> then\n        go to x: (-214) y: (-111)\n    end\n    if <touching (endoflevel v)?> then\n        broadcast (Next Level v)\n        wait (.3) seconds\n        change [level v] by (1)\n        go to x: (-214) y: (-111)\n    end\n    if <touching (bouncepad v)?> then\n        set [y velocity v] to [22]\n    end\nend\n\ndefine Platform Gravity: (gravity) Jump Height: (jump height) Side Movement Speed (side movement) Friction (friction) Slope: (slope)\nchange [y velocity v] by (gravity)\nchange y by (Y Velocity)\nif <touching (ground v)?> then\n    repeat until <not <touching (ground v)?>>\n        change y by ((([abs v] of (Y Velocity) ) / (Y Velocity)) * (-1))\n    end\n    set [y velocity v] to (<<key (up arrow v) pressed?> and <(([abs v] of (Y Velocity) ) / (Y Velocity)) = [-1]>> * (jump height))\nend\nset [x velocity v] to (((X Velocity) + ((<key (left arrow v) pressed?> * ((side movement) * (-1))) + (<key (right arrow v) pressed?> * (side movement)))) * (friction))\nchange x by (X Velocity)\nset [slope v] to [0]\nrepeat until <<(Slope) = ((slope) * (-1))> or <not <touching (ground v)?>>>\n    change y by (1)\n    change [slope v] by (-1)\nend\nif <touching (ground v)?> then\n    change y by (Slope)\n    repeat until <not <touching (ground v)?>>\n        change x by ((([abs v] of (X Velocity) ) / (X Velocity)) * (-1))\n    end\nend\n\nwhen flag clicked\nset [record set v] to []\nset [game v] to [lobby]\nset [time v] to [0]\nwait until <not <(Game) = [lobby]>>\nrepeat until <(Level) = [9]>\n    wait (1) seconds\n    change [time v] by (1)\nend\nif <(Time) < (☁ Record)> then\n    set [record set v] to [yes]\n    set [☁ record v] to (Time)\nelse\n    set [record set v] to [no]\nend\n\nwhen flag clicked\nswitch costume to (costume1 v)\nforever\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nset size to (90) %\nset [brightness v] effect to (100)\nswitch costume to (costume2 v)\nrepeat (5)\n    change [ghost v] effect by (20)\nend\ndelete this clone\n\n@ground\n\nwhen flag clicked\nforever\n    switch costume to (Level)\nend\n\n@extras\n\nwhen flag clicked\ngo to [back v] layer\ngo [forward v] (1) layers\nforever\n    switch costume to (Level)\nend\n\nset [level v] to [8]\n\n@lava\n\nwhen flag clicked\nforever\n    switch costume to (Level)\nend\n\nwait (1) seconds\ngo [forward v] (1) layers\n\n@endOfLevel\n\nwhen flag clicked\nshow\nforever\n    go to [back v] layer\n    set [ghost v] effect to (100)\nend\n\n@shadows\n\nwhen flag clicked\nforever\n    switch costume to (Level)\nend\n\nwhen flag clicked\nforever\n    go to [back v] layer\nend\n\n@bouncepad\n\nwhen flag clicked\nforever\n    switch costume to (Level)\nend\n\n@water\n\nwhen flag clicked\ngo to x: (0) y: (0)\nforever\n    go to [back v] layer\n    go [forward v] (9) layers\n    set [ghost v] effect to (30)\n    switch costume to (Level)\nend\n\nwait (1) seconds\n\nwhen flag clicked\nforever\n    repeat (5)\n        change y by (1)\n        wait (.05) seconds\n    end\n    repeat (5)\n        change y by (-1)\n        wait (.05) seconds\n    end\nend\n\nchange [mosaic v] effect by (25)\n\n@Level Transition\n\nwhen flag clicked\nshow\nset [ghost v] effect to (100)\nforever\n    go to [front v] layer\nend\n\nwhen I receive [next level v]\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nrepeat (10)\n    change [ghost v] effect by (10)\nend\n\nforever\n\nwhen [timer v] > (0)\nhide\n\n@Thumb Nail\n\nwhen flag clicked\ngo to x: (0) y: (0)\nshow\nswitch costume to (start v)\nwait until <key (space v) pressed?>\nset [game v] to [start]\nhide\n\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\n\nwhen [timer v] > (0)\ngo to x: (0) y: (0)\nswitch costume to (title v)\nshow\n\nwhen flag clicked\nforever\n    play sound (pick random (1) to (3)) until done\nend\n\nwhen flag clicked\nforever\n    reset timer\nend\n\n\n\nwhen flag clicked\nrepeat until <key (space v) pressed?>\n    repeat (5)\n        change y by (1)\n    end\n    repeat (5)\n        change y by (-1)\n    end\nend\n\n@Sprite1\n\nwhen flag clicked\nshow\npoint in direction (90)\nset size to (150) %\nrepeat (10)\n    change size by (-5)\nend\nrepeat until <(Game) = [start]>\n    repeat (20)\n        turn right (-.5) degrees\n    end\n    repeat (20)\n        turn right (.5) degrees\n    end\nend\n\nwhen flag clicked\nwait (.01) seconds\nforever\n    wait until <(Game) = [start]>\n    hide\nend\n\nwhen [timer v] > (0)\nhide\n\n@sprite2\n\nwhen flag clicked\nwait (.01) seconds\nforever\n    wait until <(Game) = [start]>\n    hide\nend\n\nwhen flag clicked\ngo to x: (0) y: (-60)\nshow\npoint in direction (90)\nset size to (10) %\nrepeat (10)\n    change size by (9)\nend\nrepeat until <(Game) = [start]>\n    repeat (20)\n        turn right (.5) degrees\n    end\n    repeat (20)\n        turn right (-.5) degrees\n    end\nend\n\nwhen [timer v] > (0)\nhide\n\n@number\n\nwhen I start as a clone\nshow\nforever\n    if <(length of (Time)) < (#)> then\n        hide\n    else\n        switch costume to (letter (#) of (Time))\n        show\n    end\n    go to x: (((#) * (10)) - (240)) y: (150)\n    go to [front v] layer\nend\n\nwhen flag clicked\nwait (.1) seconds\nwait until <(Game) = [start]>\nhide\nset size to (100) %\nset [# v] to [1]\nrepeat (45)\n    create clone of (_myself_ v)\n    change [# v] by (1)\nend\n\n@cloud\n\nwhen I start as a clone\nshow\nforever\n    if <(length of (☁ Record)) < (#)> then\n        hide\n    else\n        switch costume to (letter (#) of (☁ Record))\n        show\n    end\n    go to x: (((#) * (10)) - (215)) y: (168)\n    go to [front v] layer\nend\n\nwhen flag clicked\nwait (.1) seconds\nwait until <(Game) = [start]>\nhide\nset size to (100) %\nset [# v] to [1]\nrepeat (45)\n    create clone of (_myself_ v)\n    change [# v] by (1)\nend\n\n@Sprite2\n\nwhen flag clicked\ngo to [front v] layer\ngo to x: (-57) y: (45)\nhide\nwait (.1) seconds\nwait until <(Game) = [start]>\nshow\n\nwhen [timer v] > (0)\nhide\n\n@Sprite3\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\nwait (.1) seconds\nforever\n    if <(Record Set) = [yes]> then\n        switch costume to (costume1 v)\n        show\n    end\n    if <(Record Set) = [no]> then\n        switch costume to (costume2 v)\n        show\n    end\nend\n\nwhen flag clicked\nforever\n    repeat (5)\n        change y by (1)\n    end\n    repeat (5)\n        change y by (-1)\n    end\nend\n\n