Pen Platformer

Instructions:  Arrow keys\n \nr to reset\n\nPlease like and fav\n\nif any glitches please say in comments \n\nThanks - From Pablo :-)\n

@Stage\n\n@Sprite2\n\nwhen flag clicked\nhide\n\nwhen I receive [end v]\nshow\ngo to x: (2) y: (10)\nset [variable name v] to [0]\nforever\n    change [variable name v] by (10)\n    point in direction ((([sin v] of (variable name) ) * (7)) + (90))\nend\n\n@Star2\n\nwhen flag clicked\nhide\n\nwhen I receive [end v]\nshow\ngo to x: (-169) y: (-142)\nforever\n    glide (0.5) secs to x: (-169) y: (-148)\n    glide (0.5) secs to x: (-169) y: (-142)\n    go to [front v] layer\nend\n\n@Star\n\nwhen flag clicked\nhide\n\nwhen I receive [end v]\nshow\ngo to x: (-129) y: (-148)\nforever\n    glide (0.5) secs to x: (-129) y: (-142)\n    glide (0.5) secs to x: (-129) y: (-148)\n    go to [front v] layer\nend\n\n@Player\n\nwhen flag clicked\nforever\n    if <key (r v) pressed?> then\n        go to x: (-186) y: (-137)\n    end\nend\n\nwhen flag clicked\ngo to x: (-203) y: (-24)\nset [level v] to [1]\nshow\nforever\n    go to [front v] layer\n    set [y v] to [0]\n    set [x v] to [0]\n    forever\n        change [y v] by (-1)\n        set [x v] to ((x) * (0.9))\n        if <key (left arrow v) pressed?> then\n            switch costume to (left v)\n            change [x v] by (-1)\n        end\n        if <key (right arrow v) pressed?> then\n            switch costume to (right v)\n            change [x v] by (1)\n        end\n        change x by (x)\n        if <touching color (#00ff55)?> then\n            change y by (1)\n        end\n        if <touching color (#00ff55)?> then\n            change y by (1)\n        end\n        if <touching color (#00ee4f)?> then\n            change y by (1)\n        end\n        if <touching color (#00ff55)?> then\n            change y by (1)\n        end\n        if <touching color (#00ff55)?> then\n            change y by (-4)\n            change x by ((x) * (-1))\n            if <key (up arrow v) pressed?> then\n                set [y v] to [10]\n                if <([abs v] of (x) ) = (x)> then\n                    set [x v] to [-4]\n                else\n                    set [x v] to [4]\n                end\n            else\n                set [x v] to [0]\n            end\n        end\n        change y by (y)\n        if <touching color (#00ff55)?> then\n            change y by ((y) - ((y) * (2)))\n            set [y v] to [0]\n        end\n        change y by (-1)\n        if <<key (up arrow v) pressed?> and <touching color (#00ff55)?>> then\n            set [y v] to [15]\n        end\n        change y by (1)\n    end\nend\n\nwhen flag clicked\nforever\n    if <<[245] < (x position)> and <(level) < [11]>> then\n        change [level v] by (1)\n        broadcast (next level v)\n        go to x: (-203) y: (-123)\n        stop [this script v]\n    end\nend\n\nwhen flag clicked\nforever\n    if <touching color (#ff0000)?> then\n        go to x: (-203) y: (-123)\n    end\nend\n\nwhen I receive [next level v]\nforever\n    if <<[245] < (x position)> and <(level) < [11]>> then\n        change [level v] by (1)\n        broadcast (next level v)\n        go to x: (-203) y: (-123)\n        stop [this script v]\n    end\nend\n\nwhen I receive [end v]\nhide\n\n@Sprite1\n\nwhen flag clicked\nforever\n    show\n    go to [front v] layer\n    set [ghost v] effect to (100)\n    go to x: (0) y: (0)\nend\n\nshow\ngo to [front v] layer\n\n@Pen\n\ndefine Draw line from (x) (y) to (x2) (y2) set pen size to (pen size)\ngo to x: (x) y: (y)\nset pen color to (#00ff55)\nset pen size to (pen size)\npen down\ngo to x: (x2) y: (y2)\npen up\n\nwhen I receive [next level v]\nerase all\nif <not <(level) = [6]>> then\n    Draw line from (-238) (-179) to (240) (-179) set pen size to (50)\nend\nif <(level) = [1]> then\n    Draw line from (-238) (-179) to (234) (-179) set pen size to (50)\nelse\n    if <(level) = [2]> then\n        Draw line from (8) (-157) to (8) (1) set pen size to (30)\n    else\n        if <(level) = [3]> then\n            Draw lava from (8) (-156) to (8) (-75) set pen size to (30)\n            Draw line from (-100) (5) to (127) (5) set pen size to (30)\n            Draw line from (-238) (-185) to (234) (-185) set pen size to (50)\n        else\n            if <(level) = [4]> then\n                Draw line from (25) (-172) to (25) (-50) set pen size to (30)\n                Draw lava from (-108) (26) to (125) (26) set pen size to (30)\n                Draw line from (-108) (55) to (125) (55) set pen size to (30)\n            else\n                if <(level) = [5]> then\n                    Draw lava from (157) (-150) to (240) (-150) set pen size to (30)\n                    Draw line from (149) (-161) to (149) (97) set pen size to (30)\n                    Draw line from (-242) (-70) to (44) (-70) set pen size to (30)\n                    Draw lava from (-128) (17) to (70) (17) set pen size to (30)\n                    Draw line from (149) (30) to (-167) (30) set pen size to (30)\n                    Draw line from (-238) (-179) to (240) (-179) set pen size to (50)\n                else\n                    if <(level) = [6]> then\n                        Draw lava from (-238) (-179) to (240) (-179) set pen size to (50)\n                        Draw line from (-238) (-179) to (-159) (-179) set pen size to (50)\n                        Draw line from (102) (-179) to (115) (-179) set pen size to (50)\n                    else\n                        if <(level) = [7]> then\n                            Draw lava from (-61) (-173) to (-61) (26) set pen size to (30)\n                            Draw line from (-80) (-173) to (-80) (26) set pen size to (30)\n                            Draw lava from (49) (181) to (49) (-59) set pen size to (30)\n                            Draw line from (70) (181) to (70) (-59) set pen size to (30)\n                            Draw line from (70) (-59) to (49) (-59) set pen size to (30)\n                            Draw lava from (152) (-155) to (237) (-155) set pen size to (50)\n                            Draw line from (-238) (-179) to (240) (-179) set pen size to (50)\n                        else\n                            if <(level) = [8]> then\n                                Draw line from (-113) (-110) to (-65) (-110) set pen size to (30)\n                                Draw line from (-13) (-49) to (35) (-49) set pen size to (30)\n                                Draw line from (88) (13) to (136) (13) set pen size to (30)\n                                Draw lava from (-28) (-154) to (237) (-154) set pen size to (30)\n                                Draw line from (-238) (-179) to (240) (-179) set pen size to (50)\n                            else\n                                if <(level) = [9]> then\n                                    Draw lava from (-80) (-175) to (-80) (4) set pen size to (30)\n                                    Draw lava from (-80) (-157) to (160) (-157) set pen size to (30)\n                                    Draw lava from (160) (-157) to (160) (-86) set pen size to (30)\n                                    Draw lava from (176) (-151) to (237) (-151) set pen size to (30)\n                                    Draw line from (-92) (-175) to (-92) (4) set pen size to (30)\n                                    Draw line from (170) (-157) to (170) (4) set pen size to (30)\n                                    Draw line from (-238) (-179) to (240) (-179) set pen size to (50)\n                                else\n                                    if <(level) = [10]> then\n                                        Draw line from (-120) (-173) to (-120) (94) set pen size to (30)\n                                        Draw lava from (-24) (-90) to (-24) (181) set pen size to (30)\n                                        Draw lava from (171) (-90) to (171) (181) set pen size to (30)\n                                        Draw line from (72) (-173) to (72) (94) set pen size to (30)\n                                    else\n                                        if <(level) = [11]> then\n                                            broadcast (End v)\n                                        end\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\ndefine Draw lava from (x) (y) to (x2) (y2) set pen size to (pen size)\ngo to x: (x) y: (y)\nset pen color to (#ff0000)\nset pen size to (pen size)\npen down\ngo to x: (x2) y: (y2)\npen up\n\nwhen flag clicked\nerase all\nhide\nwait until <(play) = [0]>\nDraw line from (-238) (-179) to (240) (-179) set pen size to (50)\n\n