Platformer Part 1

Instructions:                                 PLATFORMER\n10 niveaux\nflèche droite       : avancer\nflèche gauche    : reculer\nflèche du haut    : sauter \n\nOrdinateur ou téléphone  / Computer or mobile

@Stage\n\nwhen flag clicked\nswitch backdrop to (jouer v)\n\n@Sprite1\n\nwhen flag clicked\ngo to x: (0) y: (125)\nshow\nforever\n    if <<touching (mouse-pointer v)?> and <mouse down?>> then\n        switch backdrop to (niveau v)\n        hide\n    end\nend\n\nwhen backdrop switches to [follow v]\nhide\n\n@Sprite2\n\nwhen flag clicked\nforever\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nrepeat (25)\n    change size by (-2)\n    switch costume to (2 v)\n    change [ghost v] effect by (10)\nend\ndelete this clone\n\nwhen backdrop switches to [niveau v]\nset [niveau v] to [1]\ngo to (map v)\ngo to x: (-196) y: (-60)\nset drag mode [not draggable v]\nswitch costume to (costume1 v)\nshow\nset [x v] to [0]\nset [y v] to [0]\nforever\n    if <<key (left arrow v) pressed?> or <<mouse down?> and <(mouse x) < (x position)>>> then\n        change [x v] by (-1.5)\n        switch costume to (costume2 v)\n    end\n    if <<key (right arrow v) pressed?> or <<mouse down?> and <(mouse x) > (x position)>>> then\n        change [x v] by (1.5)\n        switch costume to (costume1 v)\n    end\n    set [x v] to ((X) * (0.9))\n    change x by (X)\n    if <touching color (#35f500)?> then\n        change y by (1)\n        if <touching color (#3ef500)?> then\n            change y by (1)\n            if <touching color (#3ef500)?> then\n                change y by (1)\n                if <touching color (#3ef500)?> then\n                    change y by (1)\n                    if <touching color (#3ef500)?> then\n                        change y by (1)\n                        if <touching color (#3ef500)?> then\n                            change y by (1)\n                            if <touching color (#3ef500)?> then\n                                change y by (1)\n                                if <touching color (#3ef500)?> then\n                                    change y by (1)\n                                    if <touching color (#3ef500)?> then\n                                        change y by (1)\n                                        if <touching color (#3ef500)?> then\n                                            change x by ((X) * (-1))\n                                            change y by (-5)\n                                            if <<key (up arrow v) pressed?> or <<mouse down?> and <(mouse y) > (y position)>>> then\n                                                if <(X) > [0]> then\n                                                    set [x v] to [-5]\n                                                else\n                                                    set [x v] to [5]\n                                                end\n                                                set [y v] to [12]\n                                            else\n                                                set [x v] to [0]\n                                            end\n                                        end\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change [y v] by (-1)\n    change y by (Y)\n    if <touching color (#3ef500)?> then\n        change y by ((Y) * (-1))\n        set [y v] to [0]\n    end\n    change y by (-1)\n    if <touching color (#3ef500)?> then\n        if <<key (up arrow v) pressed?> or <<mouse down?> and <(mouse y) > (y position)>>> then\n            set [y v] to [12]\n        end\n    end\n    change y by (1)\n    if <(x position) > [235]> then\n        change [niveau v] by (1)\n        broadcast (message1 v)\n        go to x: (-196) y: (0)\n    end\n    if <(Niveau) = [11]> then\n        switch backdrop to (follow v)\n        stop [all v]\n    end\n    if <<touching color (#969696)?> or <touching color (#bfbfbf)?>> then\n        go to x: (-190) y: (0)\n    end\nend\n\nif <touching color (#cc8000)?> then\n    change y by (1)\n    if <touching color (#cc8000)?> then\n        change y by (1)\n        if <touching color (#cc8000)?> then\n            change y by (1)\n            if <touching color (#cc8000)?> then\n                change y by (1)\n                if <touching color (#cc8000)?> then\n                    change y by (1)\n                    if <touching color (#cc8000)?> then\n                        change y by (1)\n                        if <touching color (#cc8000)?> then\n                            change y by (1)\n                            if <touching color (#cc8000)?> then\n                                change y by (1)\n                                if <touching color (#cc8000)?> then\n                                    change y by (1)\n                                    if <touching color (#cc8000)?> then\n                                        change x by ((X) * (-1))\n                                        change y by (-5)\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen flag clicked\nhide\n\nwait (1) seconds\n\nwhen backdrop switches to [follow v]\nhide\n\ngo to x: (-196) y: (-60)\n\n@Niveaux\n\nwhen backdrop switches to [niveau v]\ngo to x: (-187) y: (164)\nshow\n\nwhen flag clicked\nset [niveau v] to [0]\nset size to (100) %\nhide\nforever\n    switch costume to (Niveau)\n    go to [front v] layer\nend\n\nwhen backdrop switches to [follow v]\nhide\n\nwhen I receive [message1 v]\nrepeat (15)\n    change size by (1)\nend\nwait (0.1) seconds\nrepeat (15)\n    change size by (-1)\nend\n\n@Map\n\nwhen flag clicked\nswitch costume to (costume1 v)\nhide\ngo to x: (0) y: (0)\n\nwhen backdrop switches to [niveau v]\nshow\nforever\n    switch costume to (Niveau)\nend\n\nwhen backdrop switches to [follow v]\nhide\n\n@Sprite4\n\nwhen flag clicked\nset [ghost v] effect to (20)\nhide\n\nwhen backdrop switches to [niveau v]\nforever\n    set y to (pick random (0) to (100))\n    go to x: (280) y: (y position)\n    go to [back v] layer\n    switch costume to (pick random (1) to (2))\n    wait (pick random (1) to (3)) seconds\n    show\n    create clone of (_myself_ v)\n    glide (pick random (15) to (20)) secs to x: (-250) y: (y position)\n    hide\nend\n\nwhen I start as a clone\nset y to (pick random (0) to (100))\ngo to x: (300) y: (y position)\ngo to [back v] layer\nswitch costume to (pick random (1) to (2))\nwait (pick random (5) to (10)) seconds\nglide (pick random (15) to (20)) secs to x: (-250) y: (y position)\ndelete this clone\n\nwhen backdrop switches to [follow v]\nhide\n\n@Sprite3\n\nwhen flag clicked\nset [niveau v] to [1]\nhide\nforever\n    if <(Niveau) = [6]> then\n        show\n        switch costume to (costume1 v)\n        go to x: (25) y: (-102)\n        point in direction (90)\n        repeat until <(Niveau) = [7]>\n            go to [back v] layer\n            glide (1) secs to x: (25) y: (-152)\n            if <(Niveau) = [7]> then\n                show\n                switch costume to (costume2 v)\n                go to x: (25) y: (-140)\n                repeat until <(Niveau) = [8]>\n                    go to [back v] layer\n                    turn right (10) degrees\n                end\n            end\n            wait (1) seconds\n            if <(Niveau) = [7]> then\n                show\n                switch costume to (costume2 v)\n                go to x: (25) y: (-140)\n                repeat until <(Niveau) = [8]>\n                    go to [back v] layer\n                    turn right (10) degrees\n                end\n            end\n            glide (1) secs to x: (25) y: (-102)\n            if <(Niveau) = [7]> then\n                show\n                switch costume to (costume2 v)\n                go to x: (25) y: (-140)\n                repeat until <(Niveau) = [8]>\n                    go to [back v] layer\n                    turn right (10) degrees\n                end\n            end\n            wait (1) seconds\n        end\n    else\n        hide\n    end\n    if <(Niveau) = [7]> then\n        show\n        switch costume to (costume2 v)\n        go to x: (25) y: (-140)\n        repeat until <(Niveau) = [8]>\n            go to [back v] layer\n            turn right (10) degrees\n        end\n    else\n        hide\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Niveau) = [6]> then\n        switch costume to (costume1 v)\n    end\n    if <(Niveau) = [7]> then\n        switch costume to (costume2 v)\n    end\n    if <(Niveau) = [8]> then\n        hide\n    end\nend\n\nrepeat until <(Niveau) = [8]>\n    go to [back v] layer\n    turn right (15) degrees\nend\n\nif  then\n    show\n    switch costume to (costume2 v)\n    go to x: (25) y: (-140)\nelse\n    hide\nend\n\n