Kitek Ciapek :3 - a platformer


@Stage\n\nwhen I receive [play v]\nwait (2.5) seconds\nforever\n    play sound [Murad - Run \(Inspired By Alan Walker\) NCN Release.mp3 v] until done\nend\n\n@terrain\n\nwhen flag clicked\nwait (2.5) seconds\nforever\n    if <(niveau) = [3]> then\n        broadcast (pièce 1 v)\n        stop [this script v]\n    end\nend\n\nwhen flag clicked\nwait (2.5) seconds\nshow\nset [niveau v] to [1]\ngo to [front v] layer\nforever\n    if <(Easter Egg trouvé ?) = [1]> then\n        hide\n    else\n        show\n        switch costume to (niveau)\n    end\nend\n\nwhen flag clicked\nwait (2.5) seconds\nforever\n    if <(niveau) = [4]> then\n        broadcast (pièce 2 v)\n        stop [this script v]\n    end\nend\n\n@danger\n\nwhen flag clicked\nshow\ngo to [back v] layer\nforever\n    switch costume to (niveau)\nend\n\nwhen flag clicked\nshow\ngo to [back v] layer\nforever\n    set [ghost v] effect to (15)\n    set size to (100) %\n    if <not <(niveau) = [9]>> then\n        go to x: (0) y: (0)\n        repeat (10)\n            change y by (0.5)\n        end\n        repeat (10)\n            change y by (-0.5)\n        end\n    end\nend\n\nset [niveau v] to [16]\n\nwhen flag clicked\nshow\ngo to [back v] layer\nforever\n    if <(niveau) = [16]> then\n        set [ghost v] effect to (90)\n    else\n        set [ghost v] effect to (0)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Easter Egg trouvé ?) = [1]> then\n        hide\n    else\n        show\n    end\nend\n\nwhen flag clicked\nshow\ngo to [back v] layer\nforever\n    if <(niveau) = [9]> then\n        set [ghost v] effect to (0)\n        go to [front v] layer\n    else\n        set [ghost v] effect to (10)\n        go to [back v] layer\n    end\nend\n\n@skip\n\nwhen flag clicked\nset [niveau v] to [1]\nforever\n    go to [front v] layer\n    set size to (100) %\n    if <touching (mouse-pointer v)?> then\n        change size by (10)\n        if <<mouse down?> and <touching (mouse-pointer v)?>> then\n            broadcast (respawn v)\n            change [niveau v] by (1)\n            wait (1) seconds\n        end\n    end\nend\n\nwhen I receive [respawn v]\nif <(niveau) = [8]> then\n    stop [other scripts in sprite v]\n    forever\n        go to [front v] layer\n        point in direction (90)\n        switch costume to (costume1 v)\n        repeat (10)\n            turn right (0.5) degrees\n        end\n        repeat (20)\n            turn left (0.5) degrees\n        end\n        repeat (10)\n            turn right (0.5) degrees\n        end\n    end\nend\n\nwhen flag clicked\nhide\n\nwhen flag clicked\nwait (1) seconds\nshow\nforever\n    go [forward v] (50) layers\n    go to [front v] layer\nend\n\nwhen flag clicked\nwait (2.5) seconds\nshow\ngo to x: (-193) y: (156)\npoint in direction (90)\ngo to [front v] layer\nforever\n    repeat (20)\n        turn right (0.5) degrees\n    end\n    repeat (40)\n        turn left (0.5) degrees\n    end\n    repeat (20)\n        turn right (0.5) degrees\n    end\nend\n\nwhen flag clicked\nset [niveau v] to [1]\nforever\n    play sound [epic-north-music-this-is-the-future-epic-cinematic-sci-fi-drama v] until done\nend\n\nwhen flag clicked\nforever\n    if <(niveau) = [18]> then\n        hide\n    end\nend\n\n@trampoline\n\nwhen flag clicked\nforever\n    go to [back v] layer\n    switch costume to (niveau)\nend\n\n@player\n\nwhen flag clicked\nforever\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nswitch costume to (clones v)\nrepeat (25)\n    change size by (-6)\n    switch costume to (costume2 v)\n    change [ghost v] effect by (10)\nend\ndelete this clone\n\nwhen I receive [respawn v]\ngo to x: (-207) y: (-39)\nset [x v] to [0]\nset [y v] to [0]\n\ndefine spécial détéction\nif <touching (trampoline v)?> then\n    change [y v] by (pick random (10) to (15))\nend\n\nwhen flag clicked\nforever\n    spécial détéction\nend\n\nwhen flag clicked\nforever\n    spécial death\nend\n\ndefine spécial death\nif <touching (laser2 v)?> then\n    repeat (10)\n        change [ghost v] effect by (8)\n    end\n    go to x: (-207) y: (-39)\n    broadcast (Recommence v)\n    repeat (10)\n        change [ghost v] effect by (-8)\n    end\nend\n\nwhen flag clicked\nhide\n\nwhen flag clicked\nset size to (90) %\nset [easter egg trouvé ? v] to [0]\nset [easter egg trouvé ? v] to [0]\nwait (2.5) seconds\nswitch costume to (a droite v)\ngo to [back v] layer\npoint in direction (90)\nset [yy v] to [15]\nset [xx -90 v] to [-1]\nset [xx 90 v] to [1]\ngo to [front v] layer\nshow\ngo to x: (-207) y: (-30)\nforever\n    go to [front v] layer\n    set [x v] to [0]\n    set [y v] to [0]\n    forever\n        change [y v] by (-1)\n        set [x v] to ((x) * (0.9))\n        if <<key (right arrow v) pressed?> or <<mouse down?> and <(x position) < (mouse x)>>> then\n            switch costume to (a droite v)\n            set [orientation  de player v] to [a droite]\n            change [x v] by (Xx 90)\n        end\n        if <<key (left arrow v) pressed?> or <<mouse down?> and <(mouse x) < (x position)>>> then\n            switch costume to (a gauche v)\n            set [orientation  de player v] to [a gauche]\n            change [x v] by (Xx -90)\n        end\n        change x by (x)\n        if <<touching (easter egg platforme v)?> or <touching (terrain v)?>> then\n            change y by (1)\n        end\n        if <<touching (easter egg platforme v)?> or <touching (terrain v)?>> then\n            change y by (1)\n        end\n        if <<touching (easter egg platforme v)?> or <touching (terrain v)?>> then\n            change y by (1)\n        end\n        if <<touching (easter egg platforme v)?> or <touching (terrain v)?>> then\n            change y by (1)\n        end\n        if <<touching (easter egg platforme v)?> or <touching (terrain v)?>> then\n            change y by (-4)\n            change x by ((x) * (-1))\n            if <<key (up arrow v) pressed?> or <<mouse down?> and <(y position) < (mouse y)>>> then\n                set [y v] to [10]\n                if <([abs v] of (x) ) = (x)> then\n                    set [x v] to [-4]\n                else\n                    set [x v] to [4]\n                end\n            else\n                set [x v] to [0]\n            end\n        end\n        if <key (down arrow v) pressed?> then\n            change [y v] by (-2)\n        end\n        change y by (y)\n        if <<touching (easter egg platforme v)?> or <touching (terrain v)?>> then\n            change y by ((y) - ((y) * (2)))\n            set [y v] to [0]\n        end\n        change y by (-1)\n        if <<<key (up arrow v) pressed?> or <<mouse down?> and <(y position) < (mouse y)>>> and <<touching (easter egg platforme v)?> or <touching (terrain v)?>>> then\n            change [y v] by (Yy)\n        end\n        change y by (1)\n        if <<touching (danger lave v)?> or <<touching (danger v)?> or <<touching (eau 2 v)?> or <<touching (scie v)?> or <touching (lave v)?>>>>> then\n            repeat (10)\n                change [ghost v] effect by (8)\n            end\n            go to x: (-207) y: (-39)\n            broadcast (Recommence v)\n            repeat (10)\n                change [ghost v] effect by (-8)\n            end\n        end\n        if <[200] < (x position)> then\n            change [niveau v] by (1)\n            set [x v] to [0]\n            set [y v] to [0]\n            go to x: (-207) y: (-39)\n            broadcast (Recommence v)\n        end\n    end\nend\n\nwhen I receive [easter egg v]\nforever\n    if <touching (easter egg declencheur v)?> then\n        set [easter egg trouvé ? v] to [0.5]\n        wait (0.7) seconds\n        set [easter egg trouvé ? v] to [1]\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Easter Egg trouvé ?) = [1]> then\n        if <(niveau) = [11]> then\n            set [easter egg trouvé ? v] to [0]\n            set [niveau v] to [6]\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Easter Egg trouvé ?) = [0.5]> then\n        go to x: (-207) y: (-39)\n        set [x v] to [0]\n        set [y v] to [0]\n    end\nend\n\nset [niveau v] to [12]\n\nset [niveau v] to [16]\n\n@Décors\n\nwhen flag clicked\ngo to [back v] layer\ngo to x: (0) y: (0)\n\nstop [this script v]\n\nwhen flag clicked\nwait (2.5) seconds\nshow\nset [niveau v] to [1]\nforever\n    switch costume to (niveau)\n    go to [back v] layer\nend\n\nset [niveau v] to [15]\n\n@LAVE\n\nwhen flag clicked\nforever\n    hide\n    if <(niveau) = [6]> then\n        go to x: (0) y: (2)\n        repeat until <not <(niveau) = [6]>>\n            create clone of (_myself_ v)\n            wait (0.2) seconds\n        end\n    end\n    if <(niveau) = [16]> then\n        go to x: (0) y: (2)\n        repeat until <not <(niveau) = [16]>>\n            repeat (10)\n                create clone of (_myself_ v)\n                wait (0.2) seconds\n            end\n            wait (3) seconds\n        end\n    end\nend\n\nwhen I start as a clone\nset [ghost v] effect to (100)\nshow\nclear graphic effects\nrepeat (25)\n    change [ghost v] effect by (-4)\nend\nif <(niveau) = [6]> then\n    repeat until <(y position) < [-120]>\n        change [brightness v] effect by (-0.7)\n        change y by (-2)\n    end\n    repeat (25)\n        change [ghost v] effect by (4)\n    end\n    delete this clone\nend\nif <(niveau) = [16]> then\n    repeat until <(y position) < [-170]>\n        change [brightness v] effect by (-0.8)\n        change y by (-2)\n    end\n    repeat (25)\n        change [ghost v] effect by (4)\n    end\n    delete this clone\nend\n\nwhen I start as a clone\nforever\n    if <<<(niveau) = [7]> or <(niveau) = [17]>> or <(niveau) = [21]>> then\n        delete this clone\n    end\nend\n\nstop [other scripts in sprite v]\n\n@danger Lave\n\nwhen flag clicked\nshow\nforever\n    go to [back v] layer\n    switch costume to (niveau)\nend\n\nwhen flag clicked\nshow\ngo to [back v] layer\nforever\n    set [ghost v] effect to (15)\n    set size to (100) %\n    go to x: (0) y: (0)\n    repeat (10)\n        change y by (0.5)\n    end\n    repeat (10)\n        change y by (-0.5)\n    end\nend\n\nset [niveau v] to [16]\n\n@Fumée\n\nwhen flag clicked\nhide\nforever\n    go to x: (260) y: (pick random (60) to (170))\n    set [vitesse nuages v] to (pick random (0.5) to (2.5))\n    repeat (pick random (10) to (30))\n        create clone of (_myself_ v)\n        wait (pick random (0.01) to (0.09)) seconds\n    end\n    wait (2) seconds\nend\n\nwhen I start as a clone\nset size to (pick random (40) to (100)) %\nset [brightness v] effect to (pick random (0) to (40))\nshow\nchange y by (pick random (20) to (-20))\nset [ghost v] effect to (100)\nset [ghost v] effect to (0)\npoint in direction (-90)\nrepeat until <(x position) < [-230]>\n    go to [back v] layer\n    move (Vitesse nuages) steps\nend\nrepeat (100)\n    change [ghost v] effect by (1)\n    change size by (1)\nend\ndelete this clone\n\n@Scie\n\nwhen flag clicked\nforever\n    hide\n    if <(niveau) = [7]> then\n        go to x: (0) y: (2)\n        repeat until <not <(niveau) = [7]>>\n            show\n            set size to (80) %\n            go to x: (0) y: (-100)\n        end\n    end\n    if <(niveau) = [8]> then\n        repeat until <not <(niveau) = [8]>>\n            show\n            set size to (50) %\n            go to x: (20) y: (-20)\n        end\n    end\n    if <(niveau) = [9]> then\n        repeat until <not <(niveau) = [9]>>\n            show\n            set size to (50) %\n            go to x: (20) y: (-20)\n        end\n    end\n    if <(niveau) = [10]> then\n        repeat until <not <(niveau) = [10]>>\n            show\n            set size to (50) %\n            go to x: (70) y: (-30)\n        end\n    end\n    if <(niveau) = [12]> then\n        repeat until <not <(niveau) = [12]>>\n            show\n            set size to (30) %\n            go to x: (-5) y: (30)\n        end\n    end\n    if <(niveau) = [14]> then\n        repeat until <not <(niveau) = [14]>>\n            show\n            set size to (30) %\n            go to x: (20) y: (-87)\n        end\n    end\n    if <(niveau) = [15]> then\n        show\n        set size to (70) %\n        go to x: (-50) y: (-87)\n        repeat until <not <(niveau) = [15]>>\n            repeat (100)\n                change x by (2)\n            end\n            repeat (100)\n                change x by (-2)\n            end\n        end\n    end\n    if <(niveau) = [16]> then\n        show\n        set size to (40) %\n        go to x: (100) y: (56)\n        repeat until <not <(niveau) = [16]>>\n            repeat (50)\n                change x by (1)\n            end\n            repeat (50)\n                change x by (-1)\n            end\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    turn right (Vitesse de rotation) degrees\nend\n\nwhen flag clicked\nforever\n    repeat (120)\n        set [vitesse de rotation v] to ((Vitesse de rotation) + ((Vitesse de rotation) * (0.01)))\n    end\n    repeat (120)\n        set [vitesse de rotation v] to ((Vitesse de rotation) - ((Vitesse de rotation) * (0.01)))\n    end\n    set [vitesse de rotation v] to [6]\nend\n\nwhen flag clicked\nforever\n    if <not <<(niveau) = [16]> or <<(niveau) = [15]> or <<(niveau) = [14]> or <<(niveau) = [12]> or <<(niveau) = [10]> or <<(niveau) = [9]> or <<(niveau) = [8]> or <(niveau) = [7]>>>>>>>>> then\n        hide\n    end\nend\n\n@Page de garde\n\nwhen flag clicked\nforever\n    switch costume to (scène v)\n    show\n    set [ghost v] effect to (100)\n    go to [front v] layer\n    go to x: (0) y: (0)\nend\n\n