Scrolling Platformer                    ?mode=trending
@Stage\n\nwhen [space v] key pressed\n\nset [mouse v] to (join ((mouse x) + (scroll x)) (join [,  ] ((mouse y) + (scroll y))))\nshow variable [mouse v]\nwait (5) seconds\nhide variable [mouse v]\n\nwhen flag clicked\nhide variable [mouse v]\nset [mouse v] to []\n\nwhen I receive [flag v]\n\nwhen I receive [music start v]\nforever\n\n@Blank\n\n@player\n\nwhen flag clicked\nhide\nbroadcast (intro start v) and wait\n\nwhen I receive [flag v]\nhide\ngo to [front v] layer\n\nwhen I receive [play the game v]\nshow\nset [level v] to [1]\nforever\n    broadcast (reset v) and wait\n    broadcast (setup v) and wait\n    Game on\n    repeat until <(EXIT) > []>\n        Tick\n        broadcast (Tick v) and wait\n        broadcast (upndown v)\n    end\n    if <(EXIT) = [WIN]> then\n        Game - Win\n    else\n        Game - die\n    end\nend\n\ndefine Game on\nset [sx v] to [0]\nset [in air v] to [0]\nset [x v] to [-50]\nset [y v] to [0]\nset [sy v] to [0]\nset [exit v] to []\nset size to (100) %\nset [ghost v] effect to (0)\nshow\n\nset [deaths v] to [0]\n\ndefine Position\ngo to x: ((x) - (scroll x)) y: ((y) - (scroll y))\n\ndefine Tick\nif <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <(rightnleft) = [right]>> then\n    change [sx v] by (2)\nend\nif <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <(rightnleft) = [left]>> then\n    change [sx v] by (-2)\nend\nset [sx v] to ((sx) * (0.8))\nif <([abs v] of (sx) ) > [0.9]> then\n    Change x by (round (sx))\nend\nif <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <(jump) = [1]>> then\n    if <(in air) < [7]> then\n        set [sy v] to [14]\n    end\nend\nif <(sy) > [-18]> then\n    change [sy v] by (-2)\nend\nUp & Down by (sy)\nTest - Die\nset [scroll x v] to (x)\nif <(scroll x) < [0]> then\n    set [scroll x v] to [0]\nend\nchange [scroll y v] by (round (((y) - (scroll y)) / (10)))\nif <(scroll y) < [0]> then\n    set [scroll y v] to [0]\nend\nPosition\nif <(y) < [-300]> then\n    set [exit v] to [die]\nend\n\nChange x by [8]\n\ndefine Up & Down by (this)\nchange [y v] by (this)\nchange [in air v] by (1)\nPosition\nrepeat until <not <touching (platforms v)?>>\n    if <(this) > [0]> then\n        change [y v] by (-1)\n    else\n        change [y v] by (1)\n        set [in air v] to [0]\n    end\n    Position\n    set [sy v] to [0]\nend\n\ndefine Change x by (this2)\nchange [x v] by (this2)\nPosition\nif <touching (platforms v)?> then\n    repeat (8)\n        change [y v] by (1)\n        Position\n        if <not <touching (platforms v)?>> then\n            stop [this script v]\n        end\n    end\n    change [y v] by (-8)\n    repeat until <not <touching (platforms v)?>>\n        if <(this2) > [0]> then\n            change [x v] by (-1)\n        else\n            change [x v] by (1)\n        end\n        Position\n    end\nend\n\ndefine Game - die\nset [exit v] to []\nrepeat (3)\n    hide\n    wait (0.1) seconds\n    show\n    wait (0.1) seconds\n    hide\nend\nwait (0.5) seconds\nbroadcast (setup v) and wait\nchange [deaths v] by (1)\nset [x v] to [0]\nset [y v] to [0]\n\nrepeat (3)\n\nshow\n\ndefine Test - Die\nif <touching (red v)?> then\n    set [exit v] to [die]\nend\n\ndefine Game - Win\nset rotation style [don't rotate v]\nstart sound [Whiz v]\nrepeat (50)\n    point towards (exit v)\n    turn left (65) degrees\n    move ((distance to [exit v]) / (2)) steps\n    change size by (-1)\n    change [ghost v] effect by (2)\nend\nhide\nchange [level v] by (1)\nwait (1) seconds\nbroadcast (setup v) and wait\nbroadcast (reset v) and wait\nbroadcast (next level v)\n\nshow\nglide (1) secs to (random position v)\n\nrepeat until <touching (mouse-pointer v)?>\n\nglide (1) secs to x: (100) y: (50)\n\nbroadcast (Flag v) and wait\nbroadcast (Play the Game v) and wait\n\nwhen I receive [go v]\nforever\n    play sound [kevin_macleod_carefree_-5902357390034925961 v] until done\nend\n\n@platforms\n\nwhen I receive [flag v]\nset [scroll x v] to [0]\nshow\n\nwhen I receive [tick v]\nPosition ((x) - (scroll x)) ((y) - (scroll y))\n\nwhen I receive [setup v]\nhide\nset [y v] to [0]\nset [x v] to [0]\nif <(Level) = [1]> then\n    switch costume to (1 1 v)\n    Clone at X: [450] Y [0]\n    Clone at X: [450] Y [0]\n    Clone at X: [450] Y [0]\nelse\n    if <(Level) = [2]> then\n        switch costume to (2 1 v)\n        Clone at X: [450] Y [0]\n        Clone at X: [400] Y [-50]\n    else\n        if <(Level) = [3]> then\n            switch costume to (3 1 v)\n            Clone at X: [0] Y [25]\n            Clone at X: [0] Y [150]\n            Clone at X: [200] Y [150]\n            Clone at X: [300] Y [-50]\n        else\n            if <(Level) = [4]> then\n                switch costume to (4 1 v)\n                Clone at X: [0] Y [50]\n                Clone at X: [200] Y [150]\n                Clone at X: [0] Y [-200]\n            else\n                broadcast (FINISH v) and wait\n            end\n        end\n    end\nend\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Clone at X: (x) Y (y)\ncreate clone of (_myself_ v)\nchange [x v] by (x)\nchange [y v] by (y)\nnext costume\n\nClone at X: [600] Y [-450]\n\nClone at X: [200] Y [150]\ncreate clone of (_myself_ v)\nchange [x v] by (450)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (450)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (450)\n\n@COINS\n\nwhen I receive [flag v]\nset [scroll x v] to [0]\nshow\n\nwhen I receive [tick v]\nPosition ((x) - (scroll x)) ((y) - (scroll y))\nif <touching (player v)?> then\n    start sound [Coin v]\n    change [collected v] by (1)\n    if <(COLLECTED) = (COLLECTED MAX)> then\n        broadcast (OPEN v)\n    end\n    delete this clone\nend\n\nwhen I receive [setup v]\nswitch costume to (dot9 v)\nset size to (100) %\nhide\nset [collected v] to [0]\nset [collected max v] to [0]\nset [y v] to [0]\nset [x v] to [0]\nif <(Level) = [1]> then\n    switch costume to (dot v)\n    Clone at X: [200] Y [0]\n    Clone at X: [450] Y [0]\n    Clone at X: [1040] Y [52]\n    Clone at X: [1364] Y [24]\nelse\n    if <(Level) = [2]> then\n        switch costume to (dot v)\n        Clone at X: [213] Y [-10]\n        Clone at X: [491] Y [149]\n        Clone at X: [872] Y [-126]\n    else\n        if <(Level) = [3]> then\n            switch costume to (dot v)\n            Clone at X: [-180] Y [-90]\n            Clone at X: [-225] Y [335]\n            Clone at X: [286] Y [529]\n            Clone at X: [300] Y [285]\n        else\n            if <(Level) = [4]> then\n                switch costume to (dot v)\n                Clone at X: [-194] Y [50]\n                Clone at X: [29] Y [206]\n                Clone at X: [222] Y [115]\n                Clone at X: [539] Y [83]\n            end\n        end\n    end\nend\nset [x v] to [-999999]\n\ncreate clone of (_myself_ v)\nchange [x v] by (450)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (450)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (450)\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Clone at X: (x) Y (y)\nset [x v] to (x)\nset [y v] to (y)\nchange [collected max v] by (1)\ncreate clone of (_myself_ v)\n\nchange [x v] by (450)\nchange [y v] by (450)\n\nrepeat (3)\n    change [scroll y v] by (1)\nend\nrepeat (3)\n    change [scroll y v] by (-1)\nend\n\nchange y by (3)\nchange y by (-3)\n\nwhen I receive [tick v]\n\nchange y by (3)\n\nchange y by (-3)\n\nrepeat (3)\n    change size by (10)\nend\nrepeat (3)\n    change size by (-10)\nend\n\nrepeat ((costume [number v]) - (1))\n    next costume\nend\n\nwait (0.001) seconds\n\nrepeat (8)\n\nnext costume\n\nswitch costume to (dot9 v)\n\nchange size by (-10)\nchange size by (10)\n\nchange [brightness v] effect by (0.001)\n\n\nset [fisheye v] effect to (0)\n\nset [whirl v] effect to (0)\n\nturn right (10) degrees\n\nClone at X: [213] Y [-10]\nClone at X: [491] Y [149]\nClone at X: [872] Y [-126]\n\n@RED\n\nwhen I receive [flag v]\nset [scroll x v] to [0]\nshow\n\nwhen I receive [tick v]\nPosition ((x) - (scroll x)) ((y) - (scroll y))\n\nwhen I receive [setup v]\nhide\nset [y v] to [0]\nset [x v] to [0]\nif <(Level) = [1]> then\n    switch costume to (1 1 v)\n    Clone at X: [450] Y [0]\n    Clone at X: [450] Y [0]\n    Clone at X: [450] Y [0]\nelse\n    if <(Level) = [2]> then\n        switch costume to (2 1 v)\n        Clone at X: [450] Y [0]\n        Clone at X: [450] Y [0]\n        Clone at X: [450] Y [0]\n    else\n        if <(Level) = [3]> then\n            switch costume to (3 1 v)\n            Clone at X: [0] Y [25]\n            Clone at X: [0] Y [150]\n            Clone at X: [200] Y [150]\n            Clone at X: [300] Y [-50]\n        else\n            if <(Level) = [4]> then\n                switch costume to (4 1 v)\n                Clone at X: [0] Y [50]\n                Clone at X: [200] Y [150]\n                Clone at X: [0] Y [-200]\n            end\n        end\n    end\nend\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Clone at X: (x) Y (y)\ncreate clone of (_myself_ v)\nchange [x v] by (x)\nchange [y v] by (y)\nnext costume\n\ncreate clone of (_myself_ v)\nchange [x v] by (450)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (450)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (450)\n\nClone at X: [600] Y [-450]\n\nClone at X: [0] Y [25]\nClone at X: [0] Y [150]\nClone at X: [200] Y [150]\nClone at X: [300] Y [-50]\n\nif <(Level) = [4]> then\n    switch costume to (4 1 v)\nend\n\n@exit\n\nwhen I receive [flag v]\nset [scroll x v] to [0]\nshow\n\nwhen I receive [tick v]\nPosition ((x) - (scroll x)) ((y) - (scroll y))\nif <<(COLLECTED) = (COLLECTED MAX)> and <touching (player v)?>> then\n    set [exit v] to [WIN]\nend\n\nwhen I receive [setup v]\nhide\nswitch costume to (closed v)\nset [collected v] to [0]\nset [y v] to []\nset [x v] to []\nif <(Level) = [1]> then\n    Clone at X: [1597] Y [-30]\nelse\n    if <(Level) = [2]> then\n        Clone at X: [1073] Y [-74]\n    else\n        if <(Level) = [3]> then\n            Clone at X: [430] Y [90]\n        else\n            if <(Level) = [4]> then\n                Clone at X: [400] Y [0]\n            else\n                hide\n            end\n        end\n    end\nend\n\ncreate clone of (_myself_ v)\nchange [x v] by (450)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (450)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (450)\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Clone at X: (x) Y (y)\nset [x v] to (x)\nset [y v] to (y)\ncreate clone of (_myself_ v)\n\nClone at X: [1040] Y [52]\nClone at X: [1364] Y [24]\nClone at X: [1364] Y [24]\n\nset [x v] to [-999999]\n\nwhen I receive [open v]\nswitch costume to (open v)\n\nwhen I receive [next level v]\nswitch costume to (closed v)\n\nchange [y v] by (450)\n\nrepeat (3)\n    change [y v] by (3)\n    change [scroll y v] by (3)\nend\nwait (0.2) seconds\nrepeat (3)\n    change [y v] by (-3)\n    change [scroll y v] by (-3)\nend\nwait (0.2) seconds\n\nwhen I receive [tick v]\n\nturn right (1) degrees\n\nwhen I receive [flag v]\nset size to (60) %\n\n\n\nClone at X: [430] Y [90]\n\nset size to (60) %\n\nif <(Level) = [3]> then\n    set size to (60) %\nelse\n    set size to (100) %\nend\n\n@Sprite2\n\nwhen I receive [finish v]\nshow\nshow variable [deaths v]\nshow variable [time v]\nhide variable [collected v]\nhide variable [level v]\nset [time v] to (round (timer))\nforever\n    play sound [Kevin MacLeod Pixel Peeker Polka - faster \(1\) v] until done\n    repeat (3)\n        change size by (10)\n    end\n    repeat (3)\n        change size by (-10)\n    end\nend\n\nwhen flag clicked\nset [deaths v] to [0]\nshow variable [level v]\nshow variable [collected v]\nhide variable [deaths v]\nhide variable [time v]\nset size to (130) %\nhide\n\nwhen I receive [flag v]\n\nforever\n\nwhen I receive [music start v]\nforever\n\nif <[] = [0]> then\nif <[] > [50]> then\n\nbroadcast (FINISH v)\n\n@Sprite1\n\nwhen I receive [intro start v]\nshow\n\nwhen I receive [flag v]\nhide\n\ngo [forward v] (100) layers\n\n@Sprite3\n\nwhen I receive [intro start v]\ngo [forward v] (10000) layers\nshow\nset size to (100) %\npoint in direction (90)\ngo to x: (-240) y: (0)\nrepeat (48)\n    change x by (5)\n    turn right (7.5) degrees\nend\nwait (0.2) seconds\nrepeat (3)\n    change size by (10)\nend\nrepeat (3)\n    change size by (-10)\nend\nwait (0.2) seconds\nrepeat (48)\n    change x by (-5)\n    turn left (7.5) degrees\nend\nhide\nbroadcast (Flag v) and wait\nbroadcast (Play the Game v) and wait\nbroadcast (music start v)\nbroadcast (go v)\n\nstop [this script v]\n\n@Sprite4\n\nwhen flag clicked\nset [rightnleft v] to []\n\n    set [mobile hit v] to [0]\n    if <<touching (mouse-pointer v)?> and <mouse down?>> then\n        set [rightnleft v] to [right]\n        set [mobile hit v] to [1]\n    else\n        if <not <(mobile hit) = [1]>> then\n            set [rightnleft v] to []\n            set [rightnleft v] to []\n        end\n    end\nend\n\nwhen this sprite clicked\n\n@Sprite5\n\nwhen flag clicked\n\n    if <<touching (mouse-pointer v)?> and <mouse down?>> then\n        set [jump v] to [1]\n    else\n        set [jump v] to [0]\n    end\nend\n\nwhen this sprite clicked\n\nset [upndown v] to [up]\nset [upndown v] to []\n\nset [mobile hit v] to [1]\n\nset [mobile hit v] to []\n\nif <not <(mobile hit) = [1]>> then\nend\n\n@Sprite6\n\nwhen flag clicked\n\n    if <<touching (mouse-pointer v)?> and <mouse down?>> then\n        set [rightnleft v] to [left]\n        set [mobile hit v] to [1]\n    else\n        if <not <(mobile hit) = [1]>> then\n            set [rightnleft v] to []\n        end\n    end\nend\n\nwhen this sprite clicked\n\n@Sprite7\n\nwhen flag clicked\nhide\nforever\n    set [timer2 v] to (timer)\nend\n\nwhen [timer v] > ((timer2) + (0.01))\nshow\ngo to x: (0) y: (150)\ngo to [front v] layer\nrepeat (10)\n    set y to ((y position) / (2))\nend\nforever\n    set y to (([sin v] of ((timer) * (200)) ) * (7))\nend\n\n
https://scratch.mit.edu/projects/512357369\nI've Finished this now! I spent yesterday Searching for music and trying to add Music but it wouldn't let me. I'll add music soon enough.\nOk, arrow keys or WASD to move. Avoid the bottom and Red. Get to the portal to Proceed. Hold Up Arrow/W to Jump higher. The portal Won't open until  \n you Collect all the coins. There is only 4 Levels, so I tried to make it tricky. Also, the Dying animation is about 1 1/2 seconds, so it may effect your Overall time! \nPLEASE CONSIDER THAT I WORKED MORE THAN 10 HOURS ON THIS OVER 2 WEEKS AND THAT HALF WAY THROUGH IT ALL DELETED AND LEAVE A HEART AND FAVE THANK YOU SO MUCH!!!!?\n2300 (done)\n3000 (not done)\n3500 (not done)\n4000 (not done)\n5000 (not done) \n10000000000000000000000000000 (not done)\n\nMobile version: https://scratch.mit.edu/projects/706782100\n(Credits to @CO112010)\n\n-@DadiDab\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nComment: "7+4=3 so this is good"