Night Platformer       

Instructions:                           Night platformer\n                       Pique-----------Mourir\n              Trampoline---- Sauter en hauteur\n               Flèche jaune--Sauter super haut\n                     Flèche haut ^ ----Sauter\n                  Flèche droite >--- Avancer\n                 Flèche gauche <--- Reculer

@Stage\n\nforever\n    set volume to (100) %\nend\n\nwhen flag clicked\n\nwhen I receive [music v]\nforever\n    play sound [Nebula v] until done\nend\n\n@Sprite1\n\nwhen I receive [start v]\ngo to [front v] layer\n\nwhen I receive [start v]\nwait (0.5) seconds\nforever\n    player movement\nend\n\nwhen flag clicked\ngo to x: (-209) y: (-56)\nset [level v] to [1]\npoint in direction (90)\nset [y spawn v] to [-206]\nset [x spawn v] to [-218]\ngo to x: (X Spawn) y: (Y Spawn)\nshow\nset size to (20) %\nset [movement x v] to [0]\nset [movement y v] to [0]\n\nwhen flag clicked\nwait (1) seconds\nchange [level v] by (1)\nswitch costume to (costume1 v)\npoint in direction (90)\nset [movement x v] to [0]\nset [movement y v] to [0]\ngo to x: (-206) y: (-52)\n\nwhen flag clicked\nwait (1) seconds\nchange [level v] by (1)\nswitch costume to (costume1 v)\npoint in direction (90)\nset [movement x v] to [0]\nset [movement y v] to [0]\ngo to x: (-206) y: (-52)\n\nwhen flag clicked\nwait (1) seconds\nchange [level v] by (1)\nswitch costume to (costume1 v)\npoint in direction (90)\nset [movement x v] to [0]\nset [movement y v] to [0]\ngo to x: (-206) y: (-52)\n\nif <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <(mouse x) < (x position)>>> then\nif <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <(x position) < (mouse x)>>> then\n    point in direction (90)\n    change [movement x v] by (.7)\nend\nset [movement x v] to ((Movement X) * (0.9))\nchange x by (Movement X)\nif <touching (level v)?> then\n    change y by (1)\n    if <touching (level v)?> then\n        change y by (1)\n        if <touching (level v)?> then\n            change y by (1)\n            if <touching (level v)?> then\n                change y by (1)\n                if <touching (level v)?> then\n                    change y by (1)\n                    if <touching (level v)?> then\n                        change y by (1)\n                        if <touching (level v)?> then\n                            change y by (-6)\n                            change x by ((Movement X) * (-1))\n                            if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(y position) < (mouse y)>>> then\n                                set [movement y v] to [8]\n                                if <(Movement X) > [0]> then\n                                    set [movement x v] to [-8]\n                                else\n                                    set [movement x v] to [8]\n                                end\n                            else\n                                set [movement x v] to [0]\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\nchange y by (Movement Y)\nif <touching (level v)?> then\n    change y by ((Movement Y) * (-1))\n    set [movement y v] to <<(x position) = [200]> or <(x position) > [200]>>\nend\nchange y by (-0.5)\nif <<<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(y position) < (mouse y)>>> and <touching (level v)?>> then\n    set [movement y v] to [8]\nend\nchange y by (0.5)\nif <<touching (spikes v)?> or <(y position) < [-180]>> then\n    start sound [Bonk v]\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\n    set [movement x v] to [0]\n    set [movement y v] to [0]\n    go to x: (-209) y: (50)\n    point in direction (90)\n    repeat (10)\n        change [ghost v] effect by (-10)\n    end\nend\nif <touching (bouncy stuff v)?> then\n    set [movement y v] to [13]\nend\nif <<(x position) = [210]> or <(x position) > [210]>> then\n    broadcast (next level v)\n    go to x: (-206) y: (-88)\nend\nif <touching (speed v)?> then\n    change [movement x v] by (18)\n    change [movement y v] by (14)\nend\n\ndefine player movement\nforever\n    change [movement y v] by (-0.5)\n    if <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <(mouse x) < (x position)>>> then\n        set rotation style [left-right v]\n        point in direction (-90)\n        change [movement x v] by (-.7)\n    end\n    if <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <(x position) < (mouse x)>>> then\n        point in direction (90)\n        change [movement x v] by (.7)\n    end\n    set [movement x v] to ((Movement X) * (0.9))\n    change x by (Movement X)\n    if <touching (level v)?> then\n        change y by (1)\n        if <touching (level v)?> then\n            change y by (1)\n            if <touching (level v)?> then\n                change y by (1)\n                if <touching (level v)?> then\n                    change y by (1)\n                    if <touching (level v)?> then\n                        change y by (1)\n                        if <touching (level v)?> then\n                            change y by (1)\n                            if <touching (level v)?> then\n                                change y by (-6)\n                                change x by ((Movement X) * (-1))\n                                if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(y position) < (mouse y)>>> then\n                                    set [movement y v] to [8]\n                                    if <(Movement X) > [0]> then\n                                        set [movement x v] to [-8]\n                                    else\n                                        set [movement x v] to [8]\n                                    end\n                                else\n                                    set [movement x v] to [0]\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change y by (Movement Y)\n    if <touching (level v)?> then\n        change y by ((Movement Y) * (-1))\n        set [movement y v] to <<(x position) = [200]> or <(x position) > [200]>>\n    end\n    change y by (-0.5)\n    if <<<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(y position) < (mouse y)>>> and <touching (level v)?>> then\n        set [movement y v] to [8]\n    end\n    change y by (0.5)\n    if <<touching (spikes v)?> or <(y position) < [-180]>> then\n        start sound [Bonk v]\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n        set [movement x v] to [0]\n        set [movement y v] to [0]\n        go to x: (-209) y: (50)\n        point in direction (90)\n        repeat (10)\n            change [ghost v] effect by (-10)\n        end\n    end\n    if <touching (bouncy stuff v)?> then\n        set [movement y v] to [13]\n    end\n    if <<(x position) = [210]> or <(x position) > [210]>> then\n        broadcast (next level v)\n        go to x: (-206) y: (-88)\n    end\n    if <touching (speed v)?> then\n        change [movement x v] by (18)\n        change [movement y v] by (14)\n    end\nend\n\nswitch costume to (1 v)\nforever\n    create clone of (_myself_ v)\nend\n\nwhen I receive [next level v]\nset [movement x v] to [0]\nset [movement y v] to [0]\ngo to x: (-209) y: (50)\npoint in direction (90)\n\nwhen I receive [replay v]\nset [movement x v] to [0]\nset [movement y v] to [0]\ngo to x: (-209) y: (50)\npoint in direction (90)\n\nwhen flag clicked\ngo to x: (-209) y: (-36)\nhide\n\nwhen I receive [start v]\ngo to x: (-209) y: (50)\nwait (0.5) seconds\nshow\n\nwhen I receive [start v]\ngo to [front v] layer\n\nwhen flag clicked\nwait (10) seconds\nforever\n    play sound [Julius Dreisig & Zeus X Crona - Invisible \[NCS Release\] v] until done\nend\n\n@level\n\nwhen I receive [next level v]\nnext costume\n\nwhen flag clicked\ngo to x: (0) y: (-20)\nswitch costume to (1 v)\n\nwhen flag clicked\nhide\nwait (9) seconds\nshow\n\nwhen flag clicked\nforever\n    if <(costume [number v]) = [10]> then\n        broadcast (end. v)\n    end\nend\n\n@Intro 1\n\nwhen flag clicked\nset size to (100) %\npoint in direction (90)\nclear graphic effects\nhide\nstart sound [Experiment2 v]\nswitch costume to (logo v)\ncreate clone of (_myself_ v)\nswitch costume to (intro2 v)\ncreate clone of (_myself_ v)\nswitch costume to (intro3 v)\ncreate clone of (_myself_ v)\nswitch costume to (intro4 v)\ncreate clone of (_myself_ v)\nswitch costume to (logo2 v)\ncreate clone of (_myself_ v)\nswitch costume to (end v)\ncreate clone of (_myself_ v)\nswitch costume to (up v)\ncreate clone of (_myself_ v)\nswitch costume to (down v)\ncreate clone of (_myself_ v)\nswitch costume to (round v)\ncreate clone of (_myself_ v)\nswitch costume to (star v)\ncreate clone of (_myself_ v)\nswitch costume to (skip v)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nif <(costume [name v]) = [logo]> then\n    set [sine v] to [0]\n    hide\n    set size to (75) %\n    wait (1.25) seconds\n    show\n    go to x: (0) y: (300)\n    go to [front v] layer\n    go [backward v] (1) layers\n    Smooth Glide to x [0] y [0] Speed [7]\n    repeat (121)\n        change [sine v] by (7.5)\n        change [brightness v] effect by (-10)\n        set size to ((([sin v] of ((sine) * (2.1220102)) ) * (8)) + (75)) %\n        change [brightness v] effect by (10)\n    end\n    point in direction (90)\n    wait (2) seconds\n    delete this clone\nend\n\ndefine Smooth Glide to x (x) y (y) Speed (s)\nrepeat until <<(round (x position)) = (x)> and <(round (y position)) = (y)>>\n    change x by (((x) - (x position)) / (s))\n    change y by (((y) - (y position)) / (s))\nend\ngo to x: (x) y: (y)\n\nwhen I start as a clone\nif <(costume [name v]) = [intro2]> then\n    show\n    go to x: (-300) y: (0)\n    Smooth Glide to x [5] y [0] Speed [7]\n    repeat (25)\n        change [brightness v] effect by (-6)\n        change [ghost v] effect by (4)\n    end\n    delete this clone\nend\n\nwhen I start as a clone\nif <(costume [name v]) = [star]> then\n    set size to (20) %\n    show\n    go to x: (50) y: (30)\n    set [ghost v] effect to (100)\n    wait (6.7) seconds\n    go to [front v] layer\n    repeat (20)\n        turn right (5) degrees\n        change [ghost v] effect by (-3)\n        change size by (4)\n    end\n    repeat (20)\n        turn right (5) degrees\n        change [ghost v] effect by (-3)\n        change size by (-5)\n    end\n    delete this clone\nend\n\nwhen I start as a clone\nif <(costume [name v]) = [intro4]> then\n    set size to (100) %\n    go to [back v] layer\n    show\n    go to x: (0) y: (0)\n    wait (0.75) seconds\n    repeat (3)\n        change [brightness v] effect by (1.5)\n    end\n    repeat (3)\n        change [brightness v] effect by (-1.5)\n    end\n    wait (1.5) seconds\n    repeat (3)\n        change [brightness v] effect by (1.5)\n    end\n    repeat (3)\n        change [brightness v] effect by (-1.5)\n    end\n    wait (1.5) seconds\n    repeat (3)\n        change [brightness v] effect by (1.5)\n    end\n    repeat (3)\n        change [brightness v] effect by (-1.5)\n    end\n    wait (1.5) seconds\n    repeat (3)\n        change [brightness v] effect by (1.5)\n    end\n    repeat (3)\n        change [brightness v] effect by (-1.5)\n    end\n    wait (1) seconds\n    repeat (25)\n        change [brightness v] effect by (-0.07)\n    end\n    wait (1) seconds\n    delete this clone\nend\n\nwhen I start as a clone\nif <(costume [name v]) = [intro3]> then\n    show\n    go to x: (300) y: (0)\n    Smooth Glide to x [5] y [0] Speed [7]\n    repeat (25)\n        change [brightness v] effect by (-6)\n        change [ghost v] effect by (4)\n    end\n    delete this clone\nend\n\nwhen I start as a clone\nif <(costume [name v]) = [round]> then\n    set size to (50) %\n    go to x: (0) y: (0)\n    wait (7.1) seconds\n    set [ghost v] effect to (20)\n    show\n    go to [front v] layer\n    go [backward v] (4) layers\n    repeat (40)\n        change [ghost v] effect by (7)\n        change size by (((250) - (size)) / (7.5))\n    end\n    wait (1) seconds\n    delete this clone\nend\n\nwhen I start as a clone\nif <(costume [name v]) = [logo2]> then\n    set [sine v] to [0]\n    hide\n    set size to (75) %\n    wait (1.25) seconds\n    show\n    go to x: (0) y: (300)\n    wait (0.01) seconds\n    go to [front v] layer\n    Smooth Glide to x [0] y [0] Speed [7]\n    repeat (120)\n        change size by (3)\n        point in direction ((([sin v] of (sine) ) * (30)) + (90))\n        set size to ((([sin v] of ((sine) * (1)) ) * (2)) + (75)) %\n        change size by (-3)\n    end\n    point in direction (90)\n    wait (2) seconds\n    delete this clone\nend\nbroadcast (music v)\n\nwhen I start as a clone\nif <(costume [name v]) = [down]> then\n    set [ghost v] effect to (100)\n    go to x: (0) y: (-200)\n    point in direction (90)\n    wait (7.8) seconds\n    go to [front v] layer\n    show\n    repeat (20)\n        change [ghost v] effect by (-10)\n        change y by (((0) - (y position)) / (4))\n    end\n    clear graphic effects\n    wait (0.5) seconds\n    repeat (20)\n        change [ghost v] effect by (10)\n        change y by (((-200) - (y position)) / (4))\n    end\n    set [ghost v] effect to (100)\n    delete this clone\nend\n\nwhen I start as a clone\nif <(costume [name v]) = [up]> then\n    set [ghost v] effect to (100)\n    switch costume to (up v)\n    point in direction (90)\n    go to x: (0) y: (200)\n    wait (7.8) seconds\n    go to [front v] layer\n    show\n    repeat (20)\n        change [ghost v] effect by (-10)\n        change y by (((0) - (y position)) / (4))\n    end\n    clear graphic effects\n    wait (0.5) seconds\n    repeat (20)\n        change [ghost v] effect by (10)\n        change y by (((200) - (y position)) / (4))\n    end\n    set [ghost v] effect to (100)\n    delete this clone\nend\n\nwhen flag clicked\nwait (9) seconds\nbroadcast (Start v)\n\n@Intro 2\n\nwhen I start as a clone\ngo to [front v] layer\ngo [backward v] (6) layers\nshow\npoint in direction (pick random (1000000) to (1))\nrepeat (pick random (30) to (37))\n    change [i2 v] by (0.8)\n    move (i2) steps\n    change [ghost v] effect by (5.5)\nend\n\nwhen flag clicked\nswitch costume to (1 v)\ngo to x: (0) y: (0)\nhide\nwait (2.4) seconds\nrepeat (120)\n    create clone of (_myself_ v)\nend\n\n@spikes\n\nwhen flag clicked\ngo to [front v] layer\nswitch costume to (1 v)\nhide\n\nwhen I receive [start v]\ngo to x: (0) y: (0)\nshow\n\nwhen I receive [next level v]\ngo to [front v] layer\nnext costume\n\n@Cloud\n\nwhen flag clicked\ngo to [back v] layer\nhide\nwait (11) seconds\nforever\n    create clone of (_myself_ v)\n    wait (1.5) seconds\nend\n\nwhen I start as a clone\nshow\nif <(pick random (1) to (2)) = [1]> then\n    go to x: (-250) y: (pick random (50) to (200))\n    set [ghost v] effect to (pick random (60) to (90))\n    switch costume to (pick random (1) to (2))\n    repeat until <(x position) = [250]>\n        change x by (1)\n    end\n    delete this clone\nelse\n    go to x: (250) y: (pick random (50) to (200))\n    set [ghost v] effect to (pick random (60) to (90))\n    switch costume to (pick random (1) to (2))\n    repeat until <(x position) = [-250]>\n        change x by (-1)\n    end\n    delete this clone\nend\n\n@bouncy stuff\n\nwhen flag clicked\ngo to x: (0) y: (0)\nswitch costume to (1 v)\nhide\n\nwhen I receive [start v]\nshow\n\nwhen I receive [next level v]\nnext costume\n\n@speed\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\n\nwhen I receive [start v]\ngo to [back v] layer\nswitch costume to (1 v)\nshow\n\nwhen I receive [next level v]\nnext costume\n\n@skip\n\nwhen I receive [start v]\nset size to (80) %\nset [ghost v] effect to (100)\ngo to [front v] layer\nshow\nrepeat (45)\n    change [ghost v] effect by (-2)\nend\nforever\n    if <touching (mouse-pointer v)?> then\n        set [ghost v] effect to (20)\n        if <mouse down?> then\n            broadcast (next level v)\n            wait until <not <mouse down?>>\n        end\n    else\n        set [ghost v] effect to (10)\n    end\nend\n\nwhen flag clicked\nswitch costume to (1 v)\ngo to x: (-216) y: (-158)\nhide\n\nwhen I receive [end. v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\nstop [this script v]\n\n@replay\n\nwhen I receive [start v]\nset size to (80) %\nset [ghost v] effect to (100)\ngo to [front v] layer\nshow\nrepeat (45)\n    change [ghost v] effect by (-2)\nend\nforever\n    if <touching (mouse-pointer v)?> then\n        set [ghost v] effect to (20)\n        if <mouse down?> then\n            broadcast (replay v)\n            wait until <not <mouse down?>>\n        end\n    else\n        set [ghost v] effect to (10)\n    end\nend\n\nwhen flag clicked\nswitch costume to (1 v)\ngo to x: (-180) y: (-158)\nhide\n\nwhen I receive [end. v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\nstop [this script v]\n\n@1\n\nwhen flag clicked\nset size to (100) %\nset [ghost v] effect to (100)\nshow\nforever\n    go to [front v] layer\nend\n\n@2\n\nwhen flag clicked\ngo to x: (0) y: (0)\nset size to (100) %\nset [ghost v] effect to (100)\ngo to [front v] layer\nshow\nwait (1) seconds\nhide\nstop [this script v]\n\n