The Ink Platformer
@Stage\n\nwhen flag clicked\nswitch backdrop to (xy-grid-20px v)\n\nwhen I receive [défaite v]\nswitch backdrop to (mort v)\n\nwhen flag clicked\nset [brightness v] effect to (10)\nforever\n    if <(Pause?) = [0]> then\n        set volume to (100) %\n        play sound [Electroman Adventures v] until done\n    else\n        stop all sounds\n    end\nend\n\n@Blank\n\n@Perso\n\nwhen flag clicked\nswitch costume to (player v)\nset [x v] to [0]\nset [y v] to [2]\nset [checkpoint v] to [100]\nset [niveau v] to [1]\nshow variable [ink show v]\npoint in direction (90)\nset rotation style [left-right v]\ngo to x: (-215) y: (0)\ngo to [front v] layer\ngo [backward v] (1) layers\nshow\nforever\n    if <(Pause?) = [0]> then\n        if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n            if <<key (down arrow v) pressed?> or <key (s v) pressed?>> then\n                change [x v] by (0.2)\n                point in direction (90)\n            else\n                change [x v] by (0.8)\n                point in direction (90)\n            end\n        end\n        if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n            if <<key (down arrow v) pressed?> or <key (s v) pressed?>> then\n                change [x v] by (-0.2)\n                point in direction (-90)\n            else\n                change [x v] by (-0.8)\n                point in direction (-90)\n            end\n        end\n        set [x v] to ((X) * (0.9))\n        change x by (X)\n        if <<touching color (#404040)?> or <touching color (#808080)?>> then\n            change x by ((X) * (-1))\n        end\n        change [y v] by (-1)\n        change y by (Y)\n        if <<touching color (#404040)?> or <touching color (#808080)?>> then\n            change y by ((Y) * (-1))\n            set [y v] to [0]\n        end\n        change y by (-1)\n        if <<touching color (#404040)?> or <touching color (#808080)?>> then\n            if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> and <not <<key (down arrow v) pressed?> or <key (s v) pressed?>>>> then\n                set [y v] to [10]\n            end\n        end\n        change y by (1)\n        if <(x position) > [235]> then\n            change [niveau v] by (1)\n            broadcast (Next v)\n            go to x: (-230) y: (y position)\n            set [checkpoint v] to (y position)\n        end\n        if <<<touching (spike v)?> or <touching (unactive spike v)?>> or <touching (ennemi v)?>> then\n            broadcast (Mort v) and wait\n        end\n        if <key (n v) pressed?> then\n            change [niveau v] by (1)\n            go to x: (-230) y: (CheckPoint)\n            wait (0.1) seconds\n            repeat (15)\n                change [ink v] by (-1)\n            end\n        end\n    end\n    if <key (r v) pressed?> then\n        hide\n        broadcast (Restart v) and wait\n        go to x: (-230) y: (CheckPoint)\n        erase all\n        show\n    end\n    if <(Ink) < [0]> then\n        broadcast (Défaite v) and wait\n    end\nend\n\nwhen I receive [mort v]\nhide\nrepeat (10)\n    change [ink v] by (-0.5)\nend\nerase all\nwait (1.5) seconds\ngo to x: (-230) y: (CheckPoint)\nshow\n\nwhen I receive [défaite v]\nhide\n\nwhen flag clicked\nforever\n    if <(Pause?) = [0]> then\n        if <<key (down arrow v) pressed?> or <key (s v) pressed?>> then\n            switch costume to (sneak v)\n        else\n            if <<<key (left arrow v) pressed?> or <key (right arrow v) pressed?>> or <<key (a v) pressed?> or <key (d v) pressed?>>> then\n                if <(Lag) = [no]> then\n                    switch costume to (run v)\n                else\n                    switch costume to (player v)\n                end\n            end\n            if <not <<<key (left arrow v) pressed?> or <key (right arrow v) pressed?>> or <<key (a v) pressed?> or <key (d v) pressed?>>>> then\n                switch costume to (player v)\n            end\n        end\n    end\n    set [ink show v] to (join (round (Ink)) [ %])\nend\n\nwhen flag clicked\nset [ink v] to [100]\nset [ink show v] to [100 %]\n\nwhen flag clicked\nforever\n    if <(letter (1) of (Ink show)) = [0]> then\n        set [ink v] to [0]\n    end\nend\n\n@Particules\n\nwhen flag clicked\nhide\nset [is clone? v] to []\n\nwhen I receive [mort v]\nif <(Lag) = [no]> then\n    if <not <(Is clone?) = [1]>> then\n        repeat (4)\n            Particles\n        end\n    end\nend\nplay sound [Clang v] until done\n\nwhen I start as a clone\ngo to (perso v)\nswitch costume to (pick random (1) to (3))\nset [ghost v] effect to (0)\nset [color v] effect to (pick random (-5) to (5))\nset [brightness v] effect to (pick random (-20) to (0))\nset [is clone? v] to [1]\nshow\nset [xv v] to (pick random (-10) to (10))\nset [yv v] to (pick random (5) to (30))\nrepeat until <<touching (_edge_ v)?> or <touching color (#404040)?>>\n    change [yv v] by (-2)\n    set [xv v] to ((xv) * (0.9))\n    set [yv v] to ((yv) * (0.9))\n    change x by (xv)\n    change y by (yv)\n    if <touching color (#404040)?> then\n        change y by (1)\n        if <touching color (#404040)?> then\n            change y by (1)\n            if <touching color (#404040)?> then\n                change y by (1)\n                if <touching color (#404040)?> then\n                    change y by (1)\n                    if <touching color (#404040)?> then\n                        change y by (1)\n                        if <touching color (#404040)?> then\n                            change y by (1)\n                            if <touching color (#404040)?> then\n                                change y by (1)\n                                if <touching color (#404040)?> then\n                                    change y by (1)\n                                    if <touching color (#404040)?> then\n                                        change y by (1)\n                                        if <touching color (#404040)?> then\n                                            change y by (1)\n                                            if <touching color (#404040)?> then\n                                                change y by (1)\n                                                if <touching color (#404040)?> then\n                                                    change y by (1)\n                                                else\n                                                    change y by (-1)\n                                                end\n                                            end\n                                        end\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\n    if <<touching (spike v)?> or <touching (unactive spike v)?>> then\n        delete this clone\n    end\nend\nrepeat (20)\n    change [ghost v] effect by (5)\nend\ndelete this clone\n\ndefine Particles\nrepeat (5)\n    create clone of (_myself_ v)\nend\n\nwhen I receive [défaite v]\nhide\n\nwhen I receive [restart v]\nif <(Lag) = [no]> then\n    if <not <(Is clone?) = [1]>> then\n        repeat (4)\n            Particles\n        end\n    end\nend\nplay sound [Clang v] until done\n\n@Plateforme\n\nwhen flag clicked\nshow\ngo to x: (0) y: (0)\nforever\n    switch costume to (Niveau)\n    Niveau visité\nend\n\nwhen I receive [défaite v]\nhide\n\ndefine Niveau visité\nif <not <[niveau visité v] contains (costume [number v])?>> then\n    wait (0.01) seconds\n    add (costume [number v]) to [niveau visité v]\nend\n\nset [niveau v] to [10]\n\n@Spike\n\nwhen flag clicked\ngo to x: (0) y: (0)\nforever\n    go to [back v] layer\n    switch costume to (Niveau)\nend\n\nwhen I receive [défaite v]\nhide\n\nwhen flag clicked\nshow\nforever\n    if <(Pause?) = [0]> then\n        if <(Lag) = [no]> then\n            glide (1) secs to x: (0) y: (-10)\n            wait (0.1) seconds\n            glide (1) secs to x: (0) y: (0)\n            wait (0.3) seconds\n        else\n            go to x: (0) y: (0)\n        end\n    end\nend\n\nwhen flag clicked\nset [lag v] to [no]\nforever\n    if <key (l v) pressed?> then\n        if <(Lag) = [no]> then\n            set [lag v] to [yes]\n            wait until <not <key (l v) pressed?>>\n        else\n            set [lag v] to [no]\n            wait until <not <key (l v) pressed?>>\n        end\n    end\nend\n\n@Unactive Spike\n\nwhen flag clicked\ngo to x: (0) y: (0)\nshow\nforever\n    go to [back v] layer\n    switch costume to (Niveau)\nend\n\nwhen I receive [défaite v]\nhide\n\n@Text\n\nwhen flag clicked\ngo to x: (0) y: (0)\nshow\nforever\n    switch costume to (Niveau)\n    go to [front v] layer\n    if <(Pause?) = [0]> then\n        go to [front v] layer\n    else\n        go to [back v] layer\n    end\nend\n\nwhen I receive [défaite v]\nhide\n\n@Chain\n\nwhen flag clicked\ngo to x: (0) y: (0)\nshow\nforever\n    switch costume to (Niveau)\n    go to [back v] layer\nend\n\nwhen I receive [défaite v]\nhide\n\ngo to [back v] layer\n\n@Pen\n\nwhen flag clicked\nset [ink v] to [100]\ngo to [front v] layer\nshow\nforever\n    if <(Pause?) = [0]> then\n        go to (mouse-pointer v)\n    end\nend\n\nwhen I receive [next v]\nerase all\n\nwhen flag clicked\nset pen color to (#404040)\nset pen size to (4)\nerase all\nforever\n    if <(Pause?) = [0]> then\n        if <(Ink) > [0]> then\n            if <<mouse down?> and <not <<(x position) < [24]> and <(y position) > [137]>>>> then\n                if <(Ink) > [-0.1]> then\n                    pen down\n                    set [pen? v] to [1]\n                end\n            else\n                pen up\n                set [pen? v] to [0]\n            end\n        else\n            pen up\n            set [pen? v] to [0]\n        end\n    end\n    if <(Ink) < [1]> then\n        erase all\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Ink) < [1]> then\n        pen up\n        set [pen? v] to [0]\n    end\nend\n\nwhen I receive [défaite v]\nhide\n\nwhen flag clicked\nforever\n    if <(Pen?) = [1]> then\n        set [x v] to (mouse x)\n        set [y v] to (mouse y)\n        set [différence v] to [0]\n        wait (0.05) seconds\n        Calcul différence\n        change [ink v] by ((0) - ((différence) / (70)))\n    end\nend\n\ndefine Calcul différence\nif <[0] > ((x) - (mouse x))> then\n    set [différence v] to (((x) - (mouse x)) * (-1))\nelse\n    set [différence v] to ((x) - (mouse x))\nend\nif <[0] > ((y) - (mouse y))> then\n    set [différence v] to ((différence) + (((y) - (mouse y)) * (-1)))\nelse\n    set [différence v] to ((différence) + ((y) - (mouse y)))\nend\n\nwhen flag clicked\nforever\n    if <<(Pause?) = [0]> and <mouse down?>> then\n        if <(Ink) > [0]> then\n            change [ink v] by (-0.75)\n            wait until <(Pen?) = [0]>\n        end\n    end\nend\n\n@Ink\n\nwhen flag clicked\ndelete all of [niveau visité v]\nhide\n\nwhen flag clicked\nset [lag v] to [no]\nforever\n    if <(Lag) = [no]> then\n        next costume\n        wait (0.1) seconds\n    else\n        repeat until <(Lag) = [no]>\n            switch costume to (new piskel \(8\) v)\n        end\n    end\nend\n\nwhen I receive [défaite v]\nhide\n\ndefine Niveau (niveau) X (x) Y (y) Taille (taille)\nif <<([costume # v] of [plateforme v]) = (niveau)> and <not <[niveau visité v] contains (niveau)?>>> then\n    set [xink v] to (x)\n    set [yink v] to (y)\n    if <(taille) = [1]> then\n        set size to (150) %\n        set [taille v] to [150]\n    else\n        if <(taille) = [2]> then\n            set size to (200) %\n            set [taille v] to [200]\n        end\n    end\n    go to x: (xink) y: (yink)\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\ngo to [back v] layer\nshow\nforever\n    if <touching (perso v)?> then\n        hide\n        if <(Ink) > [95]> then\n            if <(Taille) = [150]> then\n                repeat (((100) - (Ink)) / (0.5))\n                    change [ink v] by ((100) - (Ink))\n                end\n                play sound [Glug v] until done\n                delete this clone\n            end\n        else\n            if <(Taille) = [200]> then\n                repeat (((100) - (Ink)) / (0.5))\n                    change [ink v] by ((100) - (Ink))\n                end\n                play sound [Glug v] until done\n                delete this clone\n            end\n        end\n        if <(Taille) = [150]> then\n            repeat (10)\n                change [ink v] by (0.5)\n            end\n            play sound [Glug v] until done\n            delete this clone\n        end\n        if <(Taille) = [200]> then\n            repeat (30)\n                change [ink v] by (0.5)\n            end\n            play sound [Glug v] until done\n            delete this clone\n        end\n    end\nend\n\nwhen I receive [next v]\nNiveau [4] X [212] Y [149] Taille [1]\nNiveau [5] X [64] Y [154] Taille [1]\nNiveau [6] X [53] Y [148] Taille [1]\nNiveau [10] X [73] Y [-33] Taille [2]\nNiveau [12] X [-50] Y [-80] Taille [1]\nNiveau [12] X [50] Y [-80] Taille [1]\nNiveau [13] X [-141] Y [73] Taille [1]\nNiveau [13] X [-46] Y [-14] Taille [1]\nNiveau [13] X [94] Y [155] Taille [1]\nNiveau [13] X [140] Y [87] Taille [1]\nNiveau [13] X [213] Y [-5] Taille [1]\ndelete this clone\n\nwhen I start as a clone\nforever\n    if <(Pause?) = [0]> then\n        next costume\n        wait (0.1) seconds\n    end\nend\n\n@Ink bar\n\nwhen flag clicked\nshow\nshow variable [ink show v]\ngo to x: (-107) y: (169)\nforever\n    if <(Ink) < [1]> then\n        switch costume to (new piskel \(8\) v)\n        set [color v] effect to (70)\n        set [brightness v] effect to (-30)\n        set [ink v] to [0]\n    else\n        if <(Ink) > [0]> then\n            switch costume to (round (Ink))\n            set [color v] effect to (0)\n            set [brightness v] effect to (0)\n        end\n    end\nend\n\nwhen I receive [défaite v]\nhide\n\nwhen flag clicked\nforever\n    if <(Pause) = [0]> then\n        go to [front v] layer\n        show variable [ink show v]\n    else\n        go [backward v] (1) layers\n        hide variable [ink show v]\n    end\nend\n\n@Pause screen\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\nset [ghost v] effect to (15)\nset [brightness v] effect to (-50)\nset [pause? v] to [0]\nforever\n    if <key (p v) pressed?> then\n        if <(backdrop [number v]) = [1]> then\n            if <(Pause?) = [0]> then\n                set [pause? v] to [1]\n                show\n                go to [front v] layer\n                wait (0.5) seconds\n            else\n                set [pause? v] to [0]\n                hide\n                go to [back v] layer\n                wait (0.5) seconds\n            end\n            if <key (m v) pressed?> then\n                hide\n                go to [back v] layer\n                wait (0.5) seconds\n            end\n        end\n    end\nend\n\n@Ennemi\n\nwhen flag clicked\nforever\n    if <(Pause?) = [0]> then\n        if <<<touching (spike v)?> or <touching (unactive spike v)?>> or <key (r v) pressed?>> then\n            go to x: (item (Niveau) of [niveau x v]) y: (item (Niveau) of [niveau y v])\n        end\n    end\nend\n\ndefine Niveau (level) X: (x) Y: (y)\nreplace item (level) of [niveau x v] with (x)\nreplace item (level) of [niveau y v] with (y)\nif <(Niveau) = (level)> then\n    go to x: (x) y: (y)\n    show\nend\nwait until <not <(Niveau) = (level)>>\nhide\n\nwhen flag clicked\nset rotation style [left-right v]\ndelete all of [niveau x v]\ndelete all of [niveau y v]\nset [x v] to [0]\nset [y v] to [0]\nforever\n    if <(Pause?) = [0]> then\n        show\n        if <touching (_edge_ v)?> then\n            set [mouvement v] to (pick random (1) to (2))\n        end\n        if <(Mouvement) = [1]> then\n            set [x v] to [4]\n            point in direction (90)\n        end\n        if <(Mouvement) = [2]> then\n            set [x v] to [-4]\n            point in direction (-90)\n        end\n        set [x v] to ((x) * (0.9))\n        change x by (x)\n        if <<touching color (#808080)?> or <touching color (#404040)?>> then\n            change y by (1)\n        end\n        if <<touching color (#808080)?> or <touching color (#404040)?>> then\n            change y by (1)\n        end\n        if <<touching color (#808080)?> or <touching color (#404040)?>> then\n            change y by (1)\n        end\n        if <<touching color (#808080)?> or <touching color (#404040)?>> then\n            change y by (1)\n        end\n        if <<touching color (#808080)?> or <touching color (#404040)?>> then\n            change y by (1)\n        end\n        if <<touching color (#808080)?> or <touching color (#404040)?>> then\n            change x by ((x) * (-1))\n            change y by (-5)\n            if <(Jump) = [1]> then\n                set [x v] to [0]\n            end\n        end\n        change [y v] by (-1)\n        change y by (y)\n        if <<touching color (#808080)?> or <touching color (#404040)?>> then\n            change y by ((y) * (-1))\n            set [y v] to [0]\n        end\n        change y by (-1)\n        if <<touching color (#808080)?> or <touching color (#404040)?>> then\n            if <(Jump) = [1]> then\n                set [y v] to [10]\n                wait (pick random (1) to (3)) seconds\n                set [jump v] to [0]\n            end\n        end\n        change y by (1)\n    end\nend\n\nwhen flag clicked\nrepeat (100)\n    add [] to [niveau x v]\n    add [] to [niveau y v]\nend\nforever\n    if <(Pause?) = [0]> then\n        if <<(Move) = [3]> or <(Move) = [1]>> then\n            if <(y position) < ([y position v] of [perso v])> then\n                set [jump v] to [1]\n            else\n                set [jump v] to [0]\n            end\n            if <(x position) < ([x position v] of [perso v])> then\n                set [mouvement v] to [1]\n            else\n                set [mouvement v] to [2]\n            end\n        else\n            set [mouvement v] to (pick random (1) to (3))\n            if <(pick random (1) to (2)) = [1]> then\n                set [jump v] to [1]\n            end\n            wait (pick random (1) to (3)) seconds\n            set [jump v] to [0]\n        end\n        set [move v] to (pick random (1) to (3))\n        wait (5) seconds\n    end\nend\n\nwhen flag clicked\nforever\n    Niveau [12] X: [0] Y: [0]\n    Niveau [14] X: [125] Y: [-94]\nend\n\nwhen I receive [défaite v]\nhide\n\n@Ennemi2\n\nwhen flag clicked\nforever\n    if <(Pause?) = [0]> then\n        if <<<touching (spike v)?> or <touching (unactive spike v)?>> or <key (r v) pressed?>> then\n            go to x: (item (Niveau) of [niveau x v]) y: (item (Niveau) of [niveau y v])\n        end\n    end\nend\n\ndefine Niveau (level) X: (x) Y: (y)\nreplace item (level) of [niveau x v] with (x)\nreplace item (level) of [niveau y v] with (y)\nif <(Niveau) = (level)> then\n    go to x: (x) y: (y)\n    show\nend\nwait until <not <(Niveau) = (level)>>\nhide\n\nwhen flag clicked\nset rotation style [left-right v]\ndelete all of [niveau x v]\ndelete all of [niveau y v]\nset [x v] to [0]\nset [y v] to [0]\nforever\n    if <(Pause?) = [0]> then\n        show\n        if <touching (_edge_ v)?> then\n            set [mouvement v] to (pick random (1) to (2))\n        end\n        if <(Mouvement) = [1]> then\n            set [x v] to [4]\n            point in direction (90)\n        end\n        if <(Mouvement) = [2]> then\n            set [x v] to [-4]\n            point in direction (-90)\n        end\n        set [x v] to ((x) * (0.9))\n        change x by (x)\n        if <<touching color (#808080)?> or <touching color (#404040)?>> then\n            change y by (1)\n        end\n        if <<touching color (#808080)?> or <touching color (#404040)?>> then\n            change y by (1)\n        end\n        if <<touching color (#808080)?> or <touching color (#404040)?>> then\n            change y by (1)\n        end\n        if <<touching color (#808080)?> or <touching color (#404040)?>> then\n            change y by (1)\n        end\n        if <<touching color (#808080)?> or <touching color (#404040)?>> then\n            change y by (1)\n        end\n        if <<touching color (#808080)?> or <touching color (#404040)?>> then\n            change x by ((x) * (-1))\n            change y by (-5)\n            if <(Jump) = [1]> then\n                set [x v] to [0]\n            end\n        end\n        change [y v] by (-1)\n        change y by (y)\n        if <<touching color (#808080)?> or <touching color (#404040)?>> then\n            change y by ((y) * (-1))\n            set [y v] to [0]\n        end\n        change y by (-1)\n        if <<touching color (#808080)?> or <touching color (#404040)?>> then\n            if <(Jump) = [1]> then\n                set [y v] to [10]\n                wait (pick random (1) to (3)) seconds\n                set [jump v] to [0]\n            end\n        end\n        change y by (1)\n    end\nend\n\nwhen flag clicked\nrepeat (100)\n    add [] to [niveau x v]\n    add [] to [niveau y v]\nend\nforever\n    if <(Pause?) = [0]> then\n        if <<(Move) = [3]> or <(Move) = [1]>> then\n            if <(y position) < ([y position v] of [perso v])> then\n                set [jump v] to [1]\n            else\n                set [jump v] to [0]\n            end\n            if <(x position) < ([x position v] of [perso v])> then\n                set [mouvement v] to [1]\n            else\n                set [mouvement v] to [2]\n            end\n        else\n            set [mouvement v] to (pick random (1) to (3))\n            if <(pick random (1) to (2)) = [1]> then\n                set [jump v] to [1]\n            end\n            wait (pick random (1) to (3)) seconds\n            set [jump v] to [0]\n        end\n        set [move v] to (pick random (1) to (3))\n        wait (5) seconds\n    end\nend\n\nwhen flag clicked\nforever\n    Niveau [14] X: [156] Y: [-94]\nend\n\nwhen I receive [défaite v]\nhide\n\n@Ennemi3\n\nwhen flag clicked\nforever\n    if <(Pause?) = [0]> then\n        if <<<touching (spike v)?> or <touching (unactive spike v)?>> or <key (r v) pressed?>> then\n            go to x: (item (Niveau) of [niveau x v]) y: (item (Niveau) of [niveau y v])\n        end\n    end\nend\n\ndefine Niveau (level) X: (x) Y: (y)\nreplace item (level) of [niveau x v] with (x)\nreplace item (level) of [niveau y v] with (y)\nif <(Niveau) = (level)> then\n    go to x: (x) y: (y)\n    show\nend\nwait until <not <(Niveau) = (level)>>\nhide\n\nwhen flag clicked\nset rotation style [left-right v]\ndelete all of [niveau x v]\ndelete all of [niveau y v]\nset [x v] to [0]\nset [y v] to [0]\nforever\n    if <(Pause?) = [0]> then\n        show\n        if <touching (_edge_ v)?> then\n            set [mouvement v] to (pick random (1) to (2))\n        end\n        if <(Mouvement) = [1]> then\n            set [x v] to [4]\n            point in direction (90)\n        end\n        if <(Mouvement) = [2]> then\n            set [x v] to [-4]\n            point in direction (-90)\n        end\n        set [x v] to ((x) * (0.9))\n        change x by (x)\n        if <<touching color (#808080)?> or <touching color (#404040)?>> then\n            change y by (1)\n        end\n        if <<touching color (#808080)?> or <touching color (#404040)?>> then\n            change y by (1)\n        end\n        if <<touching color (#808080)?> or <touching color (#404040)?>> then\n            change y by (1)\n        end\n        if <<touching color (#808080)?> or <touching color (#404040)?>> then\n            change y by (1)\n        end\n        if <<touching color (#808080)?> or <touching color (#404040)?>> then\n            change y by (1)\n        end\n        if <<touching color (#808080)?> or <touching color (#404040)?>> then\n            change x by ((x) * (-1))\n            change y by (-5)\n            if <(Jump) = [1]> then\n                set [x v] to [0]\n            end\n        end\n        change [y v] by (-1)\n        change y by (y)\n        if <<touching color (#808080)?> or <touching color (#404040)?>> then\n            change y by ((y) * (-1))\n            set [y v] to [0]\n        end\n        change y by (-1)\n        if <<touching color (#808080)?> or <touching color (#404040)?>> then\n            if <(Jump) = [1]> then\n                set [y v] to [10]\n                wait (pick random (1) to (3)) seconds\n                set [jump v] to [0]\n            end\n        end\n        change y by (1)\n    end\nend\n\nwhen flag clicked\nrepeat (100)\n    add [] to [niveau x v]\n    add [] to [niveau y v]\nend\nforever\n    if <(Pause?) = [0]> then\n        if <<(Move) = [3]> or <(Move) = [1]>> then\n            if <(y position) < ([y position v] of [perso v])> then\n                set [jump v] to [1]\n            else\n                set [jump v] to [0]\n            end\n            if <(x position) < ([x position v] of [perso v])> then\n                set [mouvement v] to [1]\n            else\n                set [mouvement v] to [2]\n            end\n        else\n            set [mouvement v] to (pick random (1) to (3))\n            if <(pick random (1) to (2)) = [1]> then\n                set [jump v] to [1]\n            end\n            wait (pick random (1) to (3)) seconds\n            set [jump v] to [0]\n        end\n        set [move v] to (pick random (1) to (3))\n        wait (5) seconds\n    end\nend\n\nwhen flag clicked\nforever\n    Niveau [14] X: [175] Y: [-94]\nend\n\nwhen I receive [défaite v]\nhide\n\n@Ennemi4\n\nwhen flag clicked\nforever\n    if <(Pause?) = [0]> then\n        if <<<touching (spike v)?> or <touching (unactive spike v)?>> or <key (r v) pressed?>> then\n            go to x: (item (Niveau) of [niveau x v]) y: (item (Niveau) of [niveau y v])\n        end\n    end\nend\n\ndefine Niveau (level) X: (x) Y: (y)\nreplace item (level) of [niveau x v] with (x)\nreplace item (level) of [niveau y v] with (y)\nif <(Niveau) = (level)> then\n    go to x: (x) y: (y)\n    show\nend\nwait until <not <(Niveau) = (level)>>\nhide\n\nwhen flag clicked\nset rotation style [left-right v]\ndelete all of [niveau x v]\ndelete all of [niveau y v]\nset [x v] to [0]\nset [y v] to [0]\nforever\n    if <(Pause?) = [0]> then\n        show\n        if <touching (_edge_ v)?> then\n            set [mouvement v] to (pick random (1) to (2))\n        end\n        if <(Mouvement) = [1]> then\n            set [x v] to [4]\n            point in direction (90)\n        end\n        if <(Mouvement) = [2]> then\n            set [x v] to [-4]\n            point in direction (-90)\n        end\n        set [x v] to ((x) * (0.9))\n        change x by (x)\n        if <<touching color (#808080)?> or <touching color (#404040)?>> then\n            change y by (1)\n        end\n        if <<touching color (#808080)?> or <touching color (#404040)?>> then\n            change y by (1)\n        end\n        if <<touching color (#808080)?> or <touching color (#404040)?>> then\n            change y by (1)\n        end\n        if <<touching color (#808080)?> or <touching color (#404040)?>> then\n            change y by (1)\n        end\n        if <<touching color (#808080)?> or <touching color (#404040)?>> then\n            change y by (1)\n        end\n        if <<touching color (#808080)?> or <touching color (#404040)?>> then\n            change x by ((x) * (-1))\n            change y by (-5)\n            if <(Jump) = [1]> then\n                set [x v] to [0]\n            end\n        end\n        change [y v] by (-1)\n        change y by (y)\n        if <<touching color (#808080)?> or <touching color (#404040)?>> then\n            change y by ((y) * (-1))\n            set [y v] to [0]\n        end\n        change y by (-1)\n        if <<touching color (#808080)?> or <touching color (#404040)?>> then\n            if <(Jump) = [1]> then\n                set [y v] to [10]\n                wait (pick random (1) to (3)) seconds\n                set [jump v] to [0]\n            end\n        end\n        change y by (1)\n    end\nend\n\nwhen flag clicked\nrepeat (100)\n    add [] to [niveau x v]\n    add [] to [niveau y v]\nend\nforever\n    if <(Pause?) = [0]> then\n        if <<(Move) = [3]> or <(Move) = [1]>> then\n            if <(y position) < ([y position v] of [perso v])> then\n                set [jump v] to [1]\n            else\n                set [jump v] to [0]\n            end\n            if <(x position) < ([x position v] of [perso v])> then\n                set [mouvement v] to [1]\n            else\n                set [mouvement v] to [2]\n            end\n        else\n            set [mouvement v] to (pick random (1) to (3))\n            if <(pick random (1) to (2)) = [1]> then\n                set [jump v] to [1]\n            end\n            wait (pick random (1) to (3)) seconds\n            set [jump v] to [0]\n        end\n        set [move v] to (pick random (1) to (3))\n        wait (5) seconds\n    end\nend\n\nwhen flag clicked\nforever\n    Niveau [14] X: [100] Y: [-94]\nend\n\nwhen I receive [défaite v]\nhide\n\n@Game Over Pixel\n\nwhen flag clicked\nhide\ngo to x: (0) y: (0)\nforever\n    if <(Ink) < [0]> then\n        broadcast (Défaite v) and wait\n    end\nend\n\nwhen I receive [défaite v]\nhide variable [ink show v]\nerase all\nshow\n\n@Thumbnail\n\nwhen flag clicked\ngo to x: (0) y: (0)\ngo to [front v] layer\nset [ghost v] effect to (100)\n\n