The Midnight Valley // A scrolling platformer (Mobile Friendly) #all #games

Instructions:       Welcome to my second scrolling Platformer game \nControls\n- Arrow Keys or WASD to move or Mobile\n- Up Arrow To Jump ( You can Wall jump )\n- Dodge The Dangerous Things\n So Leave a ❤️ and ⭐ will be highly appreciated.\nSo Enjoy and Have Fun!!\nYou can Remix and Add More Levels and more!!\nThe First Button I s the Restart Button  You can Restart\nAnd the second button is the Skip button You can Skip A level. You just Have To Press them.\nGet To the blue portal To finish Each Level.\nRED= DANGER\nPurple=BOUNCY

@Stage\n\nwhen flag clicked\nforever\n    play sound [Tobu - Infectious \[NCS Release\] v] until done\nend\n\n@player\n\nwhen flag clicked\nswitch costume to (normal v)\nshow\ngo to [front v] layer\nset [xv v] to [0]\nset [yv v] to [0]\nforever\n    broadcast (Tick v)\nend\n\ndefine Tick\nset size to (75) %\nshow\nif <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <(mouse x) > (x position)>>> then\n    change [xv v] by (1)\nend\nif <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <(mouse x) < (x position)>>> then\n    change [xv v] by (-1)\nend\nchange x by (Xv)\nset [xv v] to ((Xv) * (0.9))\nif <<touching color (#00f01c)?> or <touching color (#aa8200)?>> then\n    change y by (1)\n    if <<touching color (#00f01c)?> or <touching color (#aa8200)?>> then\n        change y by (1)\n        if <<touching color (#00f01c)?> or <touching color (#aa8200)?>> then\n            change y by (1)\n            if <<touching color (#00f01c)?> or <touching color (#aa8200)?>> then\n                change y by (1)\n                if <<touching color (#00f01c)?> or <touching color (#aa8200)?>> then\n                    change y by (1)\n                    if <<touching color (#00f01c)?> or <touching color (#aa8200)?>> then\n                        change x by ((Xv) * (-1))\n                        change y by (-5)\n                        if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > (y position)>>> then\n                            if <(Xv) > [0]> then\n                                set [xv v] to [-10]\n                            else\n                                set [xv v] to [10]\n                            end\n                            set [yv v] to [15]\n                        else\n                            set [xv v] to [0]\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\nchange [yv v] by (-1)\nchange y by (Yv)\nif <<touching color (#00f01c)?> or <touching color (#aa8200)?>> then\n    change y by ((Yv) * (-1))\n    set [yv v] to [0]\nend\nchange y by (-1)\nif <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > (y position)>>> then\n    if <<touching color (#00f01c)?> or <touching color (#aa8200)?>> then\n        set [yv v] to [13]\n    end\nend\nchange y by (1)\nchange [scrollx v] by ((x position) * (-1))\nchange [scrolly v] by ((y position) * (-1))\ngo to x: (0) y: (0)\nif <<touching color (#ff0000)?> or <(ScrollY) > [700]>> then\n    set [scrollx v] to [0]\n    set [scrolly v] to [0]\n    start sound [Roblox Death Sound - OOF Sound Effect v]\nend\nif <touching color (#00ffff)?> then\n    broadcast (Next Level v) and wait\nend\nif <touching color (#7f00ff)?> then\n    set [yv v] to [25]\nend\n\nwhen I receive [tick v]\nTick\n\nwhen I receive [restart v]\nset [scrollx v] to [0]\nset [scrolly v] to [0]\n\nwhen flag clicked\nwait (1) seconds\nforever\n    if <key (1 v) pressed?> then\n        switch costume to (red v)\n    end\n    if <key (2 v) pressed?> then\n        switch costume to (orange v)\n    end\n    if <key (3 v) pressed?> then\n        switch costume to (yellow v)\n    end\n    if <key (4 v) pressed?> then\n        switch costume to (green v)\n    end\n    if <key (5 v) pressed?> then\n        switch costume to (dark blue v)\n    end\n    if <key (6 v) pressed?> then\n        switch costume to (purple v)\n    end\n    if <key (7 v) pressed?> then\n        switch costume to (pink v)\n    end\n    if <key (8 v) pressed?> then\n        switch costume to (white v)\n    end\n    if <key (9 v) pressed?> then\n        switch costume to (black v)\n    end\n    if <key (0 v) pressed?> then\n        switch costume to (cool bro v)\n    end\nend\n\nwhen [space v] key pressed\nswitch costume to (normal v)\n\n@level\n\nwhen flag clicked\nshow\nswitch costume to (blank v)\nset size to (300) %\nswitch costume to (level 1 v)\nPosition\nforever\n    go to x: (ScrollX) y: (ScrollY)\nend\n\nwhen I receive [next level v]\nPosition\nwait (0.1) seconds\nnext costume\n\ndefine Position\nset [scrollx v] to [0]\nset [scrolly v] to [0]\n\nwhen flag clicked\nforever\n    if <(costume [name v]) = [level 11]> then\n        broadcast (hide skipbutton v)\n    end\nend\n\n@thumbnail\n\nwhen flag clicked\nforever\n    go to [front v] layer\nend\n\nwhen flag clicked\ngo to x: (36) y: (28)\nset [ghost v] effect to (100)\n\n@restart\n\nwhen flag clicked\ngo to x: (-180) y: (137)\npoint in direction (90)\nshow\nforever\n    if <touching (mouse-pointer v)?> then\n        set [brightness v] effect to (25)\n    else\n        set [brightness v] effect to (0)\n    end\n    point in direction ((([sin v] of ((timer) * (300)) ) * (6)) + (90))\nend\n\nwhen flag clicked\nforever\n    if <<touching (mouse-pointer v)?> and <mouse down?>> then\n        broadcast (Restart v) and wait\n        wait (1) seconds\n    end\nend\n\n@skip\n\nwhen flag clicked\ngo to x: (-60) y: (137)\npoint in direction (90)\nshow\nforever\n    if <touching (mouse-pointer v)?> then\n        set [brightness v] effect to (25)\n    else\n        set [brightness v] effect to (0)\n    end\n    point in direction ((([sin v] of ((timer) * (300)) ) * (6)) + (90))\nend\n\nwhen flag clicked\nforever\n    if <<touching (mouse-pointer v)?> and <mouse down?>> then\n        broadcast (Next Level v) and wait\n        wait (1) seconds\n    end\nend\n\nwhen I receive [hide skipbutton v]\nhide\nstop [this script v]\n\n