Simple Scrolling Platformer 


@Stage\n\nwhen [m v] key pressed\nshow variable [??? v]\nset [??? v] to (join [x:] (join (round ((Scroll x) - (mouse x))) (join [y:] (round ((Scroll y) - (mouse y))))))\n\nwhen I receive [message1 v]\nforever\n    broadcast (Tick v)\nend\n\n@Player\n\ndefine Scrolling code\nchange [y v] by (-1)\nif <key (right arrow v) pressed?> then\n    change [x v] by (1)\nend\nif <key (left arrow v) pressed?> then\n    change [x v] by (-1)\nend\nset [x v] to ((x) * (0.9))\nchange x by (x)\nif <touching (ground v)?> then\n    change y by (1)\nend\nif <touching (ground v)?> then\n    change y by (1)\nend\nif <touching (ground v)?> then\n    change y by (1)\nend\nif <touching (ground v)?> then\n    change y by (1)\nend\nif <touching (ground v)?> then\n    change y by (-4)\n    change x by ((x) * (-1))\nend\nchange y by (y)\nif <touching (ground v)?> then\n    change y by ((y) - ((y) * (2)))\n    set [y v] to [0]\nend\nchange y by (-1)\nif <<key (up arrow v) pressed?> and <touching (ground v)?>> then\n    set [y v] to [15]\nend\nchange y by (1)\nchange [scroll x v] by ((x position) * (-1))\nchange [scroll y v] by ((y position) * (-1))\ngo to x: (0) y: (0)\nif <(Scroll y) > [290]> then\n    set [x v] to [0]\n    set [y v] to [0]\n    set [scroll x v] to [188]\n    set [scroll y v] to [-140]\nend\n\nwhen I receive [message1 v]\nset [x v] to [0]\nset [y v] to [0]\ngo to x: (0) y: (0)\nforever\n    Scrolling code\nend\n\nwhen I receive [creeper!!!!! v]\nswitch costume to (creeper-16715068 v)\n\nwhen I receive [guy v]\nswitch costume to (costume2 v)\n\nwhen flag clicked\nbroadcast (Guy v)\ngo to [back v] layer\n\n@Ground\n\ndefine GoTo xPos: (x) yPos (y)\ngo to x: (x) y: (y)\nset [x v] to (x)\nset [y v] to (y)\ncreate clone of (_myself_ v)\nnext costume\n\nwhen I start as a clone\nshow\nforever\n    go to x: (((Scroll x) - (x)) + (Player Spawn x)) y: (((Scroll y) - (y)) + (Player Spawn y))\n    show\nend\n\nwhen I receive [level2 v]\n\nwhen I receive [level2 v]\ndelete this clone\n\nswitch costume to (level 1 - 3 v)\nset [scroll x v] to [188]\nset [scroll y v] to [-140]\nwait (0) seconds\nGoTo xPos: [188] yPos [-140]\n\nwhen I receive [message1 v]\ngo [backward v] (99) layers\ngo to [back v] layer\nswitch costume to (costume1 v)\nset size to (([size v] of [player v]) + (15)) %\nswitch costume to (leve1 - 1 v)\nset [player spawn x v] to [150]\nset [player spawn y v] to [-140]\nset [scroll x v] to [188]\nset [scroll y v] to [-140]\nGoTo xPos: [188] yPos [-140]\nGoTo xPos: [-500] yPos [-140]\nGoTo xPos: [-950] yPos [-140]\nGoTo xPos: [-1750] yPos [-140]\nGoTo xPos: [-2385] yPos [-140]\n\n@Finish Flag\n\nwhen flag clicked\ngo to [back v] layer\nset [x v] to [-627]\nset [y v] to [-250]\nforever\n    next costume\n    wait (0.1) seconds\nend\n\nwhen I receive [tick v]\ngo to [back v] layer\nforever\n    if <touching (player v)?> then\n        broadcast (Level2 v)\n    end\n    go to x: ((Scroll x) - (x)) y: ((Scroll y) - (y))\nend\n\n@Backround\n\nwhen flag clicked\ngo to x: (0) y: (0)\nswitch costume to (costume1 v)\ngo to [front v] layer\ngo [backward v] (10) layers\nshow\n\nwhen I receive [message1 v]\nstop [other scripts in sprite v]\nhide\n\nwhen I receive [creeper!!!!! v]\nswitch costume to (costume2 v)\n\nwhen I receive [guy v]\nswitch costume to (costume1 v)\n\n@Play button\n\nwhen flag clicked\nshow\ngo to x: (0) y: (-69)\nset [dir v] to [0]\nforever\n    change [dir v] by (5)\n    point in direction ((([sin v] of (Dir) ) * (8)) + (90))\n    if <touching (mouse-pointer v)?> then\n        change size by (((120) - (size)) / (5))\n    else\n        change size by (((100) - (size)) / (5))\n    end\n    if <<mouse down?> and <touching (mouse-pointer v)?>> then\n        broadcast (message1 v)\n    end\nend\n\nwhen I receive [message1 v]\nstop [other scripts in sprite v]\nhide\n\nwhen I receive [swich v]\nwait (0.6) seconds\nhide\n\nwhen I receive [shop close v]\nshow\n\n@Title\n\nwhen flag clicked\nshow\ngo to x: (0) y: (128)\nset [dir v] to [0]\nwait (0.1) seconds\nforever\n    change [dir v] by (5)\n    if <(direction) > [90]> then\n        change size by (((125) - (size)) / (15))\n    else\n        change size by (((100) - (size)) / (15))\n    end\n    point in direction ((([sin v] of (Dir) ) * (15)) + (90))\nend\n\nwhen I receive [message1 v]\nstop [other scripts in sprite v]\nhide\n\n@⚙️\n\nwhen flag clicked\nshow\ngo to x: (210) y: (-73)\nset [dir v] to [0]\nforever\n    change [dir v] by (5)\n    point in direction ((([sin v] of (Dir) ) * (8)) + (90))\n    if <touching (mouse-pointer v)?> then\n        change size by (((120) - (size)) / (5))\n    else\n        change size by (((100) - (size)) / (5))\n    end\n    if <<mouse down?> and <touching (mouse-pointer v)?>> then\n        broadcast (Swich v)\n    end\nend\n\nwhen I receive [message1 v]\nstop [other scripts in sprite v]\nhide\n\nwhen I receive [swich v]\nhide\n\nwhen I receive [shop close v]\nshow\n\n@Done\n\nwhen flag clicked\nhide\ngo to x: (-130) y: (94)\nset [dir v] to [0]\nforever\n    change [dir v] by (5)\n    point in direction ((([sin v] of (Dir) ) * (8)) + (90))\n    if <touching (mouse-pointer v)?> then\n        change size by (((120) - (size)) / (5))\n    else\n        change size by (((100) - (size)) / (5))\n    end\n    if <<mouse down?> and <touching (mouse-pointer v)?>> then\n        broadcast (Shop close v)\n    end\n    go to [front v] layer\nend\n\nwhen I receive [message1 v]\nstop [other scripts in sprite v]\nhide\n\nwhen I receive [swich v]\nwait (1) seconds\nshow\n\nwhen I receive [shop close v]\nhide\n\n@Shop bg\n\nwhen flag clicked\ngo to x: (0) y: (-1000)\nhide\n\nwhen I receive [swich v]\nshow\nrepeat until <(y position) > [0]>\n    change y by (10)\nend\n\nwhen I receive [shop close v]\nrepeat until <(y position) < [-280]>\n    change y by (-10)\nend\nhide\n\n@?\n\nwhen flag clicked\nswitch costume to (costume1 v)\ngo to [front v] layer\nhide\n\nwhen I receive [message1 v]\nhide\n\nwhen I receive [shop close v]\nhide\n\nwhen I receive [swich v]\nwait (1) seconds\ngo to x: (-143) y: (18)\nshow\nforever\n    if <touching (mouse-pointer v)?> then\n        change size by (((120) - (size)) / (5))\n    else\n        change size by (((100) - (size)) / (5))\n    end\n    if <<mouse down?> and <touching (mouse-pointer v)?>> then\n        broadcast (Guy v)\n    end\nend\n\n@??\n\nwhen flag clicked\nswitch costume to (costume1 v)\ngo to [front v] layer\nhide\n\nwhen I receive [message1 v]\nhide\n\nwhen I receive [shop close v]\nhide\n\nwhen I receive [swich v]\nwait (1) seconds\ngo to x: (-65) y: (18)\nshow\nforever\n    if <touching (mouse-pointer v)?> then\n        change size by (((120) - (size)) / (5))\n    else\n        change size by (((100) - (size)) / (5))\n    end\n    if <<mouse down?> and <touching (mouse-pointer v)?>> then\n        broadcast (Creeper!!!!! v)\n    end\nend\n\n@Sprite1\n\nwhen I receive [creeper!!!!! v]\ngo to [front v] layer\ngo to (?? v)\nshow\n\nwhen I receive [guy v]\ngo to (? v)\nshow\n\nwhen I receive [shop close v]\nhide\n\nwhen I receive [swich v]\ngo to [front v] layer\nwait (1) seconds\nshow\n\nwhen flag clicked\ngo to [back v] layer\nhide\nhide\nhide\nrepeat (2)\n    hide\nend\n\n