Pen Platformer 

Instructions: Triple click the green flag for best performance.\nMUST triple click or else it won't load well\nif u go into the ground or stuck, try reload the page or u can duplicate the page and play on the duplicated page. also, u must triple click the flag.\n\nThis is my project for the \n'PERTANDINGAN MENCIPTA GAME MENGGUNAKAN SCRATCH'\n\ncongratz i got 1st place!!\n\nWelcome to my project.\nPlease kindly press the love and star button.\n\n\n11 levels, i know its less.\nVery easy!!\n\nFeatures:\nblack=player\nred=lava\nblue=trampoline\ngreen=wall/ground\ncyan=portal\nbrown=ground\n\nThis is my little game for the competition.\n\nThank You.\n\n\nThis is original made by me and i didn't copy !!!

@Stage\n\nwhen flag clicked\nset [ghost v] effect to (20)\n\n@pen levels\n\ndefine Grass\ngo to [back v] layer\ngo to x: (-240) y: (-89)\ngo to [back v] layer\nrepeat (1000)\n    go to [back v] layer\n    go [backward v] (10000) layers\n    set pen color to (#4ee000)\n    point in direction (([sin v] of (((timer) + (x position)) * (50)) ) * (30))\n    set pen size to (3)\n    pen down\n    move (10) steps\n    pen up\n    move (-10) steps\n    change x by (10)\nend\n\ndefine Draw Lava From (x1) (y1) to (x2) (y2) (size)\npen up\nset pen color to (#ff0000)\nset pen size to (size)\ngo to x: (x1) y: (y1)\npen down\ngo to x: (x2) y: (y2)\npen up\n\ndefine Draw Trampoline From (x1) (y1) to (x2) (y2) (size)\npen up\nset pen color to (#3431ff)\nset pen size to (size)\ngo to x: (x1) y: (y1)\npen down\ngo to x: (x2) y: (y2)\npen up\n\ndefine Portal at (x) (y)\npen up\nset pen color to (#00f2ff)\nset pen size to (50)\ngo to x: (x) y: ((y) + (([cos v] of (((timer) - (1)) * (200)) ) * (5)))\npen down\npen up\n\ndefine Ground\npen up\nset pen color to (#774b00)\nset pen size to (100)\ngo to x: (-240) y: (-180)\npen down\ngo to x: (240) y: (-180)\npen up\nset pen size to (40)\ngo to x: (-240) y: (-120)\npen down\ngo to x: (240) y: (-120)\npen up\nset pen color to (#b56900)\nset pen size to (30)\ngo to x: (-175) y: (-147)\npen down\npen up\nset pen size to (15)\ngo to x: (59) y: (-129)\npen down\npen up\nset pen size to (10)\ngo to x: (106) y: (-150)\npen down\npen up\nset pen color to (#42b500)\nset pen size to (20)\ngo to x: (-240) y: (-100)\npen down\ngo to x: (240) y: (-100)\npen up\n\ndefine Level (level #)\nGrass\nif <(level #) = [1]> then\n    Portal at [190] [-49]\n    Ground\nend\nif <(level #) = [2]> then\n    Draw Wall From [0] [-100] to [0] [-10] size [20]\n    Portal at [190] [-49]\n    Ground\nend\nif <(level #) = [3]> then\n    Draw Lava From [-55] [-88] to [2] [-88] [20]\n    Portal at [190] [-49]\n    Ground\nend\nif <(level #) = [4]> then\n    Draw Wall From [-92] [-60] to [-30] [-60] size [20]\n    Draw Wall From [22] [1] to [84] [1] size [20]\n    Draw Wall From [130] [63] to [193] [63] size [20]\n    Portal at [160] [120]\n    Ground\nend\nif <(level #) = [5]> then\n    Draw Lava From [-50] [-90] to [120] [-90] [20]\n    Draw Wall From [0] [-100] to [0] [-10] size [20]\n    Portal at [190] [-49]\n    Ground\nend\nif <(level #) = [6]> then\n    Draw Lava From [30] [-90] to [30] [30] [20]\n    Draw Trampoline From [-140] [-90] to [-50] [-90] [20]\n    Draw Wall From [130] [50] to [150] [50] size [20]\n    Portal at [180] [110]\n    Ground\nend\nif <(level #) = [7]> then\n    Draw Lava From [-101] [-20] to [49] [-20] [10]\n    Draw Trampoline From [-86] [-90] to [29] [-90] [20]\n    Draw Wall From [-101] [-10] to [49] [-10] size [20]\n    Portal at [194] [-19]\n    Ground\nend\nif <(level #) = [8]> then\n    Draw Lava From [-90] [-88] to [60] [-88] [20]\n    Draw Wall From [-235] [-150] to [235] [-150] size [20]\n    Draw Wall From [70] [-175] to [70] [0] size [20]\n    Draw Wall From [-100] [-175] to [-100] [0] size [20]\n    Portal at [190] [-49]\n    Ground\nend\nif <(level #) = [9]> then\n    Draw Lava From [-60] [-88] to [20] [-88] [20]\n    Draw Lava From [46] [-88] to [235] [-88] [20]\n    Draw Wall From [33] [-175] to [33] [0] size [20]\n    Draw Wall From [200] [-20] to [150] [-20] size [20]\n    Portal at [180] [110]\n    Ground\nend\nif <(level #) = [10]> then\n    Draw Lava From [50] [-88] to [100] [-88] [20]\n    Draw Lava From [-40] [3] to [-40] [-110] [20]\n    Draw Lava From [67] [180] to [67] [30] [20]\n    Draw Wall From [-50] [-111] to [-50] [3] size [20]\n    Draw Wall From [80] [180] to [80] [30] size [20]\n    Portal at [190] [-49]\n    Ground\nend\nif <(level #) = [11]> then\n    Draw Lava From [-104] [-85] to [-104] [-41] [20]\n    Draw Lava From [0] [-41] to [0] [6] [20]\n    Draw Lava From [140] [-88] to [200] [-88] [20]\n    Draw Wall From [-94] [-85] to [-94] [-41] size [20]\n    Draw Wall From [-94] [-41] to [10] [-41] size [20]\n    Draw Wall From [10] [-41] to [10] [6] size [20]\n    Draw Wall From [10] [6] to [110] [6] size [20]\n    Portal at [188] [41]\n    Ground\nelse\n    Ground\nend\n\nwhen flag clicked\nLevel [1]\nforever\n    erase all\n    Level (Level)\nend\n\ndefine Draw Wall From (x1) (y1) to (x2) (y2) size (size)\npen up\nset pen color to (#42b500)\nset pen size to (20)\ngo to x: (x1) y: (y1)\npen down\ngo to x: (x2) y: (y2)\npen up\n\n@player\n\nwhen flag clicked\nhide\nwait (2) seconds\nshow\nswitch costume to (player v)\ngo to x: (-192) y: (-36)\nset [level v] to [1]\nset [xv v] to [0]\nset [yv v] to [0]\nforever\n    set [xv v] to (((Xv) + (<<key (d v) pressed?> or <<key (right arrow v) pressed?> or <<mouse down?> and <(mouse x) > [0]>>>> + (<<key (a v) pressed?> or <<key (left arrow v) pressed?> or <<mouse down?> and <(mouse x) < [0]>>>> * (-1)))) * (0.9))\n    change x by (Xv)\n    if <<touching color (#42b500)?> or <touching color (#000000)?>> then\n        change y by (1)\n        if <<touching color (#42b500)?> or <touching color (#000000)?>> then\n            change y by (1)\n            if <<touching color (#42b500)?> or <touching color (#000000)?>> then\n                change y by (1)\n                if <<touching color (#42b500)?> or <touching color (#000000)?>> then\n                    change y by (1)\n                    if <<touching color (#42b500)?> or <touching color (#000000)?>> then\n                        change y by (1)\n                        if <<touching color (#42b500)?> or <touching color (#000000)?>> then\n                            change y by (-5)\n                            change x by ((Xv) * (-1))\n                            if <<key (w v) pressed?> or <<key (up arrow v) pressed?> or <<mouse down?> and <(mouse y) > [0]>>>> then\n                                set [xv v] to ((([abs v] of (Xv) ) / (Xv)) * (-5))\n                                set [yv v] to [8]\n                            else\n                                set [xv v] to [0]\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change [yv v] by (-1)\n    change y by (Yv)\n    if <<touching color (#42b500)?> or <touching color (#000000)?>> then\n        change y by ((Yv) * (-1))\n        set [yv v] to [0]\n    end\n    change y by (-1)\n    if <<touching color (#42b500)?> or <touching color (#000000)?>> then\n        if <<key (w v) pressed?> or <<key (up arrow v) pressed?> or <<mouse down?> and <(mouse y) > [0]>>>> then\n            set [yv v] to [12]\n        end\n    end\n    change y by (1)\n    if <touching color (#3430ff)?> then\n        set [yv v] to [20]\n    end\n    if <(y position) < [-178]> then\n        go to x: (-192) y: (-75)\n        set [xv v] to [0]\n        set [yv v] to [0]\n    end\n    if <touching color (#ff0000)?> then\n        go to x: (-192) y: (-75)\n        set [xv v] to [0]\n        set [yv v] to [0]\n    end\n    if <touching color (#00f2ff)?> then\n        change [level v] by (1)\n        go to x: (-192) y: (-75)\n        broadcast (level up v)\n        set [xv v] to [0]\n        set [yv v] to [0]\n    end\nend\n\nwhen flag clicked\nforever\n    play sound [lord of the rings v] until done\nend\n\nwhen flag clicked\nforever\n    reset timer\nend\n\nwhen [timer v] > (0.001)\nhide\n\n@thumbnail\n\nwhen flag clicked\nshow\ngo to x: (0) y: (0)\nset [ghost v] effect to (0)\nswitch costume to (backdrop2 v)\nwait (0.7) seconds\nshow\nrepeat (20)\n    change [ghost v] effect by (5)\nend\n\nwhen flag clicked\nforever\n    reset timer\nend\n\nwhen [timer v] > (0.001)\nshow\nrepeat (80)\n    change [ghost v] effect by (-2)\nend\n\n@text, boarders\n\nwhen flag clicked\ngo [forward v] (1) layers\ngo to [front v] layer\nswitch costume to (costume1 v)\nwait (1.7) seconds\nswitch costume to (costume2 v)\n\nwhen I receive [level up v]\nnext costume\n\nwhen flag clicked\nforever\n    reset timer\nend\n\nwhen [timer v] > (0.001)\nswitch costume to (costume1 v)\n\nwhen flag clicked\nforever\n    if <(costume [number v]) = [13]> then\n        broadcast (confetti v)\n    end\nend\n\n@Confetti\n\nwhen flag clicked\nhide\n\nwhen I start as a clone\nshow\nswitch costume to (pick random (1) to (4))\ngo to [front v] layer\ngo [forward v] (100000000000000000000000000000000000) layers\ngo to [front v] layer\ngo to [front v] layer\ngo to x: (pick random (-235) to (235)) y: (180)\ngo to [front v] layer\nshow\nrepeat until <(y position) < [-175]>\n    go [forward v] (1) layers\n    go to [front v] layer\n    turn right (pick random (5) to (15)) degrees\n    change y by (-10)\n    change [ghost v] effect by (4)\nend\ndelete this clone\n\nwhen I receive [confetti v]\nforever\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nshow\n\n