Moonlight || A Platformer || Contest Entry ||

Instructions: Get it? Cyber-MOONLIGHT-303?? XD why did no one tell me i didnt add music? •-•\nI actually like the art here.. woohoo 1st place!\nAnyway….\nAll levels possible? ✓\nMoving platforms ✓\nWall jumping ✘\nLava and saws ✓\nKey for hiding platforms ✓\nA player ✓\nArrow keys and WASD to move ✓\nMobile controls ✘\nA parallax background ✓\nGo to the edge of the screen to go to the next level ✓\nGet to the portal at the end of the game to win ✓\nA great game that I think is my best ✘\nShooting stars that grant your wishes ✘\nNormal shooting stars ✓\nThas it

@Stage\n\nwhen flag clicked\nset volume to (pick random (50) to (100)) %\nforever\n    play sound [World 2 v] until done\nend\n\n@Art\n\nwhen flag clicked\nswitch costume to (costume1 v)\nforever\n    go to [front v] layer\n    set [level v] to (costume [number v])\nend\n\nwhen I receive [next level v]\nnext costume\n\n@Player\n\nwhen flag clicked\nbroadcast (Green Flag clicked v)\n\nwhen I receive [green flag clicked v]\nReset Level\nforever\n    switch costume to (hitbox v)\n    Controls - Jump, Crouch\n    Gravity\n    Check Hit Ceiling / Floor <(speed y) > [0]>\n    if <(y position) < [-189]> then\n        Reset Level\n    end\n    if <(wall jump) > [0]> then\n        change [wall jump v] by (-1)\n    else\n        Controls - Left and Right\n    end\n    if <(speed x) < [-0.5]> then\n        Walk (-90) (speed x) max steep (([ceiling v] of ([abs v] of ((speed x) * (1.3)) ) ) + (1))\n    else\n        if <(speed x) > [0.5]> then\n            Walk (90) (speed x) max steep (([ceiling v] of ([abs v] of ((speed x) * (1.3)) ) ) + (1))\n        else\n            set [frame v] to [0]\n        end\n    end\n    Set Costume\n    broadcast (tick v) and wait\n    go to [front v] layer\nend\n\ndefine Controls - Left and Right\nset [speed x v] to ((speed x) * (0.8))\nif <<key (a v) pressed?> or <key (left arrow v) pressed?>> then\n    change [speed x v] by (-1.5)\nend\nif <<key (d v) pressed?> or <key (right arrow v) pressed?>> then\n    change [speed x v] by (1.5)\nend\n\ndefine Walk (direction) (speed) max steep (max steep)\npoint in direction (direction)\nchange x by (speed)\nchange [frame v] by (([abs v] of (speed) ) / (8))\nset [slope v] to [0]\nGet Touching <(in platforrm) = [1]>\nrepeat until <<(slope) = (max steep)> or <(touch) = [0]>>\n    change y by (1)\n    change [slope v] by (1)\n    Get Touching <(in platforrm) = [1]>\nend\nif <(slope) = (max steep)> then\n    change x by ((0) - (speed))\n    change y by ((0) - (slope))\n    if <<(touch) = [1]> and <(in platforrm) = [1]>> then\n        set [in platforrm v] to [2]\n        Walk (direction) (speed) max steep (max steep)\n        if <(speed x) = [0]> then\n            set [in platforrm v] to [1]\n        end\n    else\n        if <<<key (w v) pressed?> and <([abs v] of (speed) ) > [3.5]>> and <(touch) > [1]>> then\n            set [speed x v] to ((-1.2) * (speed))\n            set [speed y v] to [11]\n            set [falling? v] to [6]\n            set [wall jump v] to [15]\n        else\n            set [speed x v] to [0]\n        end\n    end\nend\n\ndefine Controls - Jump, Crouch\nif <<key (w v) pressed?> or <key (up arrow v) pressed?>> then\n    if <<(jump key) = [0]> and <(falling?) < [3]>> then\n        set [speed y v] to [14]\n        set [falling? v] to [6]\n        set [jump key v] to [1]\n    end\nelse\n    set [jump key v] to [0]\nend\nif <<key (s v) pressed?> or <key (down arrow v) pressed?>> then\n    set [in platforrm v] to [2]\nend\n\ndefine Gravity\nif <<(speed y) < [4]> or <<key (w v) pressed?> or <key (up arrow v) pressed?>>> then\n    change [speed y v] by (-1)\nelse\n    change [speed y v] by (-2)\nend\nchange y by (speed y)\nchange [falling? v] by (1)\n\ndefine Check Hit Ceiling / Floor <up?>\nGet Touching \nif <(touch) = [0]> then\n    set [in platforrm v] to [1]\nelse\n    if <<up?> and <(touch) = [1]>> then\n        set [in platforrm v] to [2]\n    end\nend\nrepeat until <(touch) < (in platforrm)>\n    if <up?> then\n        change y by (-1)\n    else\n        change y by (1)\n        set [falling? v] to [0]\n    end\n    Get Touching <not <up?>>\n    set [speed y v] to [0]\nend\n\ndefine Get Touching <check platform?>\nif <<<touching (ground v)?> or <touching (hidden v)?>> or <touching (moving v)?>> then\n    set [touch v] to [9]\nelse\n    if <<check platform?> and <touching (platforms v)?>> then\n        set [touch v] to [1]\n    else\n        set [touch v] to [0]\n    end\nend\n\ndefine Reset Level\nset size to (35) %\nset rotation style [left-right v]\ngo to x: (-215) y: (0)\nreset timer\nshow\nset [speed x v] to [0]\nset [speed y v] to [0]\nset [falling? v] to [10]\nset [in platforrm v] to [1]\nset [frame v] to [0]\nset [wall jump v] to [0]\n\ndefine Set Costume\nif <(falling?) < [6]> then\n    if <(frame) = [0]> then\n        switch costume to (stand_1 v)\n    else\n        switch costume to ([floor v] of ((4) + ((frame) mod (8))) )\n    end\nelse\n    if <(speed y) > [0]> then\n        switch costume to (jump_1 v)\n    else\n        switch costume to (fall_1 v)\n    end\nend\n\nwhen I receive [green flag clicked v]\nforever\n    if <<(costume [number v]) = [1]> and <touching (ground v)?>> then\n        broadcast (Dirt puff v) and wait\n    end\n    if <<touching (saws v)?> or <touching (lava v)?>> then\n        Reset Level\n        broadcast (Death v)\n    end\n    if <<(x position) > [239]> and <touching (_edge_ v)?>> then\n        broadcast (Next level v)\n    end\nend\n\nwhen I receive [next level v]\nReset Level\n\nwhen I receive [green flag clicked v]\nforever\n    if <touching (moving v)?> then\n        set x to (round ([x position v] of [moving v]))\n    end\nend\n\nwhen I receive [yay! v]\nReset Level\nhide\n\n@Lava\n\nwhen flag clicked\nhide\nforever\n    go to [back v] layer\n    set [ghost v] effect to (20)\n    go to x: (0) y: (0)\n    repeat (25)\n        change y by (-0.5)\n        change [ghost v] effect by (-0.5)\n    end\n    repeat (25)\n        change y by (0.5)\n        change [ghost v] effect by (0.5)\n    end\nend\n\nwhen I receive [create v]\nHide/show level: [3]\nHide/show level: [4]\nHide/show level: [5]\nHide/show level: [8]\nHide/show level: [9]\nHide/show level: [12]\n\ndefine Hide/show level: (lvl)\nif <(lvl) = (Level)> then\n    show\nend\n\nwhen I receive [death v]\nbroadcast (Create v)\ndelete this clone\n\nwhen I receive [next level v]\nhide\n\n@Ground\n\nwhen flag clicked\nforever\n    switch costume to (Level)\nend\n\n@Key\n\nwhen flag clicked\nhide\nforever\n    set size to (5) %\n    if <touching (player v)?> then\n        repeat (5)\n            set [key v] to [Yes]\n            change [ghost v] effect by (20)\n        end\n        hide\n    end\nend\n\ndefine Show level: (lvl) Go to x: (x) y: (y)\nclear graphic effects\nif <(lvl) = (Level)> then\n    show\n    go to x: (x) y: (y)\nend\n\nwhen I receive [create v]\nset [key v] to []\nhide\nShow level: [6] Go to x: [-140] y: [123]\nShow level: [7] Go to x: [-228] y: [105]\nShow level: [8] Go to x: [-50] y: [-30]\n\n@Hidden\n\nwhen flag clicked\nforever\n    if <(Key) = [Yes]> then\n        hide\n    else\n        show\n    end\n    switch costume to (Level)\nend\n\n@Moving\n\ndefine Glide to: x: (x) y: (y) Speed: (speed) Level (lvl) To x: (to x) To y: (to y)\ngo to x: (x) y: (y)\nif <(lvl) = (Level)> then\n    repeat until <not <(lvl) = (Level)>>\n        show\n        glide (speed) secs to x: (x) y: (y)\n        glide (speed) secs to x: (to x) y: (to y)\n    end\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [create v]\nhide\nGlide to: x: [-78] y: [-97] Speed: [2] Level [9] To x: [123] To y: [-97]\nGlide to: x: [9] y: [-100] Speed: [2] Level [10] To x: [9] To y: [50]\n\n@Shooting stars\n\nwhen flag clicked\nforever\n    Star\n    hide\n    wait (pick random (1) to (5)) seconds\nend\n\ndefine Star\ngo to x: (pick random (-150) to (150)) y: (150)\nset size to (5) %\npoint in direction (pick random (-360) to (360))\nrepeat until <<<touching color (#449a9a)?> or <touching (ground v)?>> or <touching (_edge_ v)?>>\n    go to [back v] layer\n    go [backward v] (10000000000000000000000000000000) layers\n    move (2) steps\n    go to [back v] layer\n    create clone of (_myself_ v)\n    go to [back v] layer\nend\nhide\n\nwhen I start as a clone\nshow\nrepeat (50)\n    change [ghost v] effect by (2)\n    change size by (-20)\n    go [backward v] (1000000000000000000000000000000000) layers\n    move (pick random (0) to (0.5)) steps\nend\ndelete this clone\n\n@Sprite1\n\nwhen flag clicked\nforever\n    go to x: (([x position v] of [player v]) / (-10)) y: (([y position v] of [player v]) / (10))\n    go to [back v] layer\n    go [backward v] (500000) layers\n    point in direction (90)\nend\n\n@Saws\n\ndefine Clone at x: (x) y: (y) Level: (lvl)\nhide\nif <(lvl) = (Level)> then\n    go to x: (x) y: (y)\n    create clone of (_myself_ v)\nend\n\nwhen I receive [create v]\nClone at x: [-74] y: [-128] Level: [1]\nClone at x: [-115] y: [-145] Level: [2]\nClone at x: [120] y: [-112] Level: [2]\nClone at x: [97] y: [3] Level: [4]\nClone at x: [-80] y: [-58] Level: [5]\nClone at x: [-8] y: [-162] Level: [6]\nClone at x: [-108] y: [-25] Level: [6]\nClone at x: [180] y: [-130] Level: [6]\nClone at x: [-190] y: [55] Level: [7]\nClone at x: [-8] y: [-118] Level: [7]\nClone at x: [101] y: [47] Level: [7]\nClone at x: [-135] y: [-50] Level: [7]\nClone at x: [-74] y: [-128] Level: [10]\nClone at x: [98] y: [-97] Level: [10]\nClone at x: [98] y: [-27] Level: [10]\nClone at x: [165] y: [90] Level: [10]\nClone at x: [-92] y: [-140] Level: [11]\nClone at x: [30] y: [-118] Level: [11]\nClone at x: [145] y: [-122] Level: [11]\n\nwhen I start as a clone\ngo to [front v] layer\ngo [forward v] (4) layers\nshow\nforever\n    go to [front v] layer\n    go [forward v] (3) layers\n    turn right (6) degrees\n    set size to (50) %\n    go [forward v] (1) layers\nend\n\nwhen flag clicked\nbroadcast (Create v)\nhide\n\nwhen I receive [next level v]\ndelete this clone\n\nwhen I receive [next level v]\nwait (0.02) seconds\nbroadcast (Create v)\n\nwhen I receive [death v]\nbroadcast (Create v)\ndelete this clone\n\nwhen I receive [create v]\ndelete this clone\n\n@Portal\n\nwhen flag clicked\nhide\n\nwhen I start as a clone\nforever\n    turn left (5) degrees\n    set size to (50) %\n    go to [front v] layer\nend\n\nwhen I receive [create v]\nhide\nHide/show lvl: [13]\n\ndefine Hide/show lvl: (level)\nif <(level) = (Level)> then\n    show\n    go to x: (85) y: (-128)\n    set [ghost v] effect to (50)\n    create clone of (_myself_ v)\n    forever\n        set size to (50) %\n        turn right (5) degrees\n        go to [front v] layer\n    end\nend\n\nwhen flag clicked\nforever\n    if <touching (player v)?> then\n        broadcast (YAY! v)\n    end\nend\n\n@Sprite2\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\n\nwhen I receive [yay! v]\nif <(username) = [Cybermoonlight303]> then\n    switch costume to (costume2 v)\nelse\n    switch costume to (costume1 v)\nend\nshow\nset [ghost v] effect to (100)\nrepeat (50)\n    go to x: (pick random (-30) to (30)) y: (pick random (-30) to (30))\n    change [ghost v] effect by (-2)\nend\ngo to x: (0) y: (0)\nwait (3) seconds\nstop [all v]\n\n@Sprite3\n\nwhen flag clicked\nhide\nforever\n    reset timer\nend\n\nwhen [timer v] > (0.1)\nset [ghost v] effect to (100)\nshow\nrepeat (100)\n    change [ghost v] effect by (-1)\n    go to [front v] layer\nend\n\n