Night || A Scrolling Platformer
@Stage\n\n@Blank\n\n@Player\n\ndefine Tick\nif <key (left arrow v) pressed?> then\n    change [sx v] by (-2)\nend\nif <key (right arrow v) pressed?> 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 Player x by (round (sx))\nend\nif <key (up arrow v) pressed?> then\n    if <(in air) < [4]> then\n        set [sy v] to [16]\n    end\nend\nif <(sy) > [-20]> then\n    change [sy v] by (-2)\nend\nChange Player y 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)) / (7)))\nif <(SCROLL Y) < [0]> then\n    set [scroll y v] to [0]\nend\nif <(x) > [0]> then\n    set [scroll x v] to [0]\nend\nPosition\nif <(y) < [-180]> then\n    set [exit v] to [dieeeeeeeeeeeeeeeeeeeeeee]\nend\n\nwhen I receive [green flag v]\nhide\n\nwhen flag clicked\nshow variable [time v]\nshow variable [volume v]\nset [volume v] to [100]\nhide\nforever\n    set volume to (Volume) %\nend\n\nwhen I receive [play game v]\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    end\n    Game - Die\nend\n\ndefine Game On\nset [x v] to [0]\nset [y v] to [0]\nset [scroll x v] to [0]\nset [scroll y v] to [0]\nset [sx v] to [0]\nset [sy v] to [0]\nset [exit v] to []\nset [in air v] to [0]\nshow\n\ndefine Change Player y by (sy)\nchange [y v] by (sy)\nchange [in air v] by (1)\nPosition\nrepeat until <not <touching (platforms v)?>>\n    if <(sy) > [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 Position\ngo to x: ((x) - (SCROLL X)) y: ((y) - (SCROLL Y))\n\ndefine Change Player x by (sx)\nchange [x v] by (sx)\nPosition\nif <touching (platforms v)?> then\n    repeat (12)\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 (-12)\n    if <key (up arrow v) pressed?> then\n        if <(sx) > [0]> then\n            set [sx v] to [-16]\n        else\n            set [sx v] to [16]\n        end\n        set [in air v] to [0]\n    else\n        set [sx v] to [0]\n    end\n    repeat until <not <touching (platforms v)?>>\n        if <(sx) > [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 (5)\n    hide\n    wait (0.1) seconds\n    show\n    wait (0.1) seconds\nend\nhide\nwait (0.5) seconds\n\ndefine Test - Die\nif <touching (spikes v)?> then\n    set [exit v] to [dieeeeeeeeeeeeeeeeeeeeeee]\nend\n\nwhen I receive [start v]\nbroadcast (Green Flag v) and wait\nbroadcast (Play Game v) and wait\n\nwhen I receive [start v]\nforever\n    play sound [Upbeat_Background_Music_For_Videos_and_Presentations\[Youtubetomp3 v] until done\nend\n\nwhen I receive [start v]\nreset timer\nforever\n    set [time v] to (timer)\n    if <(SCROLL Y) > [4047]> then\n        broadcast (End v)\n        stop [other scripts in sprite v]\n        stop [this script v]\n    end\nend\n\nwhen flag clicked\nset [x v] to [0]\nset [y v] to [0]\nset [scroll x v] to [0]\nset [scroll y v] to [0]\nset [sx v] to [0]\nset [sy v] to [0]\nset [exit v] to []\nset [in air v] to [0]\nset [time v] to [0]\n\n@Platforms\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\nwhen I receive [setup v]\nhide\nset [x v] to [0]\nset [y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (platforms1 v)\n    Clone at x: [0] y: [480]\n    Clone at x: [0] y: [480]\n    Clone at x: [0] y: [480]\n    Clone at x: [0] y: [480]\n    Clone at x: [0] y: [480]\n    Clone at x: [0] y: [480]\n    Clone at x: [0] y: [480]\n    Clone at x: [0] y: [480]\n    Clone at x: [0] y: [480]\n    Clone at x: [0] y: [480]\nend\nset [x v] to [-99999]\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\n@Spikes\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\nwhen I receive [setup v]\nhide\nset [x v] to [0]\nset [y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (spikes1 v)\n    Clone at x: [0] y: [480]\n    Clone at x: [0] y: [480]\n    Clone at x: [0] y: [480]\n    Clone at x: [0] y: [480]\n    Clone at x: [0] y: [480]\n    Clone at x: [0] y: [480]\n    Clone at x: [0] y: [480]\n    Clone at x: [0] y: [480]\n    Clone at x: [0] y: [480]\nend\nset [x v] to [-99999]\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\n@End\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\nwhen I receive [setup v]\nhide\nset [x v] to [0]\nset [y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (platforms1 v)\n    Clone at x: [0] y: [480]\n    Clone at x: [0] y: [480]\n    Clone at x: [0] y: [480]\n    Clone at x: [0] y: [480]\n    Clone at x: [0] y: [480]\n    Clone at x: [0] y: [480]\n    Clone at x: [0] y: [480]\n    Clone at x: [0] y: [480]\n    Clone at x: [0] y: [480]\n    Clone at x: [0] y: [480]\nend\nset [x v] to [-99999]\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\n@High Score\n\nwhen flag clicked\nhide variable [☁ high score v]\nshow\nset [ghost v] effect to (100)\n\nwhen I receive [end v]\nhide variable [volume v]\nif <(TIME) < (☁ High Score)> then\n    hide variable [time v]\n    show variable [☁ high score v]\n    set [☁ high score v] to (TIME)\n    switch costume to (high score v)\nelse\n    switch costume to (not high score v)\n    show variable [☁ high score v]\nend\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\n\n@Logo\n\nwhen I receive [start v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\n\nwhen flag clicked\nshow\ngo to x: (0) y: (30)\npoint in direction (90)\nset [ghost v] effect to (0)\nset size to (0) %\nreset timer\nrepeat (20)\n    change [ghost v] effect by (-5)\n    turn right (18) degrees\n    change size by (7)\nend\nwait (2) seconds\nbroadcast (Start v)\n\nhide\nbroadcast (Start v)\n\n@Screen\n\nwhen I receive [start v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\n\nwhen flag clicked\nshow\ngo to x: (0) y: (0)\n\nhide\n\n@Name\n\nwhen I receive [start v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\n\nwhen flag clicked\nshow\nclear graphic effects\ngo to x: (-240) y: (-100)\nset size to (200) %\npoint in direction (90)\nrepeat (40)\n    move ((timer) * (9)) steps\nend\n\nhide\n\n@TN\n\nwhen flag clicked\ngo to x: (0) y: (0)\ngo to [front v] layer\nshow\nset [ghost v] effect to (100)\n\nhide\n\n
Welcome to the night world. In this game, you have to see how fast you can get to the top. Try beat the high score.\n\nControls:\nUse the arrow keys to move.