T R I X [Platformer]

Instructions: GO CHECK OUT THIS PROJECT!!! --> Ascension\n\nThis is a PLATFORMER... with many surprises along the way. \nAlthough there are only seven levels, they are DIFFICULT to beat.\n\nBE WARNED...\n\nInstructions:\nMOVE - Arrow Keys\nLEVEL SKIP - Press "s"\n\nThat's all you need to know.\nYou can figure out the rest.

@Stage\n\nwhen flag clicked\nset [end of game? v] to [0]\nset [score allowed? v] to [1]\nhide variable [level # v]\nhide variable [death count v]\nhide variable [☁ best death count v]\nhide variable [time v]\nhide variable [☁ best time v]\nhide variable [level skip v]\nswitch backdrop to (backdrop1 v)\nwait (0.5) seconds\nrepeat (50)\n    change [ghost v] effect by (2)\nend\nswitch backdrop to (scratch logo v)\nset [ghost v] effect to (0)\n\nwhen I receive [next level v]\nif <(LEVEL #) = [8]> then\n    broadcast (end v)\n    set [end of game? v] to [1]\n    hide variable [level # v]\n    hide variable [level skip v]\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\n    next backdrop\n    repeat (10)\n        change [ghost v] effect by (-10)\n    end\nelse\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\n    next backdrop\n    repeat (10)\n        change [ghost v] effect by (-10)\n    end\nend\n\nwhen I receive [level 1 v]\nshow variable [level # v]\nshow variable [death count v]\nshow variable [☁ best death count v]\nshow variable [time v]\nshow variable [☁ best time v]\nshow variable [level skip v]\nset [ghost v] effect to (100)\nswitch backdrop to (backdrop2 v)\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nwait (0.5) seconds\nforever\n    play sound [medieval1 v] until done\nend\n\nwhen I receive [level 1 v]\nreset timer\nforever\n    if <(Score Allowed?) = [1]> then\n        set [time v] to (round (timer))\n    else\n        hide variable [time v]\n        hide variable [death count v]\n        set [time v] to [N/A]\n        set [death count v] to [N/A]\n    end\n    if <(End of Game?) = [1]> then\n        stop [this script v]\n    end\nend\n\n@Player\n\ndefine None\nchange x by (speed)\nset [slope v] to [0]\nrepeat until <<(Slope) = [8]> or <not <touching color (#666666)?>>>\n    change y by (1)\n    change [slope v] by (1)\nend\nif <(Slope) = [8]> then\n    change x by ((0) - (speed))\n    change y by ((0) - (Slope))\n    if <<key (up arrow v) pressed?> and <([abs v] of (speed) ) > [3]>> then\n        set [speed x v] to ((-1.2) * (speed))\n        set [speed y v] to [8]\n        set [falling v] to [0]\n        set [wall jump v] to [15]\n    else\n        set [speed x v] to [0]\n    end\nend\n\nwhen I receive [reset v]\nshow\nswitch costume to (costume2 v)\npoint in direction (90)\ngo to x: (-215) y: (-10)\nset [ghost v] effect to (100)\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nset [color v] effect to (100)\nset [speed y v] to [0]\nset [speed x v] to [0]\nset [level skip v] to []\nforever\n    if <(x position) < [-227]> then\n        set x to (-227)\n    end\n    change [speed y v] by (-1)\n    change y by (Speed Y)\n    Touch Ground: <(Speed Y) > [0]>\n    if <<key (up arrow v) pressed?> and <(Falling) < [3]>> then\n        switch costume to (costume1 v)\n        set [speed y v] to [10]\n    end\n    if <(Wall Jump) > [0]> then\n        change [wall jump v] by (-1)\n    else\n        set [speed x v] to ((Speed X) * (0.7))\n        if <key (left arrow v) pressed?> then\n            switch costume to (costume3 v)\n            change [speed x v] by (-1.5)\n        end\n        if <key (right arrow v) pressed?> then\n            switch costume to (costume2 v)\n            change [speed x v] by (1.5)\n        end\n    end\n    if <(Speed X) < [-0.5]> then\n        Walk (Speed X)\n    else\n        if <(Speed X) > [0.5]> then\n            Walk (Speed X)\n        end\n    end\nend\n\nwhen I receive [level 1 v]\nset [level # v] to [1]\ngo to x: (-215) y: (-10)\nforever\n    if <key (s v) pressed?> then\n        set [level skip v] to [skipping...]\n        set [score allowed? v] to [0]\n    end\n    if <touching color (#ff0000)?> then\n        switch costume to (costume1 v)\n        change [death count v] by (1)\n        broadcast (Reset v)\n    end\n    if <<touching (border v)?> or <(LEVEL SKIP) = [skipping...]>> then\n        stop [other scripts in sprite v]\n        change [level # v] by (1)\n        broadcast (Next Level v)\n        if <(LEVEL #) = [2]> then\n            broadcast (LEVEL 2 v)\n        end\n        if <(LEVEL #) = [3]> then\n            broadcast (LEVEL 3 v)\n        end\n        if <(LEVEL #) = [4]> then\n            broadcast (LEVEL 4 v)\n        end\n        if <(LEVEL #) = [5]> then\n            broadcast (LEVEL 5 v)\n        end\n        if <(LEVEL #) = [6]> then\n            broadcast (LEVEL 6 v)\n        end\n        if <(LEVEL #) = [7]> then\n            broadcast (LEVEL 7 v)\n        end\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n        broadcast (Reset v)\n        set [level skip v] to []\n    end\nend\n\nwhen flag clicked\nset [death count v] to [0]\nset [level # v] to [0]\nhide\n\ndefine Touch Ground: <>\nchange [falling v] by (1)\nrepeat until <not <touching color (#666666)?>>\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    set [speed y v] to [0]\nend\n\nwhen I receive [end v]\nstop [other scripts in sprite v]\nif <(Score Allowed?) = [1]> then\n    if <(TIME) < (☁ BEST TIME)> then\n        set [☁ best time v] to (TIME)\n    end\n    if <(DEATH COUNT) < (☁ BEST DEATH COUNT)> then\n        set [☁ best death count v] to (DEATH COUNT)\n    end\nend\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\n\n@Border\n\nwhen flag clicked\nset [ghost v] effect to (100)\nshow\ngo to x: (0) y: (0)\n\n@Ground 1\n\nwhen flag clicked\nhide\n\nwhen I receive [level 2 v]\ngo to x: (-100) y: (-30)\nset [ghost v] effect to (100)\nshow\nwait (0.5) seconds\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nforever\n    repeat (50)\n        change [ghost v] effect by (2)\n    end\n    wait (2) seconds\n    repeat (50)\n        change [ghost v] effect by (-2)\n    end\n    wait (2) seconds\nend\n\nwhen I receive [level 3 v]\nstop [other scripts in sprite v]\nset [ghost v] effect to (100)\ngo to x: (140) y: (-5)\nwait (0.5) seconds\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nforever\n    repeat (10)\n        change [ghost v] effect by (-10)\n    end\n    wait (pick random (1) to (2)) seconds\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\n    wait (pick random (0) to (1)) seconds\nend\n\nwhen I receive [level 4 v]\nstop [other scripts in sprite v]\nset [ghost v] effect to (0)\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\n\n@Ground 2\n\nwhen flag clicked\nhide\n\nwhen I receive [level 2 v]\ngo to x: (25) y: (-30)\nset [ghost v] effect to (100)\nshow\nwait (0.5) seconds\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nwait (1) seconds\nforever\n    repeat (50)\n        change [ghost v] effect by (2)\n    end\n    wait (2) seconds\n    repeat (50)\n        change [ghost v] effect by (-2)\n    end\n    wait (2) seconds\nend\n\nwhen I receive [level 3 v]\nstop [other scripts in sprite v]\nset [ghost v] effect to (0)\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\n\n@Ground 3\n\nwhen flag clicked\nhide\n\nwhen I receive [level 2 v]\ngo to x: (150) y: (-30)\nset [ghost v] effect to (100)\nshow\nwait (0.5) seconds\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nwait (2) seconds\nforever\n    repeat (50)\n        change [ghost v] effect by (2)\n    end\n    wait (2) seconds\n    repeat (50)\n        change [ghost v] effect by (-2)\n    end\n    wait (2) seconds\nend\n\nwhen I receive [level 3 v]\nstop [other scripts in sprite v]\nset [ghost v] effect to (0)\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\n\n@Point 1\n\nwhen flag clicked\nhide\n\nwhen I receive [level 6 v]\nstop [other scripts in sprite v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\n\nwhen I receive [level 5 v]\ngo to x: (-20) y: (-40)\nset [ghost v] effect to (100)\nshow\nwait (0.5) seconds\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nforever\n    wait (3) seconds\n    change [brightness v] effect by (-15)\n    wait (3) seconds\n    change [brightness v] effect by (15)\n    wait (3) seconds\n    change [brightness v] effect by (15)\n    wait (3) seconds\n    change [brightness v] effect by (-15)\nend\n\n@Point 2\n\nwhen flag clicked\nhide\n\nwhen I receive [level 6 v]\nstop [other scripts in sprite v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\n\nwhen I receive [level 5 v]\ngo to x: (15) y: (0)\nset [ghost v] effect to (100)\nshow\nwait (0.5) seconds\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nforever\n    wait (3) seconds\n    change [brightness v] effect by (-15)\n    wait (3) seconds\n    change [brightness v] effect by (15)\n    wait (3) seconds\n    change [brightness v] effect by (15)\n    wait (3) seconds\n    change [brightness v] effect by (-15)\nend\n\n@Point 3\n\nwhen flag clicked\nhide\n\nwhen I receive [level 5 v]\ngo to x: (45) y: (40)\nset [ghost v] effect to (100)\nshow\nwait (0.5) seconds\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nforever\n    wait (3) seconds\n    change [brightness v] effect by (-15)\n    wait (3) seconds\n    change [brightness v] effect by (15)\n    wait (3) seconds\n    change [brightness v] effect by (15)\n    wait (3) seconds\n    change [brightness v] effect by (-15)\nend\n\nwhen I receive [level 6 v]\nstop [other scripts in sprite v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\n\n@Red 1\n\nwhen flag clicked\nhide\n\nwhen I receive [level 6 v]\ngo to x: (-150) y: (-43)\nset [ghost v] effect to (100)\nwait (0.5) seconds\nshow\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nforever\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\n    wait (pick random (1) to (2)) seconds\n    repeat (10)\n        change [ghost v] effect by (-10)\n    end\n    wait (pick random (0) to (1)) seconds\nend\n\nwhen I receive [level 7 v]\nstop [other scripts in sprite v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\n\n@Red 2\n\nwhen flag clicked\nhide\n\nwhen I receive [level 6 v]\ngo to x: (-50) y: (-43)\nset [ghost v] effect to (100)\nwait (0.5) seconds\nshow\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nforever\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\n    wait (pick random (1) to (2)) seconds\n    repeat (10)\n        change [ghost v] effect by (-10)\n    end\n    wait (pick random (0) to (1)) seconds\nend\n\nwhen I receive [level 7 v]\nstop [other scripts in sprite v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\n\n@Red 3\n\nwhen flag clicked\nhide\n\nwhen I receive [level 6 v]\ngo to x: (50) y: (-43)\nset [ghost v] effect to (100)\nwait (0.5) seconds\nshow\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nforever\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\n    wait (pick random (1) to (2)) seconds\n    repeat (10)\n        change [ghost v] effect by (-10)\n    end\n    wait (pick random (0) to (1)) seconds\nend\n\nwhen I receive [level 7 v]\nstop [other scripts in sprite v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\n\n@Red 4\n\nwhen flag clicked\nhide\n\nwhen I receive [level 6 v]\ngo to x: (150) y: (-43)\nset [ghost v] effect to (100)\nwait (0.5) seconds\nshow\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nforever\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\n    wait (pick random (1) to (2)) seconds\n    repeat (10)\n        change [ghost v] effect by (-10)\n    end\n    wait (pick random (0) to (1)) seconds\nend\n\nwhen I receive [level 7 v]\nstop [other scripts in sprite v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\n\n@Red 5\n\nwhen flag clicked\nhide\n\nwhen I receive [level 6 v]\ngo to x: (230) y: (-69)\nset [ghost v] effect to (100)\nwait (0.5) seconds\nshow\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nforever\n    repeat until <(x position) < [-150]>\n        change x by (-5)\n    end\n    repeat until <(x position) > [150]>\n        change x by (5)\n    end\nend\n\nwhen I receive [level 7 v]\nstop [other scripts in sprite v]\nset [ghost v] effect to (0)\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\n\n@BOSS\n\nwhen flag clicked\nhide\n\nwhen I receive [level 7 v]\ngo to [front v] layer\ngo to x: (0) y: (120)\nset [ghost v] effect to (100)\nwait (0.5) seconds\nshow\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\n\nwhen I receive [end v]\nstop [other scripts in sprite v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\n\n@Projectile\n\nwhen flag clicked\nhide\n\nwhen I receive [end v]\nstop [other scripts in sprite v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\n\nwhen I receive [level 7 v]\nwait (1) seconds\nforever\n    repeat until <([x position v] of [player v]) < [-150]>\n        create clone of (_myself_ v)\n        wait (0.05) seconds\n    end\nend\n\nwhen I start as a clone\ngo to x: (0) y: (120)\npoint towards (player v)\nshow\nforever\n    move (12.5) steps\n    if <<<touching color (#666666)?> or <touching color (#ff0000)?>> or <<(x position) > [235]> or <(x position) < [-235]>>> then\n        delete this clone\n    end\nend\n\n@Scratch Logo\n\nwhen flag clicked\nhide\nwait (2.25) seconds\nstart sound [space ripple v]\nshow\nset size to (0) %\ngo to x: (0) y: (0)\npoint in direction (90)\nrepeat until <<(size) > [90]> and <(direction) = [90]>>\n    change size by (2)\n    turn right (15) degrees\nend\nwait (1) seconds\nrepeat (50)\n    change [ghost v] effect by (2)\nend\nbroadcast (LEVEL 1 v)\nbroadcast (Reset v)\nhide\n\n