Moon Platformer☻

Instructions: Arrow keys or mobile friendly.\n\nFlèches pour bouger

@Stage\n\nwhen flag clicked\nswitch backdrop to (ngc1502 v)\nwait (4) seconds\nswitch backdrop to (backdrop1 \(1\) v)\n\n@Sprite1\n\nwhen flag clicked\nhide\nwait (4) seconds\nshow\nforever\n    go to (player v)\nend\n\n@Danger\n\nwhen I receive [green flag v]\nhide\ngo to [back v] layer\ngo [forward v] (1) layers\n\nwhen I receive [tick v]\nPosition ((Danger: x) - (SCROLL X)) ((Danger: y) - (SCROLL Y))\n\nwhen I receive [setip v]\nset [danger: x v] to [0]\nset [danger: y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (level 1-2 v)\n    switch backdrop to (backdrop1 v)\n    Clone at x: [480] y: [0]\n    Clone at x: [480] y: [0]\n    Clone at x: [480] y: [0]\n    Clone at x: [480] y: [0]\n    Clone at x: [480] y: [0]\n    Clone at x: [480] y: [0]\n    Clone at x: [480] y: [0]\n    Clone at x: [480] y: [0]\n    Clone at x: [480] y: [0]\n    Clone at x: [480] y: [0]\n    Clone at x: [480] y: [0]\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 [danger: x v] by (x)\nchange [danger: y v] by (y)\nnext costume\n\n@Platforms\n\nwhen I receive [green flag v]\nhide\ngo to [front v] layer\n\nwhen I receive [tick v]\nPosition ((Platforms: x) - (SCROLL X)) ((Platforms: y) - (SCROLL Y))\n\nwhen I receive [setip v]\nhide\nset [platforms: x v] to [0]\nset [platforms: y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (level 1-1 v)\n    switch backdrop to (backdrop1 v)\n    Clone at x: [480] y: [0]\n    Clone at x: [480] y: [0]\n    Clone at x: [480] y: [0]\n    Clone at x: [480] y: [0]\n    Clone at x: [480] y: [0]\n    Clone at x: [480] y: [0]\n    Clone at x: [480] y: [0]\n    Clone at x: [480] y: [0]\n    Clone at x: [480] y: [0]\n    Clone at x: [480] y: [0]\n    Clone at x: [480] y: [0]\n    Clone at x: [480] y: [0]\n    Clone at x: [480] y: [0]\n    Clone at x: [480] y: [0]\n    Clone at x: [480] y: [0]\n    Clone at x: [480] y: [0]\n    Clone at x: [480] y: [0]\n    Clone at x: [480] y: [0]\n    Clone at x: [480] y: [0]\n    Clone at x: [480] y: [0]\n    Clone at x: [480] y: [0]\n    Clone at x: [480] y: [0]\n    Clone at x: [480] y: [0]\n    Clone at x: [480] y: [0]\n    Clone at x: [480] y: [0]\n    Clone at x: [480] y: [0]\n    Clone at x: [480] y: [0]\n    Clone at x: [480] y: [0]\n    Clone at x: [480] y: [0]\n    Clone at x: [480] y: [0]\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 [platforms: x v] by (x)\nchange [platforms: y v] by (y)\nnext costume\n\n@Player\n\nwhen flag clicked\nhide\nwait (4) seconds\nbroadcast (Green Flag v) and wait\nbroadcast (Play Game v) and wait\nshow\n\nwhen I receive [green flag v]\nhide\ngo to [front v] layer\n\ndefine Game on\nset [checkpoint v] to [0]\nif <(Checkpoint) = [0]> then\n    set [player: x v] to [-200]\n    set [player: y v] to [100]\nelse\n    if <(Checkpoint) = [1]> then\n        set [player: x v] to [1450]\n        set [player: y v] to [-20]\n    end\nend\nset [speed y v] to [0]\nset [speed x v] to [0]\nset [in air v] to [0]\nset [exit v] to []\nset [scroll x v] to [0]\nset [scroll y v] to [0]\nset size to (20) %\nclear graphic effects\nshow\n\ndefine Tick\nif <<key (left arrow v) pressed?> or <<mouse down?> and <(mouse x) > (x position)>>> then\n    change [speed x v] by (-3)\n    point in direction (-90)\nend\nif <<key (right arrow v) pressed?> or <<mouse down?> and <(mouse x) > (x position)>>> then\n    change [speed x v] by (3)\n    point in direction (90)\nend\nset [speed x v] to ((Speed x) * (0.8))\nif <([abs v] of (Speed x) ) > [0.9]> then\n    Change player x by (round (Speed x))\nend\nif <<key (up arrow v) pressed?> or <<mouse down?> and <(mouse y) > (y position)>>> then\n    if <(in air) < [4]> then\n        set [speed y v] to [16]\n    end\nend\nif <(Speed y) > [-20]> then\n    change [speed y v] by (-2)\nend\nChange player y by (Speed y)\nTest - Die\nset [scroll x v] to (Player: x)\nif <(SCROLL X) < [0]> then\n    set [scroll x v] to [0]\nend\nif <(SCROLL X) > [100000]> then\n    set [scroll x v] to [100000]\nend\nchange [scroll y v] by (round (((Player: y) - (SCROLL Y)) / (10)))\nif <(SCROLL Y) < [0]> then\n    set [scroll y v] to [0]\nend\nPosition\nif <(Player: y) < [-178]> then\n    set [exit v] to [Die]\nend\nif <touching (danger v)?> then\n    set [exit v] to [Die]\nend\n\ndefine Change player y by (sy)\nchange [player: y v] by (sy)\nchange [in air v] by (1)\nPosition\nrepeat until <not <touching (platforms v)?>>\n    if <(sy) > [0]> then\n        change [player: y v] by (-1)\n    else\n        change [player: y v] by (1)\n        set [in air v] to [0]\n    end\n    Position\n    set [speed y v] to [0]\nend\n\ndefine Position\ngo to x: ((Player: x) - (SCROLL X)) y: ((Player: y) - (SCROLL Y))\n\ndefine Change player x by (sx)\nchange [player: x v] by (sx)\nPosition\nif <touching (platforms v)?> then\n    repeat (12)\n        change [player: y v] by (1)\n        Position\n        if <not <touching (platforms v)?>> then\n            stop [this script v]\n        end\n    end\n    change [player: y v] by (-12)\n    if <<key (up arrow v) pressed?> or <<mouse down?> and <(mouse y) > (y position)>>> then\n        if <(sx) > [0]> then\n            set [speed x v] to [-16]\n        else\n            set [speed x v] to [16]\n        end\n        set [in air v] to [0]\n    else\n        set [speed x v] to [0]\n    end\n    repeat until <not <touching (platforms v)?>>\n        if <(sx) > [0]> then\n            change [player: x v] by (-1)\n        else\n            change [player: 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\n\ndefine Test - Die\n\ndefine Game - Win\nrepeat (50)\n    point towards (exit v)\n    turn right (65) degrees\n    move ((distance to [exit v]) / (2)) steps\n    change size by (0)\n    change [ghost v] effect by (2)\nend\nhide\nclear graphic effects\nchange [level v] by (1)\nwait (1) seconds\n\nwhen I receive [play game v]\nset [level v] to [1]\nforever\n    broadcast (Reset v) and wait\n    broadcast (Setip v) and wait\n    Game on\n    repeat until <(EXIT) > []>\n        Tick\n        broadcast (Tick v) and wait\n    end\nend\n\nhide\n\nwhen I start as a clone\nrepeat (10)\n    change size by (-2)\n    change [ghost v] effect by (5)\n    if <<key (right arrow v) pressed?> or <key (left arrow v) pressed?>> then\n        move (-4) steps\n    end\nend\ndelete this clone\n\nwhen flag clicked\n\nwhen flag clicked\nswitch costume to (player2 \(2\) v)\nforever\n    create clone of (_myself_ v)\nend\n\nwhen [space v] key pressed\nswitch costume to (player2 \(2\)2 v)\nchange [color v] effect by (25)\n\nhide\n\n@ej\n\nwhen flag clicked\nshow\npoint in direction (90)\nset size to (0) %\nrepeat (45)\n    change size by (3)\nend\nrepeat (48)\n    turn right (15) degrees\n    change [mosaic v] effect by (1)\nend\nforever\n    turn right (15) degrees\n    change [mosaic v] effect by (1)\n    change [ghost v] effect by (2)\n    change [pixelate v] effect by (2)\nend\n\nwhen [space v] key pressed\nhide\n\nwhen flag clicked\nwait (6) seconds\nstop [other scripts in sprite v]\nhide\n\nif <(x position) > [240]> then\n    next backdrop\n    go to x: (-230) y: (-142)\nend\nif <touching color (#00ffc0)?> then\n    set [f v] to [1]\nend\n\nwhen flag clicked\nforever\n    next costume\n    wait (0.5) seconds\nend\n\n