A mechanic platformer

Instructions: _________Platformer Creator!_______\n\nInstructions:\n\nWhen creating a level:\n* Use arrow keys to move the screen\n* Click to place blocks\n* Click to delete blocks\n* Use A and D to change block type\n* Press "i" for information on a block before you place it\n* To find the save, delete, and load options, place your mouse over the "More" button at the bottom of the screen\n* Press "L" to load saved levels. The levels you save appear at the bottom of the list. Just copy the code, paste it in the load bar, erase everything after the list of numbers, then start the level.  \n\nWhen playing a level: \n* Use arrow keys to move the character\n* Click character to change its costume\n* Use the numbers 1-9 to set the time of day\n* If the character falls too far or comes in contact with a Hot Block, it will be set back to start

@Stage\n\n@MainCharacter\n\ndefine Controle - gauche et droite\nif <<key (right arrow v) pressed?> and <(@Animation_type) = [0]>> then\n    set [@direction v] to [droite]\n    set [@run v] to [1]\n    set [speedx v] to [5]\nelse\n    if <<key (left arrow v) pressed?> and <(@Animation_type) = [0]>> then\n        set [@run v] to [1]\n        set [@direction v] to [gauche]\n        set [speedx v] to [-5]\n    else\n        set [@run v] to [0]\n        set [@direction v] to []\n        set [speedx v] to [0]\n    end\nend\n\ndefine Controle - Jump\nif <<key (up arrow v) pressed?> and <not <(@Animation_type) = [101]>>> then\n    if <<(@Onground) > [0]> and <(jumping) = [0]>> then\n        set [@plateformetouched_y v] to [0]\n        set [@playerfx v] to [0]\n        set [@playerfy v] to [0]\n        set [@onground v] to [0]\n        set [jumping v] to [1]\n        set [@velocity v] to [15]\n        set [@animation_type v] to [0]\n        if <(item (1) of [@list_playsound v]) = [0]> then\n            replace item (1) of [@list_playsound v] with [1]\n        end\n    end\nelse\nend\nif <<<key (space v) pressed?> and <(@Animation_type) = [0]>> and <(@Onground) = [1]>> then\n    if <(item (2) of [@list_playsound v]) = [0]> then\n        replace item (2) of [@list_playsound v] with [1]\n    end\n    set [@animation_type v] to [102]\nend\n\ndefine tutolevel1\nthink []\nif <<(@scrollX) > [-20]> and <(@scrollX) < [100]>> then\n    if <(tutoCount) = [0]> then\n        think [Utiliser flêche Gauche ou droite pour se déplacer] for (0.5) seconds\n    end\nend\nif <(@scrollX) > [100]> then\n    if <(tutoCount) = [0]> then\n        change [tutocount v] by (1)\n    end\nend\nif <<(@scrollX) > [170]> and <(@scrollX) < [300]>> then\n    if <(tutoCount) = [1]> then\n        think [Diamant rouge = 1  jaune = 10 ] for (0.5) seconds\n    end\nend\nif <(@scrollX) > [300]> then\n    if <(tutoCount) = [1]> then\n        change [tutocount v] by (1)\n    end\nend\nif <<(@scrollX) > [430]> and <(@scrollX) < [600]>> then\n    if <(tutoCount) = [2]> then\n        think [Appuyer "haut" pour sauter!!] for (0.5) seconds\n    end\nend\nif <(@scrollX) > [600]> then\n    if <(tutoCount) = [2]> then\n        change [tutocount v] by (1)\n    end\nend\nif <<(@scrollX) > [1210]> and <(@scrollX) < [1400]>> then\n    if <(tutoCount) = [3]> then\n        think [cool!! Une vie supplémentaire!!] for (2) seconds\n    end\nend\nif <(@scrollX) > [1400]> then\n    if <(tutoCount) = [3]> then\n        change [tutocount v] by (1)\n    end\nend\nif <<(@scrollX) > [1950]> and <(@scrollX) < [2200]>> then\n    if <(tutoCount) = [4]> then\n        think [Ne tombes pas dans l'eau!] for (0.5) seconds\n    end\nend\nif <(@scrollX) > [2200]> then\n    if <(tutoCount) = [4]> then\n        change [tutocount v] by (1)\n    end\nend\nif <<(@scrollX) > [2205]> and <(@scrollX) < [2320]>> then\n    if <(tutoCount) = [5]> then\n        think [Je dois pouvoir utiliser la clef] for (0.5) seconds\n    end\nend\nif <(@scrollX) > [2320]> then\n    if <(tutoCount) = [5]> then\n        change [tutocount v] by (1)\n    end\nend\nif <<(@scrollX) > [2800]> and <(@scrollX) < [3000]>> then\n    if <(tutoCount) = [6]> then\n        think [Attention c'est dangereux] for (0.5) seconds\n    end\nend\nif <(@scrollX) > [3000]> then\n    if <(tutoCount) = [6]> then\n        change [tutocount v] by (1)\n    end\nend\nif <<(@scrollX) > [1600]> and <(@scrollX) < [1850]>> then\n    if <(tutoCount) = [7]> then\n        think [Cooll ! 50 diamants] for (0.5) seconds\n    end\nend\nif <(@scrollX) > [1850]> then\n    if <(tutoCount) = [7]> then\n        change [tutocount v] by (1)\n    end\nend\n\ndefine resetVariableLevel\nclearList\nset [tutocount v] to [0]\nset [g_debugground v] to [1]\nset [@calquesactif v] to [1]\nset [@isherodied v] to [false]\nset [@scrollx v] to [0]\nset [@scrolly v] to [0]\nset [@score v] to [0]\nset [@onground v] to [0]\nset [@start v] to [0]\nset [direction v] to [0]\nset [@velocity v] to [0]\nset [@gravity v] to [-1]\nset [@spawnx v] to [0]\nset [@spawny v] to [0]\nset [jumping v] to [0]\n\nwhen I receive [onachoisilelevel v]\nset [@isloadingdone v] to [false]\nset [@numero_scene v] to [2]\nbroadcast (LoadingOn v)\nif <(@level) < [5]> then\n    switch backdrop to (background1 v)\nelse\n    switch backdrop to (bg_soleil1 v)\nend\nresetVariableLevel\nswitch costume to (petithero v)\nset size to (50) %\nshow\nbroadcast (Create_Scroll1 v)\n\nwhen I receive [startisok v]\nset [ghost v] effect to (100)\nset [@fps v] to [0]\nset [@frame v] to [0]\nset [@animation_type v] to [0]\nset [@scrollx v] to [0]\nset [@scrolly v] to [0]\nset [@timer v] to [0]\nreset timer\nbroadcast (StartMusique v)\nrepeat until <(@isHeroDied) = [true]>\n    if <<(@numero_scene) > [1 ]> and <(@start) = [1]>> then\n        set [@timer v] to (timer)\n        change [@frame v] by (1)\n        set [@startposx v] to (x position)\n        set [@startposy v] to (y position)\n        broadcast (ChangeTimer v)\n        broadcast (TopClavier v)\n        broadcast (TopMenu v)\n        broadcast (TopAnimationPlateforme v)\n        broadcast (TopDetectionSprite v)\n        broadcast (TopDetectionFinal v)\n        broadcast (Topdetection v)\n        broadcast (calculduscroll v)\n        broadcast (TopMvtGround v)\n        broadcast (TopMvtVground v)\n        broadcast (TopMvtScroll v)\n        broadcast (TopMvtSprite v)\n        broadcast (TopMvtKiller v)\n        broadcast (TopMvtEnnemis v)\n        broadcast (TopMvtPlateforme v)\n        broadcast (TopMvtDécors&Lutin v)\n        broadcast (TopAnimationMonstre v)\n        broadcast (TopAnimation v)\n        broadcast (Play_Sound v)\n        set [@fps v] to (round ((@frame) / (timer)))\n    end\nend\n\nwhen I receive [calculduscroll v]\nset [@adjustscrollx v] to ((x position) - (@startPosX))\nif <(x position) > [-5]> then\n    change [@scrollx v] by (@adjustScrollX)\n    change x by ((0) - (@adjustScrollX))\nend\nif <<(x position) < [0]> and <(@scrollX) > [0]>> then\n    change [@scrollx v] by (@adjustScrollX)\n    change x by ((0) - (@adjustScrollX))\nend\nif <(y position) > [-1]> then\n    if <(@startPosY) > [-1]> then\n        set [@adjustscrolly v] to ((y position) - (@startPosY))\n    else\n        set [@adjustscrolly v] to (y position)\n    end\nend\nif <(y position) < [0]> then\n    if <(@startPosY) < [0]> then\n        set [@adjustscrolly v] to ((y position) - (@startPosY))\n    else\n        set [@adjustscrolly v] to (y position)\n    end\nend\nif <(y position) > [0]> then\n    change [@scrolly v] by (@AdjustScrollY)\n    change y by ((0) - (@AdjustScrollY))\nend\nif <<(y position) < [0]> and <(@scrollY) > [0]>> then\n    change y by ((0) - (@AdjustScrollY))\n    change [@scrolly v] by (@AdjustScrollY)\nend\n\ndefine Control - M\nif <key (m v) pressed?> then\n    if <(@IsMenuOn) = [0]> then\n        set [@ismenuon v] to [1]\n    else\n    end\nend\n\ndefine resetheroposition\nhide\nif <(@level) = [2]> then\n    go to x: (-90) y: (-60)\nelse\n    go to x: (-90) y: (-80)\nend\n\ndefine checkhitground <>\nrepeat until <not <touching (virtualground1 v)?>>\n    if <isjumping?> then\n        change y by (-1)\n        set [@velocity v] to [0]\n    else\n        change y by (1)\n        set [@velocity v] to [0]\n        set [@onground v] to [1]\n        if <(jumping) = [1]> then\n            set [jumping v] to [0]\n            if <(item (5) of [@list_playsound v]) = [0]> then\n                replace item (5) of [@list_playsound v] with [1]\n            end\n        end\n    end\nend\n\ndefine clearList\ndelete (all) of [liste_sprite_fx v]\ndelete (all) of [list_sprite_x v]\ndelete (all) of [liste_sprite_y v]\ndelete (all) of [list_rubis_x v]\ndelete (all) of [list_rubis_y v]\ndelete (all) of [liste_rubis_fx v]\ndelete (all) of [list_rubis_type v]\nInit_Sound\n\ndefine None\nchange x by (speedx)\nset [deviation v] to [0]\nrepeat until <<(Deviation) = [8]> or <not <touching (v_plateforme v)?>>>\n    change y by (1)\n    change [deviation v] by (1)\nend\nif <(Deviation) = [8]> then\n    change x by (() - (speedx))\n    change y by (() - (Deviation))\nend\nset [deviation v] to [0]\nrepeat until <<(Deviation) = [8]> or <not <touching (virtualground1 v)?>>>\n    change y by (1)\n    change [deviation v] by (1)\nend\nif <(Deviation) = [8]> then\n    change x by (() - (speedx))\n    change y by (() - (Deviation))\nend\n\ndefine Init_Sound\ndelete (all) of [@list_playsound v]\nset [boucle_sound v] to [1]\nrepeat (20)\n    insert [0] at (Boucle_Sound) of [@list_playsound v] \n    change [boucle_sound v] by (1)\nend\n\nwhen I receive [herodied v]\nresetheroposition\n\nwhen I receive [topdetection v]\nif <<(jumping) = [0]> and <(@run) = [0]>> then\n    change [speedx v] by (@PlayerFx)\nend\ncheckhitground <(@velocity) > [0]>\nset [@oldposy v] to (y position)\ncheckhitplateforme\nMoveHitbox (SpeedX) (1)\nif <<(y position) < [-180]> or <<touching (ennemis v)?> or <touching (killer-sprite v)?>>> then\n    if <(y position) < [-180]> then\n        if <(item (3) of [@list_playsound v]) = [0]> then\n            replace item (3) of [@list_playsound v] with [1]\n        end\n        set [@scrollx v] to (@spawnX)\n        if <(@spawnY) < [0]> then\n            set y to (@spawnY)\n            set [@scrolly v] to [0]\n        else\n            set y to (0)\n            set [@scrolly v] to (@spawnY)\n        end\n        change [@herolife v] by (-1)\n        if <(@HeroLife) = [0]> then\n            broadcast (herodied v)\n        end\n        broadcast (changescore v)\n    end\nend\n\ndefine checkhitplateforme\nrepeat until <not <touching (v_plateforme v)?>>\n    if <(@oldPosy) > (@plateformetouched_Y)> then\n        change y by (1)\n        set [@velocity v] to [0]\n        set [@onground v] to [1]\n        if <(jumping) = [1]> then\n            set [jumping v] to [0]\n            if <(item (5) of [@list_playsound v]) = [0]> then\n                replace item (5) of [@list_playsound v] with [1]\n            end\n        end\n    else\n        if <<(@PlayerFx) = [0]> and <(@PlayerFy) = [0]>> then\n            if <((100) + (@oldPosy)) > (@plateformetouched_Y)> then\n                change y by (1)\n                set [@velocity v] to [0]\n                set [@onground v] to [1]\n            else\n                change y by (-1)\n                set [@velocity v] to [-1]\n            end\n        else\n            if <((20) + (@oldPosy)) > (@plateformetouched_Y)> then\n                change y by (1)\n                set [@velocity v] to [0]\n                set [@onground v] to [1]\n            else\n                change y by (-1)\n                set [@velocity v] to [-1]\n            end\n        end\n    end\nend\n\nwhen I receive [clear_all_sprite v]\nresetheroposition\n\nwhen I receive [catontreeended v]\nset [jumping v] to [false]\nset [@start v] to [0]\nset [@numero_scene v] to [0]\nset [@score v] to [0]\nset [@scrolly v] to [0]\nbroadcast (PressSpace v)\n\nwhen I receive [topclavier v]\nControle - Jump\nControle - gauche et droite\nControl - M\nif <<(@velocity) < [4]> or <key (up arrow v) pressed?>> then\n    change [@velocity v] by (@gravity)\nelse\n    change [@velocity v] by ((@gravity) * (2))\nend\nif <(@PlayerFy) > [0]> then\n    change y by ((@gravity) - (@PlayerFy))\nelse\n    change y by (@velocity)\nend\nif <(@velocity) < [-4]> then\n    set [@onground v] to [0]\nend\nif <(@velocity) < [-2]> then\n    set [@playerfx v] to [0]\n    set [@playerfy v] to [0]\n    set [@plateformetouched_y v] to [0]\nend\n\n@presstocontinue\n\nwhen backdrop switches to [level_choice v]\nhide\n\nwhen I receive [pressspace v]\nset [spacebarrepressed v] to [false]\nset [boucle_title v] to [0]\nshow\nswitch costume to (presstocontinue v)\nrepeat until <(spaceBarrePressed) = [true]>\n    if <not <key (space v) pressed?>> then\n        set [spacebarrepressed v] to [false]\n    else\n        set [spacebarrepressed v] to [true]\n    end\n    change [boucle_title v] by (1)\n    if <([floor v] of ((Boucle_Title) mod (30)) ) < [20]> then\n        switch costume to (presstocontinue v)\n    else\n        switch costume to (presstocontinue2 v)\n    end\nend\nset [@numero_scene v] to [1   ]\nset [spacebarrepressed v] to [false]\nhide\nswitch backdrop to (level_choice v)\nbroadcast (selectlevel v)\n\nwhen backdrop switches to [background1 v]\nhide\n\n@sprite\n\nwhen I receive [create_sprite v]\nset [rubis_loopclone v] to [1]\nset [compteur y v] to [0]\nset [@iscleffound v] to [0]\nshow\npoint in direction (90)\nset size to (75) %\nif <(@level) = [1]> then\n    loadlevel1Rubis\nend\nif <(@level) = [2]> then\n    loadlevel2Rubis\nend\nif <(@level) = [3]> then\n    loadlevel3Rubis\nend\nif <(@level) = [4]> then\n    loadlevel4Rubis\nend\nif <(@level) = [5]> then\n    loadlevel5Rubis\nend\nrepeat (length of [list_rubis_x v])\n    createRubisClone (item (Rubis_loopclone) of [list_rubis_x v]) (item (Rubis_loopclone) of [list_rubis_y v]) (item (Rubis_loopclone) of [list_rubis_type v]) (0)\nend\ngo to x: (6000) y: (0)\nhide\nbroadcast (Create_KillerSprite v)\n\nwhen I receive [topdetectionsprite v]\nif <touching (maincharacter v)?> then\n    if <(LutinType) = [12]> then\n        if <(@IsclefFound) = [1]> then\n            if <(Rubis_AnimationTemp) = [0]> then\n                change [@score v] by (50)\n                broadcast (changescore v)\n                if <(item (6) of [@list_playsound v]) = [0]> then\n                    replace item (6) of [@list_playsound v] with [1]\n                end\n                set [rubis_animationtemp v] to [1]\n            end\n        else\n            broadcast (ineedthekey v)\n        end\n    end\n    if <(LutinType) = [2]> then\n        change [@herolife v] by (1)\n        broadcast (changescore v)\n        if <(item (7) of [@list_playsound v]) = [0]> then\n            replace item (7) of [@list_playsound v] with [1]\n        end\n        jouSonetCache\n    end\n    if <(LutinType) = [1]> then\n        change [@score v] by (1)\n        broadcast (changescore v)\n        if <(item (8) of [@list_playsound v]) = [0]> then\n            replace item (8) of [@list_playsound v] with [1]\n        end\n        jouSonetCache\n    end\n    if <(LutinType) = [3]> then\n        change [@score v] by (10)\n        broadcast (changescore v)\n        if <(item (9) of [@list_playsound v]) = [0]> then\n            replace item (9) of [@list_playsound v] with [1]\n        end\n        jouSonetCache\n    end\n    if <(LutinType) = [4]> then\n        set [@iscleffound v] to [1]\n        broadcast (KeyIsFound v)\n        if <(item (10) of [@list_playsound v]) = [0]> then\n            replace item (10) of [@list_playsound v] with [1]\n        end\n        jouSonetCache\n    end\n    if <(LutinType) = [27]> then\n        if <(costume [number v]) = [27]> then\n            if <(item (11) of [@list_playsound v]) = [0]> then\n                replace item (11) of [@list_playsound v] with [1]\n            end\n            set [@spawnx v] to (@scrollX)\n            if <(@scrollY) > [0]> then\n                set [@spawny v] to ((@scrollY) + (50))\n            else\n                set [@spawny v] to (y position)\n            end\n            switch costume to (totem tiki v)\n        end\n    end\nend\nif <touching (animation v)?> then\n    if <<(LutinType) = [5]> and <(@Animation_type) = [103]>> then\n        if <(Rubis_AnimationTemp) = [0]> then\n            set [rubis_animationtemp v] to [1]\n        end\n    end\nend\n\ndefine loadlevel1Rubis\nDefine_Rubis_Values (1) (645) (-20) (1)\nDefine_Rubis_Values (2) (680) (-40) (1)\nDefine_Rubis_Values (3) (715) (-60) (1)\nDefine_Rubis_Values (4) (1390) (-90) (1)\nDefine_Rubis_Values (5) (1425) (-100) (1)\nDefine_Rubis_Values (6) (1460) (-100) (1)\nDefine_Rubis_Values (7) (1495) (-90) (1)\nDefine_Rubis_Values (8) (750) (-90) (1)\nDefine_Rubis_Values (9) (170) (-90) (1)\nDefine_Rubis_Values (10) (210) (-90) (1)\nDefine_Rubis_Values (11) (250) (-90) (1)\nDefine_Rubis_Values (12) (610) (-20) (1)\nDefine_Rubis_Values (13) (2215) (-60) (1)\nDefine_Rubis_Values (14) (2250) (-30) (1)\nDefine_Rubis_Values (15) (2250) (-90) (1)\nDefine_Rubis_Values (16) (2285) (-60) (1)\nDefine_Rubis_Values (17) (2525) (-60) (1)\nDefine_Rubis_Values (18) (2560) (-30) (1)\nDefine_Rubis_Values (19) (2560) (-90) (1)\nDefine_Rubis_Values (20) (2595) (-60) (1)\nDefine_Rubis_Values (21) (290) (-80) (3)\nDefine_Rubis_Values (22) (2560) (-60) (3)\nDefine_Rubis_Values (23) (2375) (-60) (3)\nDefine_Rubis_Values (24) (1745) (-120) (12)\nDefine_Rubis_Values (25) (1210) (-90) (2)\nDefine_Rubis_Values (26) (2250) (-60) (4)\n\ndefine loadlevel2Rubis\nDefine_Rubis_Values (1) (480) (-40) (1)\nDefine_Rubis_Values (2) (540) (-10) (1)\nDefine_Rubis_Values (3) (600) (-20) (1)\nDefine_Rubis_Values (4) (1150) (-60) (1)\nDefine_Rubis_Values (5) (1050) (-60) (1)\nDefine_Rubis_Values (6) (1100) (-60) (1)\nDefine_Rubis_Values (7) (1375) (10) (1)\nDefine_Rubis_Values (8) (1400) (-10) (1)\nDefine_Rubis_Values (9) (1425) (-30) (1)\nDefine_Rubis_Values (10) (2000) (-20) (1)\nDefine_Rubis_Values (11) (2525) (-40) (1)\nDefine_Rubis_Values (12) (2550) (-20) (1)\nDefine_Rubis_Values (13) (2550) (-60) (1)\nDefine_Rubis_Values (14) (2575) (-40) (1)\nDefine_Rubis_Values (15) (3075) (-20) (1)\nDefine_Rubis_Values (16) (3150) (30) (1)\nDefine_Rubis_Values (17) (3225) (-20) (1)\nDefine_Rubis_Values (18) (3850) (-40) (1)\nDefine_Rubis_Values (19) (3950) (0) (1)\nDefine_Rubis_Values (20) (4050) (30) (1)\nDefine_Rubis_Values (21) (1760) (-60) (3)\nDefine_Rubis_Values (22) (2370) (-40) (3)\nDefine_Rubis_Values (23) (2950) (-20) (3)\nDefine_Rubis_Values (24) (3555) (146) (12)\nDefine_Rubis_Values (25) (1000) (100) (2)\nDefine_Rubis_Values (26) (3325) (-20) (2)\nDefine_Rubis_Values (27) (2950) (150) (4)\nDefine_Rubis_Values (28) (3315) (-23) (5)\nDefine_Rubis_Values (29) (2950) (-23) (5)\nDefine_Rubis_Values (30) (2170) (-99) (27)\n\ndefine loadlevel3Rubis\nDefine_Rubis_Values (1) (1000) (10) (1)\nDefine_Rubis_Values (2) (1050) (60) (1)\nDefine_Rubis_Values (3) (1125) (80) (1)\nDefine_Rubis_Values (4) (1550) (10) (1)\nDefine_Rubis_Values (5) (1650) (-30) (1)\nDefine_Rubis_Values (6) (1750) (-70) (1)\nDefine_Rubis_Values (7) (2275) (-40) (1)\nDefine_Rubis_Values (8) (2325) (10) (1)\nDefine_Rubis_Values (9) (2375) (60) (1)\nDefine_Rubis_Values (10) (2700) (110) (1)\nDefine_Rubis_Values (11) (2750) (160) (1)\nDefine_Rubis_Values (12) (2800) (110) (1)\nDefine_Rubis_Values (13) (4450) (30) (1)\nDefine_Rubis_Values (14) (4475) (10) (1)\nDefine_Rubis_Values (15) (4500) (-10) (1)\nDefine_Rubis_Values (16) (5050) (-90) (1)\nDefine_Rubis_Values (17) (5100) (-90) (1)\nDefine_Rubis_Values (18) (5150) (-60) (1)\nDefine_Rubis_Values (19) (5200) (-90) (1)\nDefine_Rubis_Values (20) (5250) (-90) (1)\nDefine_Rubis_Values (21) (1944) (110) (3)\nDefine_Rubis_Values (22) (3600) (-15) (3)\nDefine_Rubis_Values (23) (4204) (50) (3)\nDefine_Rubis_Values (24) (4550) (150) (12)\nDefine_Rubis_Values (25) (2830) (-100) (2)\nDefine_Rubis_Values (26) (2495) (-90) (4)\nDefine_Rubis_Values (27) (2840) (-95) (5)\nDefine_Rubis_Values (28) (3150) (-116) (27)\n\ndefine loadlevel4Rubis\nDefine_Rubis_Values (1) (990) (-63) (1)\nDefine_Rubis_Values (2) (1050) (0) (1)\nDefine_Rubis_Values (3) (1120) (0) (1)\nDefine_Rubis_Values (4) (1180) (50) (1)\nDefine_Rubis_Values (5) (1230) (50) (1)\nDefine_Rubis_Values (6) (1870) (140) (1)\nDefine_Rubis_Values (7) (1730) (210) (1)\nDefine_Rubis_Values (8) (1870) (280) (1)\nDefine_Rubis_Values (9) (1730) (350) (1)\nDefine_Rubis_Values (10) (1870) (420) (1)\nDefine_Rubis_Values (11) (2910) (-43) (1)\nDefine_Rubis_Values (12) (2960) (-43) (1)\nDefine_Rubis_Values (13) (3010) (-43) (1)\nDefine_Rubis_Values (14) (3060) (-43) (1)\nDefine_Rubis_Values (15) (3250) (300) (1)\nDefine_Rubis_Values (16) (3280) (325) (1)\nDefine_Rubis_Values (17) (3310) (350) (1)\nDefine_Rubis_Values (18) (3730) (150) (1)\nDefine_Rubis_Values (19) (3760) (180) (1)\nDefine_Rubis_Values (20) (3790) (150) (1)\nDefine_Rubis_Values (21) (2560) (-70) (3)\nDefine_Rubis_Values (22) (2980) (80) (3)\nDefine_Rubis_Values (23) (4200) (305) (3)\nDefine_Rubis_Values (24) (2290) (-110) (12)\nDefine_Rubis_Values (25) (1415) (510) (2)\nDefine_Rubis_Values (26) (70) (415) (4)\nDefine_Rubis_Values (27) (1940) (-85) (5)\nDefine_Rubis_Values (28) (1990) (-85) (5)\nDefine_Rubis_Values (29) (3160) (228) (27)\n\ndefine loadlevel5Rubis\nDefine_Rubis_Values (1) (400) (165) (1)\nDefine_Rubis_Values (2) (350) (165) (1)\nDefine_Rubis_Values (3) (300) (165) (1)\nDefine_Rubis_Values (4) (400) (400) (1)\nDefine_Rubis_Values (5) (450) (400) (1)\nDefine_Rubis_Values (6) (500) (400) (1)\nDefine_Rubis_Values (7) (1080) (110) (1)\nDefine_Rubis_Values (8) (1155) (20) (1)\nDefine_Rubis_Values (9) (1395) (550) (1)\nDefine_Rubis_Values (10) (1445) (530) (1)\nDefine_Rubis_Values (11) (1495) (550) (1)\nDefine_Rubis_Values (12) (2200) (610) (1)\nDefine_Rubis_Values (13) (2225) (650) (1)\nDefine_Rubis_Values (14) (2250) (670) (1)\nDefine_Rubis_Values (15) (785) (800) (1)\nDefine_Rubis_Values (16) (785) (700) (1)\nDefine_Rubis_Values (17) (785) (750) (1)\nDefine_Rubis_Values (18) (3220) (500) (1)\nDefine_Rubis_Values (19) (3220) (550) (1)\nDefine_Rubis_Values (20) (3220) (600) (1)\nDefine_Rubis_Values (21) (2760) (310) (1)\nDefine_Rubis_Values (22) (2700) (300) (1)\nDefine_Rubis_Values (23) (2640) (280) (1)\nDefine_Rubis_Values (24) (1820) (480) (3)\nDefine_Rubis_Values (25) (780) (150) (3)\nDefine_Rubis_Values (26) (4200) (305) (3)\nDefine_Rubis_Values (27) (1155) (-70) (3)\nDefine_Rubis_Values (28) (-130) (775) (12)\nDefine_Rubis_Values (29) (1410) (-95) (2)\nDefine_Rubis_Values (30) (2155) (320) (2)\nDefine_Rubis_Values (31) (910) (835) (4)\nDefine_Rubis_Values (32) (910) (828) (5)\nDefine_Rubis_Values (33) (1410) (-85) (5)\nDefine_Rubis_Values (34) (2155) (328) (5)\nDefine_Rubis_Values (35) (1935) (512) (27)\nDefine_Rubis_Values (36) (2680) (725) (1)\nDefine_Rubis_Values (37) (2680) (775) (1)\nDefine_Rubis_Values (38) (2680) (825) (1)\nDefine_Rubis_Values (39) (1960) (296) (1)\nDefine_Rubis_Values (40) (1900) (296) (1)\nDefine_Rubis_Values (41) (1820) (296) (1)\nDefine_Rubis_Values (42) (1745) (296) (1)\nDefine_Rubis_Values (43) (1680) (296) (1)\n\ndefine jouSonetCache\nhide\ndelete this clone\n\ndefine None\nset size to (100) %\nset [ghost v] effect to (0)\nif <(type) = [5]> then\nelse\n    set size to (75) %\nend\nset [rubis-x v] to (x)\nset [rubis-y v] to (y)\nset [lutintype v] to (type)\nset [rubis_animationtemp v] to (delay)\nswitch costume to (type)\nchange [rubis_loopclone v] by (1)\ncreate clone of (_myself_ v)\n\ndefine None\nadd (posx) to [list_rubis_x v]\nadd (posy) to [list_rubis_y v]\nadd (type) to [list_rubis_type v]\n\ndefine None\ngo to x: (x) y: (y)\n\nwhen I receive [topmvtsprite v]\nposition x;y ((Rubis-X) - (@scrollX)) ((Rubis-Y) - (@scrollY))\nif <(LutinType) < [5]> then\n    if <(compteur y) < [6]> then\n        change [rubis-y v] by (1)\n    end\n    if <(compteur y) > [5]> then\n        change [rubis-y v] by (-1)\n    end\n    if <(compteur y) = [10]> then\n        set [compteur y v] to [0]\n    end\n    change [compteur y v] by (1)\nend\nif <<(LutinType) = [5]> and <(Rubis_AnimationTemp) > [0]>> then\n    if <(costume [number v]) = [11]> then\n        delete this clone\n    end\n    change [rubis_animationtemp v] by ((1) / (3))\n    switch costume to ([floor v] of (((Rubis_AnimationTemp) mod (7)) + (5)) )\nend\nif <<(LutinType) = [12]> and <(Rubis_AnimationTemp) > [0]>> then\n    if <(costume [number v]) = [25]> then\n        delete this clone\n    end\n    change [rubis_animationtemp v] by ((1) / (3))\n    switch costume to ([floor v] of (((Rubis_AnimationTemp) mod (14)) + (12)) )\nend\n\nwhen I receive [clear_all_sprite v]\nhide\ndelete this clone\n\n@contour\n\nwhen I receive [create_contour v]\ngo to x: (0) y: (0)\nswitch costume to (costume2 v)\nshow\nbroadcast (Create_Score v)\n\nwhen I receive [clear_all_sprite v]\nhide\n\n@unites\n\nwhen I receive [create_chiffres v]\ngo to [front v] layer\nshow\ngo to x: (-138) y: (154)\nswitch costume to (0 v)\nset size to (60) %\nset [name v] to [1]\ncreate clone of (_myself_ v)\ngo to x: (-151) y: (154)\nset size to (60) %\nswitch costume to (0 v)\nset [name v] to [2]\ncreate clone of (_myself_ v)\ngo to x: (-164) y: (154)\nswitch costume to (0 v)\nset size to (60) %\nset [name v] to [3]\ncreate clone of (_myself_ v)\ngo to x: (190) y: (154)\nswitch costume to (0 v)\nset size to (60) %\nset [name v] to [4]\ncreate clone of (_myself_ v)\ngo to x: (177) y: (154)\nswitch costume to (0 v)\nset size to (60) %\nset [name v] to [5]\ncreate clone of (_myself_ v)\ngo to x: (54) y: (154)\nswitch costume to (0 v)\nset size to (60) %\nset [name v] to [6]\ncreate clone of (_myself_ v)\ngo to x: (68) y: (154)\nswitch costume to (0 v)\nset size to (60) %\nset [name v] to [7]\ncreate clone of (_myself_ v)\ngo to x: (82) y: (154)\nswitch costume to (0 v)\nset size to (60) %\nset [name v] to [8]\ncreate clone of (_myself_ v)\nhide\nbroadcast (changescore v)\nbroadcast (Create_Animation v)\nset [@isloadingdone v] to [true]\n\nwhen I receive [clear_all_sprite v]\nhide\ndelete this clone\n\nwhen I receive [changescore v]\nif <(name) = [1]> then\n    switch costume to (((@score) mod (10)) + (1))\nend\nif <(name) = [2]> then\n    switch costume to (((((@score) - ((@score) mod (10))) mod (100)) / (10)) + (1))\nend\nif <(name) = [3]> then\n    switch costume to ((((@score) - ((@score) mod (100))) / (100)) + (1))\nend\nif <(name) = [4]> then\n    switch costume to (((@HeroLife) mod (10)) + (1))\nend\nif <(name) = [5]> then\n    switch costume to (((((@HeroLife) - ((@HeroLife) mod (10))) mod (100)) / (10)) + (1))\nend\n\nwhen I receive [selectlevel v]\nshow\nset size to (100) %\ngo to [front v] layer\ngo to x: (-170) y: (50)\nswitch costume to (1 v)\ncreate clone of (_myself_ v)\nif <(@levelmax) > [1]> then\n    go to x: (-75) y: (50)\n    switch costume to (2 v)\n    create clone of (_myself_ v)\nend\nif <(@levelmax) > [2]> then\n    go to x: (25) y: (50)\n    switch costume to (3 v)\n    create clone of (_myself_ v)\nend\nif <(@levelmax) > [3]> then\n    go to x: (120) y: (50)\n    switch costume to (4 v)\n    create clone of (_myself_ v)\nend\nif <(@levelmax) > [4]> then\n    go to x: (-170) y: (-40)\n    switch costume to (5 v)\n    create clone of (_myself_ v)\nend\n\nwhen I receive [changetimer v]\nset [@timer v] to ([floor v] of (@Timer) )\nif <(name) = [8]> then\n    switch costume to (((@Timer) mod (10)) + (1))\nend\nif <(name) = [7]> then\n    switch costume to (((((@Timer) - ((@Timer) mod (10))) mod (100)) / (10)) + (1))\nend\nif <(name) = [6]> then\n    switch costume to ((((@Timer) - ((@Timer) mod (100))) / (100)) + (1))\nend\n\n@score\n\nwhen I receive [create_score v]\ngo to [front v] layer\nshow\nset [type v] to [life]\ngo to x: (137) y: (155)\nset size to (60) %\nswitch costume to (life v)\ncreate clone of (_myself_ v)\nset [type v] to [key]\nturn right (90) degrees\ngo to x: (-51) y: (155)\nset size to (80) %\nswitch costume to (key v)\nhide\ncreate clone of (_myself_ v)\nset [type v] to [montre]\nturn left (90) degrees\ngo to x: (30) y: (155)\nset size to (40) %\nswitch costume to (montre v)\nshow\ncreate clone of (_myself_ v)\nset [type v] to [score]\nset size to (60) %\ngo to x: (-201) y: (154)\nswitch costume to (score v)\nbroadcast (Create_Chiffres v)\n\nwhen I receive [clear_all_sprite v]\nhide\ndelete this clone\n\nwhen I receive [keyisfound v]\nif <(type) = [key]> then\n    show\nend\n\n@CadreMenu2\n\nwhen flag clicked\nhide\n\nwhen I receive [create_cadrelevel v]\ngo to x: (0) y: (0)\nswitch costume to (@level)\nset [ghost v] effect to (10)\nshow\nbroadcast (Create_Contour v)\n\nwhen I receive [topdetection v]\nif <(timer) > [2]> then\n    hide\nend\n\n@tableauFinal\n\nwhen I receive [clear_all_sprite v]\nhide\n\nwhen I receive [herodied v]\nset [@isfinalok v] to [true]\nswitch costume to (game over v)\nshow\ngo to [front v] layer\nset size to (15) %\nrepeat (6)\n    change size by (15)\nend\nset [@run v] to [0]\nset [@start v] to [2]\nset [@levelmax v] to [1]\nset [@herolife v] to [3]\ndelete (all) of [level_star v]\nrepeat (8)\n    add [0] to [level_star v]\nend\n\nwhen [space v] key pressed\nif <<<(@start) = [2]> and <(@numero_scene) = [2]>> and <(@IsFinalOk) = [true]>> then\n    set [@numero_scene v] to [1]\n    set [@calquesactif v] to [1]\n    broadcast (clear_all_sprite v)\n    broadcast (selectlevel v)\n    hide\n    switch backdrop to (level_choice v)\n    stop all sounds\nend\n\nwhen I receive [topdetectionfinal v]\nset [@isinitvariabledone v] to [true]\nif <(@level) = [1]> then\n    set [endxlevel v] to [3370]\n    set [endylevel v] to [0]\nend\nif <(@level) = [2 ]> then\n    set [endxlevel v] to [4320]\n    set [endylevel v] to [0]\nend\nif <(@level) = [3]> then\n    set [endxlevel v] to [6720]\n    set [endylevel v] to [0]\nend\nif <(@level) = [4]> then\n    set [endxlevel v] to [4320]\n    set [endylevel v] to [0]\nend\nif <(@level) = [5]> then\n    set [endxlevel v] to [4320]\n    set [endylevel v] to [0]\nend\nif <<<([abs v] of (@scrollX) ) > (EndXLevel)> and <(@start) = [1]>> and <(@Animation_type) < [200]>> then\n    set [@animation_type v] to [200]\nend\n\nwhen I receive [show_finalcount_down v]\nset [@isfinalok v] to [false]\nswitch costume to (tableaufinal v)\nset size to (100) %\nshow\ngo to [front v] layer\nset [@run v] to [0]\nset [@start v] to [2]\nif <(@level) = (@levelmax)> then\n    change [@levelmax v] by (1)\n    if <(@levelmax) > [5]> then\n        set [@levelmax v] to [5]\n    end\nend\nbroadcast (AfficheRubis v)\nset [nbr_animation v] to [0]\nset [@animation_type v] to [0]\n\n@//scroll1\n\nif  then\nend\n\nwhen I receive [clear_all_sprite v]\nhide\ndelete this clone\n\ndefine None\ngo to x: (x) y: (y)\nset [positionx v] to (x)\nset [positiony v] to (y)\ncreate clone of (_myself_ v)\n\ndefine None\ngo to x: (x) y: (y)\n\nwhen I receive [create_scroll1 v]\nshow\nif <(@level) < [5]> then\n    switch costume to (scrolling2 v)\nelse\n    switch costume to (sans titre-1 v)\nend\ncreateScroll2Clone (0) (30)\npoint in direction (90)\ncreateScroll2Clone (479) (30)\npoint in direction (-90)\ncreateScroll2Clone (958) (30)\nbroadcast (Create_Scroll2 v)\n\nwhen I receive [topmvtscroll v]\nposition x;y ((PositionX) - (round ((@scrollX) / (10)))) ((PositionY) - (round ((@scrollY) / (10))))\n\n@//scroll2\n\ndefine None\ngo to x: (x) y: (y)\n\nwhen I receive [topmvtscroll v]\nposition x;y ((PositionX) - (round ((@scrollX) / (5)))) ((PositionY) - (round ((@scrollY) / (20))))\n\nwhen I receive [create_scroll2 v]\nshow\nif <(@level) < [5]> then\n    switch costume to (foret3 v)\n    createScroll3Clone (0) (0)\n    createScroll3Clone (479) (0)\n    createScroll3Clone (958) (0)\n    if <(@level) = [3]> then\n        createScroll3Clone (1437) (0)\n    end\nelse\n    point in direction (90)\n    switch costume to (plage v)\n    createScroll3Clone (0) (-70)\n    switch costume to (bg_soleil4 v)\n    createScroll3Clone (479) (-70)\n    switch costume to (bg_soleil4 v)\n    point in direction (-90)\n    createScroll3Clone (958) (-70)\n    point in direction (-90)\nend\nbroadcast (Create_Ground v)\n\nwhen I receive [clear_all_sprite v]\nhide\ndelete this clone\n\ndefine None\ngo to x: (x) y: (y)\nset [positionx v] to (x)\nset [positiony v] to (y)\ncreate clone of (_myself_ v)\n\n@Animation\n\nwhen I receive [create_animation v]\nshow\npoint in direction (90)\ngo to [front v] layer\nswitch costume to (wait v)\nset size to (100) %\nset y to ([y position v] of [maincharacter v])\nset x to ([x position v] of [maincharacter v])\n\nwhen I receive [selectlevel v]\nhide\n\nwhen I receive [clear_all_sprite v]\nhide\npoint in direction (90)\nset y to (0)\n\nwhen I receive [topanimation v]\nset y to ((32) + ([y position v] of [maincharacter v]))\nset x to ([x position v] of [maincharacter v])\nif <(@Animation_type) = [100]> then\n    set [nbr_animation v] to [0]\n    set [@animation_type v] to [101]\nelse\n    if <(@Animation_type) = [101]> then\n        if <(costume [number v]) = [32]> then\n            set [@scrollx v] to [0]\n            set [@scrolly v] to [0]\n            change [@herolife v] by (-1)\n            set [nbr_animation v] to [0]\n            set [@animation_type v] to [0]\n            broadcast (TopMvtGround v)\n            broadcast (TopMvtVground v)\n            broadcast (changescore v)\n            if <(@HeroLife) = [0]> then\n                broadcast (herodied v)\n            end\n        end\n        change [nbr_animation v] by ((1) / (2))\n        switch costume to ([floor v] of (((Nbr_Animation) mod (12)) + (21)) )\n    else\n        if <(@Animation_type) = [102]> then\n            set [nbr_animation v] to [0]\n            set [@animation_type v] to [103]\n        else\n            if <(@Animation_type) = [103]> then\n                if <(costume [number v]) = [19]> then\n                    set [nbr_animation v] to [0]\n                    set [@animation_type v] to [0]\n                end\n                change [nbr_animation v] by ((1) / (3))\n                switch costume to ([floor v] of (((Nbr_Animation) mod (8)) + (12)) )\n            else\n                if <(@Animation_type) = [200]> then\n                    set [nbr_animation v] to [0]\n                    set [@animation_type v] to [201]\n                else\n                    if <(@Animation_type) = [201]> then\n                        if <(costume [number v]) = [40]> then\n                            set [@animation_type v] to [202]\n                            set [nbr_animation v] to [0]\n                        end\n                        change [nbr_animation v] by ((1) / (2))\n                        switch costume to ([floor v] of (((Nbr_Animation) mod (7)) + (37)) )\n                    else\n                        if <(@Animation_type) = [202]> then\n                            if <(costume [number v]) = [40]> then\n                                broadcast (show_finalcount_down v)\n                            end\n                            change [nbr_animation v] by ((1) / (2))\n                            switch costume to ([floor v] of (((Nbr_Animation) mod (7)) + (37)) )\n                        else\n                            if <(@Onground) > [0]> then\n                                if <(@run) = [1]> then\n                                    change [nbr_animation v] by ((1) / (3))\n                                    switch costume to ([floor v] of (((Nbr_Animation) mod (8)) + (3)) )\n                                else\n                                    switch costume to (wait v)\n                                end\n                            else\n                                if <(@velocity) > [0]> then\n                                    switch costume to (jump2 v)\n                                else\n                                    if <(@velocity) < [0]> then\n                                        switch costume to (jump7 v)\n                                    end\n                                end\n                                set [nbr_animation v] to [0]\n                            end\n                            if <(@direction) = [droite]> then\n                                point in direction (90)\n                            end\n                            if <(@direction) = [gauche]> then\n                                point in direction (-90)\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen I receive [ineedthekey v]\nthink [I need a key !!! ] for (1) seconds\n\nwhen I receive [herodied v]\nhide\npoint in direction (90)\nset y to (0)\n\n@loading\n\nwhen I receive [loadingon v]\nset [fading v] to [0]\ngo to [front v] layer\nset [ghost v] effect to (0)\nshow\ngo to x: (0) y: (0)\nrepeat until <(@isLoadingDone) = [true]>\n    wait (0.1) seconds\n    next costume\nend\nrepeat (11)\n    set [ghost v] effect to (fading)\n    change [fading v] by (10)\nend\nbroadcast (StartIsOk v)\nwait (1.5) seconds\nset [@start v] to [1]\nset [temp_animation v] to [0]\n\nwhen flag clicked\nhide\n\n@rubis_final\n\nwhen I receive [afficherubis v]\nset size to (100) %\nswitch costume to (rubis_final v)\nwait (0.5) seconds\nif <(@score) > [25]> then\n    show\n    go to [front v] layer\n    go to x: (-55) y: (-7)\n    start sound [pop v]\n    wait (0.5) seconds\n    if <(item (@level) of [level_star v]) = [0]> then\n        replace item (@level) of [level_star v] with [1]\n    end\nend\nif <(@score) > [50]> then\n    show\n    create clone of (_myself_ v)\n    go to x: (-10) y: (4)\n    start sound [pop v]\n    wait (0.5) seconds\n    if <(item (@level) of [level_star v]) = [1]> then\n        replace item (@level) of [level_star v] with [2]\n    end\nend\nif <(@score) > [99]> then\n    show\n    create clone of (_myself_ v)\n    go to x: (36) y: (-7)\n    start sound [pop v]\n    wait (0.5) seconds\n    if <(item (@level) of [level_star v]) = [2]> then\n        replace item (@level) of [level_star v] with [3]\n    end\nend\nset [@isfinalok v] to [true]\nbroadcast (Save v)\n\nwhen I receive [clear_all_sprite v]\nhide\ndelete this clone\n\nwhen I receive [selectlevel v]\nshow\nset size to (50) %\ngo to [front v] layer\nswitch costume to (rubis_final_2 v)\nif <(item (1) of [level_star v]) > [0]> then\n    go to x: (-175) y: (7)\n    create clone of (_myself_ v)\nend\nif <(item (1) of [level_star v]) > [1]> then\n    go to x: (-155) y: (20)\n    create clone of (_myself_ v)\nend\nif <(item (1) of [level_star v]) = [3]> then\n    go to x: (-135) y: (7)\n    create clone of (_myself_ v)\nend\nif <(@levelmax) > [1]> then\n    if <(item (2) of [level_star v]) > [0]> then\n        go to x: (-77) y: (7)\n        create clone of (_myself_ v)\n    end\n    if <(item (2) of [level_star v]) > [1]> then\n        go to x: (-57) y: (20)\n        create clone of (_myself_ v)\n    end\n    if <(item (2) of [level_star v]) = [3]> then\n        go to x: (-37) y: (7)\n        create clone of (_myself_ v)\n    end\nend\nif <(@levelmax) > [2]> then\n    if <(item (3) of [level_star v]) > [0]> then\n        go to x: (23) y: (7)\n        create clone of (_myself_ v)\n    end\n    if <(item (3) of [level_star v]) > [1]> then\n        go to x: (43) y: (20)\n        create clone of (_myself_ v)\n    end\n    if <(item (3) of [level_star v]) = [3]> then\n        go to x: (63) y: (7)\n        create clone of (_myself_ v)\n    end\nend\nif <(@levelmax) > [3]> then\n    if <(item (4) of [level_star v]) > [0]> then\n        go to x: (120) y: (7)\n        create clone of (_myself_ v)\n    end\n    if <(item (4) of [level_star v]) > [1]> then\n        go to x: (140) y: (20)\n        create clone of (_myself_ v)\n    end\n    if <(item (4) of [level_star v]) = [3]> then\n        go to x: (160) y: (7)\n        create clone of (_myself_ v)\n    end\nend\nif <(@levelmax) > [4]> then\n    if <(item (5) of [level_star v]) > [0]> then\n        go to x: (-175) y: (-75)\n        create clone of (_myself_ v)\n    end\n    if <(item (5) of [level_star v]) > [1]> then\n        go to x: (-155) y: (-62)\n        create clone of (_myself_ v)\n    end\n    if <(item (5) of [level_star v]) = [3]> then\n        go to x: (-135) y: (-75)\n        create clone of (_myself_ v)\n    end\nend\ngo to x: (160) y: (7)\nhide\n\n@VirtualGround1\n\nwhen I receive [clear_all_sprite v]\nset [boucleclonesol v] to [1]\nhide\ndelete this clone\n\nwhen I receive [create_scroll1 v]\nchange [ghost v] effect by (100)\nshow\nif <(@level) = [1]> then\n    switch costume to (1-1 v)\n    createGroundClone (0) (0)\n    switch costume to (1-2 v)\n    createGroundClone (1) (0)\nend\nif <(@level) = [2]> then\n    switch costume to (2-1 v)\n    createGroundClone (0) (0)\n    switch costume to (2-2 v)\n    createGroundClone (1) (0)\nend\nif <(@level) = [3]> then\n    switch costume to (3-1 v)\n    createGroundClone (0) (0)\n    switch costume to (3-2 v)\n    createGroundClone (1) (0)\nend\nif <(@level) = [4]> then\n    switch costume to (4-1 v)\n    createGroundClone (0) (0)\n    switch costume to (4-2 v)\n    createGroundClone (1) (0)\n    switch costume to (4-11 v)\n    createGroundClone (0) (1)\n    switch costume to (4-12 v)\n    createGroundClone (1) (1)\n    switch costume to (4-21 v)\n    createGroundClone (0) (2)\n    switch costume to (4-22 v)\n    createGroundClone (1) (2)\nend\nif <(@level) = [5]> then\n    switch costume to (5-1 v)\n    createGroundClone (0) (0)\n    switch costume to (5-2 v)\n    createGroundClone (1) (0)\n    switch costume to (5-11 v)\n    createGroundClone (0) (1)\n    switch costume to (5-12 v)\n    createGroundClone (1) (1)\n    switch costume to (5-21 v)\n    createGroundClone (0) (2)\n    switch costume to (5-22 v)\n    createGroundClone (1) (2)\nend\nset [g_isvirtualloopdone v] to [true]\nbroadcast (Create_Plateforme v)\n\ndefine None\ngo to x: ((x) * (480)) y: ((y) * (360))\nset [virtual-x v] to ((x) * (480))\nset [virtual-y v] to ((y) * (360))\ncreate clone of (_myself_ v)\n\ndefine None\nif <(x) < [-480]> then\n    change [virtual-x v] by (959)\n    switch costume to ((costume [number v]) + (2))\nend\nif <(x) > [480]> then\n    change [virtual-x v] by (-959)\n    switch costume to ((costume [number v]) - (2))\nend\ngo to x: (x) y: (y)\n\nwhen I receive [topmvtvground v]\nposition x;y ((Virtual-x) - (@scrollX)) ((virtual-y) - (@scrollY))\n\n@Cadenas\n\nwhen I receive [clear_all_sprite v]\nhide\ndelete this clone\n\nwhen I receive [selectlevel v]\n\nwhen I receive [selectlevel v]\nset size to (100) %\nif <(@isCadenasLoopDone) = [false]> then\n    createCadenaseClone (-154) (30) (1)\n    createCadenaseClone (-57) (30) (2)\n    createCadenaseClone (43) (30) (3)\n    createCadenaseClone (138) (30) (4)\n    createCadenaseClone (-154) (-58) (5)\n    createCadenaseClone (-57) (-58) (6)\n    createCadenaseClone (43) (-58) (7)\n    createCadenaseClone (137) (-58) (8)\nend\nhide\nset [levelselect v] to [0]\nrepeat until <<mouse down?> and <(levelselect) > [0]>>\n    broadcast (TestClavier v)\n    broadcast (Play_Sound v)\nend\nif <(item (6) of [@list_playsound v]) = [0]> then\n    replace item (6) of [@list_playsound v] with [1]\nend\nbroadcast (Play_Sound v)\nset [@level v] to (levelselect)\nbroadcast (clear_all_sprite v)\nbroadcast (OnAChoisiLeLevel v)\n\nrepeat until <<mouse down?> and <(levelselect) > [0]>>\n    play sound [Menu song.mp3 v] until done\nend\n\nstop all sounds\n\ndefine None\nswitch costume to (cadenas v)\ngo to x: (x) y: (y)\nshow\nset [cadenaid v] to (id)\nif <(CadenaId) < ((@levelmax) + (1))> then\n    switch costume to (cadenas2 v)\nend\ncreate clone of (_myself_ v)\n\nwhen I receive [testclavier v]\nset [levelselect v] to [0]\nif <touching (mouse-pointer v)?> then\n    if <(CadenaId) < ((@levelmax) + (1))> then\n        if <(costume [number v]) = [2]> then\n            switch costume to (cadenas3 v)\n            if <(item (13) of [@list_playsound v]) = [0]> then\n                replace item (13) of [@list_playsound v] with [1]\n            end\n        end\n    end\nelse\n    if <(CadenaId) < ((@levelmax) + (1))> then\n        switch costume to (cadenas2 v)\n    end\nend\nif <<(mouse x) > [-190]> and <<(mouse x) < [-120]> and <<(mouse y) > [-5]> and <(mouse y) < [65]>>>> then\n    if <(@levelmax) > [0]> then\n        set [levelselect v] to [1]\n    end\nend\nif <<(mouse x) > [-95]> and <<(mouse x) < [-23]> and <<(mouse y) > [-5]> and <(mouse y) < [65]>>>> then\n    if <(@levelmax) > [1]> then\n        set [levelselect v] to [2]\n    end\nend\nif <<(mouse x) > [5]> and <<(mouse x) < [75]> and <<(mouse y) > [-5]> and <(mouse y) < [65]>>>> then\n    if <(@levelmax) > [2]> then\n        set [levelselect v] to [3]\n    end\nend\nif <<(mouse x) > [100]> and <<(mouse x) < [170]> and <<(mouse y) > [-5]> and <(mouse y) < [65]>>>> then\n    if <(@levelmax) > [3]> then\n        set [levelselect v] to [4]\n    end\nend\nif <<(mouse x) > [-190]> and <<(mouse x) < [-120]> and <<(mouse y) > [-93]> and <(mouse y) < [-22]>>>> then\n    if <(@levelmax) > [4]> then\n        set [levelselect v] to [5]\n    end\nend\n\n@Killer-Sprite\n\nwhen I receive [clear_all_sprite v]\nhide\ndelete this clone\n\ndefine loadlevel1killer\nDefine_killer_Values (1) (2900) (-117) Fx (90)\nDefine_killer_Values (1) (3100) (-117) Fx (90)\n\ndefine loadlevel2killer\nDefine_killer_Values (1) (510) (-97) Fx (90)\nDefine_killer_Values (2) (900) (-97) Fx (90)\nDefine_killer_Values (3) (1670) (-97) Fx (90)\nDefine_killer_Values (4) (1860) (-96) Fx (90)\nDefine_killer_Values (5) (3600) (-98) Fx (90)\nDefine_killer_Values (6) (2265) (-98) Fx (90)\nDefine_killer_Values (7) (2470) (-98) Fx (90)\n\ndefine loadlevel3killer\nDefine_killer_Values (1) (1495) (-20) Fx (90)\nDefine_killer_Values (2) (1840) (-120) Fx (90)\nDefine_killer_Values (3) (2005) (80) Fx (90)\nDefine_killer_Values (4) (2750) (80) Fx (90)\nDefine_killer_Values (5) (4460) (-120) Fx (90)\nDefine_killer_Values (6) (4750) (-120) Fx (90)\nDefine_killer_Values (7) (3275) (-120) Fx (90)\n\ndefine loadlevel4killer\nDefine_killer_Values (4) (360) (-108) Fx (90)\nDefine_killer_Values (5) (2705) (224) Fx (90)\nDefine_killer_Values (6) (1050) (-108) Fx (90)\nDefine_killer_Values (7) (2340) (355) Fx (115)\nDefine_killer_Values (8) (2495) (281) Fx (115)\n\ndefine loadlevel5killer\nDefine_killer_Values (1) (-170) (180) Fx (90)\nDefine_killer_Values (2) (1050) (30) Fx (180)\nDefine_killer_Values (3) (1180) (100) Fx (0)\nDefine_killer_Values (4) (3280) (450) Fx (0)\nDefine_killer_Values (5) (3280) (550) Fx (0)\nDefine_killer_Values (6) (3280) (650) Fx (0)\nDefine_killer_Values (7) (790) (-110) Fx (90)\nDefine_killer_Values (8) (1815) (802) Fx (90)\nDefine_killer_Values (9) (1600) (802) Fx (90)\nDefine_killer_Values (10) (1425) (802) Fx (90)\nDefine_killer_Values (11) (1260) (802) Fx (90)\nDefine_killer_Values (12) (3100) (326) Fx (90)\nDefine_killer_Values (13) (2815) (246) Fx (90)\nDefine_killer_Values (14) (2530) (203) Fx (90)\n\ndefine None\ngo to x: (x) y: (y)\n\ndefine None\nadd (posx) to [list_sprite_x v]\nadd (posy) to [liste_sprite_y v]\nadd (fx) to [liste_sprite_fx v]\n\ndefine None\nset [killer-x v] to (x)\nset [killer-y v] to (y)\nset [killer_type v] to (type)\nset [killer_fx v] to (fx)\npoint in direction (fx)\nswitch costume to (type)\nchange [killer_loopclone v] by (1)\ncreate clone of (_myself_ v)\n\nwhen I receive [create_killersprite v]\nset [killer_loopclone v] to [1]\nshow\nif <(@level) = [1]> then\n    loadlevel1killer\nend\nif <(@level) = [2]> then\n    loadlevel2killer\nend\nif <(@level) = [3]> then\n    loadlevel3killer\nend\nif <(@level) = [4]> then\n    loadlevel4killer\nend\nif <(@level) = [5]> then\n    loadlevel5killer\nend\nset size to (75) %\nrepeat (length of [list_sprite_x v])\n    createKillerClone (item (Killer_loopclone) of [list_sprite_x v]) (item (Killer_loopclone) of [liste_sprite_y v]) (1) FxStyle (item (Killer_loopclone) of [liste_sprite_fx v])\nend\ngo to x: (6000) y: (0)\nhide\nbroadcast (Create_Ennemi v)\n\nwhen I receive [topanimationmonstre v]\nif <touching (maincharacter v)?> then\n    if <(@Animation_type) = [0]> then\n        if <(item (4) of [@list_playsound v]) = [0]> then\n            replace item (4) of [@list_playsound v] with [1]\n        end\n        set [@animation_type v] to [100]\n    end\nend\n\nwhen I receive [topmvtkiller v]\nposition x;y ((Killer-X) - (@scrollX)) ((Killer-Y) - (@scrollY))\n\n@V_Plateforme\n\ndefine None\nif <(type) = [3]> then\n    switch costume to (caisse v)\n    set [ghost v] effect to (100)\nelse\n    switch costume to (basic2 v)\n    set [ghost v] effect to (0)\nend\ngo to x: (x) y: (y)\nset [plateforme-x v] to (x)\nset [plateforme-y v] to (y)\nset [pfrme_mvt_type v] to (type)\nset [pfrme_delay v] to (delay)\nset [pfrme_fx v] to (fx)\nset [pfrme_count v] to (count)\nset [pfrme_id v] to (id)\n\ndefine None\ngo to x: (x) y: (y)\n\nwhen I receive [clear_all_sprite v]\nset [plateformeboucleclone v] to [1]\nhide\ndelete this clone\n\nwhen I receive [create_plateforme v]\nif <(@level) = [2]> then\n    show\n    switch costume to (basic2 v)\n    createPlateformeClone (3315) (-48) Type (3) delay (0) Id (1) Fx (0) count (0)\n    create clone of (_myself_ v)\n    createPlateformeClone (2950) (-48) Type (3) delay (0) Id (2) Fx (0) count (0)\nend\nif <(@level) = [3]> then\n    show\n    switch costume to (basic2 v)\n    createPlateformeClone (2720) (-120) Type (1) delay (42) Id (1) Fx (-2) count (0)\n    create clone of (_myself_ v)\n    createPlateformeClone (2840) (-120) Type (3) delay (0) Id (2) Fx (0) count (0)\nend\nif <(@level) = [4]> then\n    show\n    switch costume to (basic2 v)\n    createPlateformeClone (3050) (-80) Type (1) delay (60) Id (1) Fx (-3) count (0)\n    create clone of (_myself_ v)\n    createPlateformeClone (1270) (350) Type (2) delay (50) Id (2) Fx (-2) count (0)\n    create clone of (_myself_ v)\n    createPlateformeClone (1940) (-110) Type (3) delay (0) Id (3) Fx (0) count (0)\n    create clone of (_myself_ v)\n    createPlateformeClone (1990) (-110) Type (3) delay (0) Id (4) Fx (0) count (0)\nend\nif <(@level) = [5]> then\n    show\n    switch costume to (basic2 v)\n    createPlateformeClone (590) (-105) Type (2) delay (60) Id (1) Fx (-3) count (0)\n    create clone of (_myself_ v)\n    createPlateformeClone (105) (230) Type (2) delay (50) Id (2) Fx (-3) count (0)\n    create clone of (_myself_ v)\n    createPlateformeClone (680) (370) Type (2) delay (40) Id (3) Fx (-2) count (0)\n    create clone of (_myself_ v)\n    createPlateformeClone (2600) (770) Type (2) delay (40) Id (4) Fx (-2) count (0)\n    create clone of (_myself_ v)\n    createPlateformeClone (910) (805) Type (3) delay (0) Id (5) Fx (0) count (0)\n    create clone of (_myself_ v)\n    createPlateformeClone (1410) (-113) Type (3) delay (0) Id (6) Fx (0) count (0)\n    create clone of (_myself_ v)\n    createPlateformeClone (1940) (750) Type (1) delay (250) Id (7) Fx (-3) count (0)\n    create clone of (_myself_ v)\n    createPlateformeClone (2155) (303) Type (3) delay (0) Id (8) Fx (0) count (0)\n    create clone of (_myself_ v)\n    createPlateformeClone (1822) (420) Type (4) delay (0) Id (9) Fx (0) count (0)\n    create clone of (_myself_ v)\n    createPlateformeClone (2297) (600) Type (4) delay (0) Id (10) Fx (0) count (0)\nend\nbroadcast (Create_Sprite v)\n\nwhen I receive [topanimationplateforme v]\nif <(Pfrme_Mvt_Type) = [4]> then\n    if <(Pfrme_Count) > [0]> then\n        change [ghost v] effect by (Pfrme_Count)\n        change [pfrme_count v] by (1)\n    end\n    if <(Pfrme_Count) > [10]> then\n        if <(Pfrme_Count) > [100]> then\n            show\n            set [ghost v] effect to (0)\n            set [pfrme_count v] to [0]\n        else\n            hide\n        end\n    end\nend\nif <touching (maincharacter v)?> then\n    if <<(Pfrme_Mvt_Type) = [4]> and <(Pfrme_Count) = [0]>> then\n        set [pfrme_count v] to [1]\n    end\n    if <(Pfrme_Mvt_Type) = [1]> then\n        set [@playerfx v] to (Pfrme_Fx)\n        set [@playerfy v] to [0]\n    end\n    if <(Pfrme_Mvt_Type) = [2]> then\n        set [@playerfy v] to (Pfrme_Fx)\n        set [@playerfx v] to [0]\n    end\n    set [@plateformetouched_y v] to (y position)\nend\nif <touching (animation v)?> then\n    if <<(Pfrme_Mvt_Type) = [3]> and <(@Animation_type) = [103]>> then\n        hide\n        delete this clone\n    end\nend\n\nwhen I receive [topmvtplateforme v]\nif <(Pfrme_Mvt_Type) < [4]> then\n    change [pfrme_count v] by (1)\nend\nif <(Pfrme_Count) = (Pfrme_Delay)> then\n    set [pfrme_fx v] to ((0) - (Pfrme_Fx))\n    set [pfrme_count v] to [0]\nend\nif <(Pfrme_Mvt_Type) = [1]> then\n    set [plateforme-x v] to ((Plateforme-x) + (Pfrme_Fx))\nend\nif <(Pfrme_Mvt_Type) = [2]> then\n    set [plateforme-y v] to ((Plateforme-y) - (Pfrme_Fx))\nend\nposition x;y ((Plateforme-x) - (@scrollX)) ((Plateforme-y) - (@scrollY))\n\n@Ennemis\n\ndefine None\nset size to (70) %\nif <(type) = [1]> then\n    if <(fx) < [0]> then\n        point in direction (90)\n    else\n        point in direction (-90)\n    end\n    switch costume to (fantome v)\nend\nif <(type) = [2]> then\n    if <(fx) < [0]> then\n        point in direction (90)\n    else\n        point in direction (-90)\n    end\n    set size to (80) %\n    switch costume to (champi v)\n    change [ghost v] effect by (0)\nend\nif <(type) = [3]> then\n    if <(fx) < [0]> then\n        point in direction (90)\n    else\n        point in direction (-90)\n    end\n    set size to (100) %\n    switch costume to (oiseau v)\n    change [ghost v] effect by (0)\nend\nif <(type) = [4]> then\n    set size to (150) %\n    switch costume to (pierre1 v)\n    change [ghost v] effect by (0)\nend\ngo to x: (x) y: (y)\nset [monster-x v] to (x)\nset [monster-y v] to (y)\nset [monster_mvt_type v] to (type)\nset [monster_delay v] to (delay)\nset [monster_fx v] to (fx)\nset [monster_count v] to (count)\nset [vitesse v] to [0]\nset [monster_died v] to [0]\ncreate clone of (_myself_ v)\n\ndefine animate_Ghost\nset [monster-x v] to ((Monster-x) + (Monster_Fx))\nchange [monster_animation v] by ((1) / (4))\nswitch costume to ([floor v] of (((Monster_animation) mod (4)) + (1)) )\nif <(Monster_animation) > [49]> then\n    set [monster_animation v] to [0]\nelse\n    if <(Monster_animation) > [29]> then\n        change [ghost v] effect by (1.5)\n    else\n        change [ghost v] effect by (-2)\n    end\nend\n\ndefine animate_Mushroom\nchange [monster_animation v] by ((1) / (4))\nswitch costume to ([floor v] of (((Monster_animation) mod (10)) + (11)) )\nif <<(costume [number v]) > [13]> and <(costume [number v]) < [18]>> then\n    set [monster-x v] to ((Monster-x) + (Monster_Fx))\nend\n\nwhen I receive [clear_all_sprite v]\nhide\ndelete this clone\n\nwhen I receive [create_ennemi v]\nset [monster_animation v] to [0]\nshow\npoint in direction (90)\nchange [ghost v] effect by (0)\nif <(@level) = [1]> then\n    createMonstreClone (1340) (-95) Type (2) delay (600) Id (1) Fx (-2) count (0)\n    createMonstreClone (1190) (-95) Type (2) delay (600) Id (1) Fx (-2) count (0)\nend\nif <(@level) = [2]> then\n    createMonstreClone (570) (-20) Type (1) delay (140) Id (1) Fx (2) count (0)\nend\nif <(@level) = [3]> then\n    createMonstreClone (3830) (5) Type (1) delay (130) Id (1) Fx (2) count (0)\n    createMonstreClone (4400) (5) Type (1) delay (130) Id (2) Fx (-2) count (0)\n    createMonstreClone (5335) (185) Type (1) delay (350) Id (3) Fx (-2) count (0)\nend\nif <(@level) = [4]> then\n    createMonstreClone (1000) (-80) Type (1) delay (505) Id (1) Fx (-2) count (0)\nend\nif <(@level) = [5]> then\n    createMonstreClone (370) (400) Type (2) delay (230) Id (2) Fx (2) count (0)\n    createMonstreClone (1290) (535) Type (2) delay (500) Id (3) Fx (-2) count (0)\n    createMonstreClone (1230) (535) Type (2) delay (500) Id (4) Fx (-2) count (0)\n    createMonstreClone (170) (796) Type (2) delay (100) Id (5) Fx (-2) count (0)\n    createMonstreClone (2730) (670) Type (2) delay (400) Id (6) Fx (2) count (0)\n    createMonstreClone (2035) (280) Type (2) delay (500) Id (7) Fx (-2) count (0)\n    createMonstreClone (2650) (-180) Type (3) delay (19) Id (8) Fx (-1) count (0)\n    createMonstreClone (2805) (-180) Type (3) delay (21) Id (9) Fx (-1) count (0)\n    createMonstreClone (2960) (-180) Type (3) delay (23) Id (10) Fx (-1) count (0)\n    createMonstreClone (-145) (200) Type (4) delay (200) Id (1) Fx (4) count (59)\nend\ngo to x: (6000) y: (0)\nhide\nbroadcast (Create_CadreLevel v)\n\ndefine None\ngo to x: (x) y: (y)\n\ndefine animate_Rocher\nif <(Monster_Count) > [0]> then\n    change [monster_count v] by (1)\n    if <(Monster_Count) > [60]> then\n        set [monster_count v] to [0]\n        show\n    end\nelse\n    if <<<((Monster-x) - (@scrollX)) > [-200]> and <((Monster-x) - (@scrollX)) < [201]>> and <<((Monster-y) - (@scrollY)) > [-160]> and <((Monster-y) - (@scrollY)) < [140]>>> then\n        change [monster_animation v] by ((1) / (2))\n        switch costume to ([floor v] of (((Monster_animation) mod (8)) + (21)) )\n        set [monster-x v] to ((Monster-x) + (Monster_Fx))\n        if <touching (virtualground1 v)?> then\n            repeat until <not <touching (virtualground1 v)?>>\n                change y by (1)\n                change [monster-y v] by (1)\n                set [vitesse v] to [0]\n            end\n        else\n            set [monster-y v] to ((Monster-y) + (vitesse))\n            change [vitesse v] by (-1)\n        end\n        if <<((Monster-y) - (@scrollY)) < [-150]> or <((Monster-x) - (@scrollX)) > [200 ]>> then\n            set [monster_count v] to [1]\n            set [monster-x v] to [-145]\n            set [monster-y v] to [200]\n            set [vitesse v] to [0]\n            hide\n        end\n    else\n    end\nend\n\ndefine animate_Oiseau\nset [monster-y v] to ((Monster-y) + (vitesse))\nif <(Monster-y) < [-180]> then\n    change [monster_count v] by (1)\n    set [vitesse v] to [0]\n    if <(Monster_Count) > [150]> then\n        set [vitesse v] to (Monster_Delay)\n        set [monster_count v] to [0]\n    end\nelse\n    change [vitesse v] by (-1)\nend\n\nwhen I receive [topanimationmonstre v]\nif <(Monster_Died) = [0]> then\n    if <(Monster_Mvt_Type) < [4]> then\n        change [monster_count v] by (1)\n    end\n    if <(Monster_Mvt_Type) = [1]> then\n        animate_Ghost\n    end\n    if <(Monster_Mvt_Type) = [2]> then\n        animate_Mushroom\n    end\n    if <(Monster_Mvt_Type) = [3]> then\n        animate_Oiseau\n    end\n    if <(Monster_Mvt_Type) = [4]> then\n        animate_Rocher\n    end\n    if <(Monster_Mvt_Type) < [3]> then\n        if <(Monster_Count) = (Monster_Delay)> then\n            set [monster_fx v] to ((0) - (Monster_Fx))\n            set [monster_count v] to [0]\n            point in direction (() - (direction))\n        end\n    end\n    if <<<touching (animation v)?> and <(@Animation_type) = [103]>> and <(Monster_Died) = [0]>> then\n        change [monster_died v] by ((1) / (3))\n        if <(item (12) of [@list_playsound v]) = [0]> then\n            replace item (12) of [@list_playsound v] with [1]\n        end\n    end\n    if <touching (maincharacter v)?> then\n        if <(@Animation_type) = [0]> then\n            if <(item (4) of [@list_playsound v]) = [0]> then\n                replace item (4) of [@list_playsound v] with [1]\n            end\n            set [@animation_type v] to [100]\n        end\n    end\nelse\n    change [monster_died v] by ((1) / (3))\n    set size to (150) %\n    change [ghost v] effect by (0)\n    switch costume to (([floor v] of ((Monster_Died) mod (6)) ) + (36))\n    if <(costume [number v]) = [41]> then\n        delete this clone\n    end\nend\n\nwhen I receive [topmvtennemis v]\npositionennemi x;y ((Monster-x) - (@scrollX)) ((Monster-y) - (@scrollY))\n\n@catontreeLogo\n\nwhen flag clicked\nset [@isloadingdone v] to [false]\nbroadcast (clear_all_sprite v)\nswitch backdrop to (title v)\nset rotation style [left-right v]\nhide\nset [ghost v] effect to (0)\nshow\ngo to x: (0) y: (0)\nwait (2) seconds\nrepeat (11)\n    set [ghost v] effect to (fading)\n    change [fading v] by (10)\nend\nbroadcast (CatOnTreeEnded v)\n\n@Lutin1\n\nwhen I receive [topmenu v]\nif <(@IsMenuOn) = [1]> then\n    set [@start v] to [0]\n    go to [front v] layer\n    show\nelse\n    hide\nend\nrepeat until <(@IsMenuOn) = [0]>\n    if <mouse down?> then\n        if <touching (mouse-pointer v)?> then\n            if <(item (6) of [@list_playsound v]) = [0]> then\n                replace item (6) of [@list_playsound v] with [1]\n            end\n            broadcast (Play_Sound v)\n            if <<(mouse y) < [30]> and <(mouse y) > [3]>> then\n                set [@ismenuon v] to [0]\n                set [@start v] to [1]\n                if <(item (20) of [@list_playsound v]) = [0]> then\n                    replace item (20) of [@list_playsound v] with [1]\n                end\n                broadcast (Play_Sound v)\n                broadcast (clear_all_sprite v)\n                broadcast (OnAChoisiLeLevel v)\n            else\n                if <<(mouse y) < [80]> and <(mouse y) > [50]>> then\n                    if <(item (20) of [@list_playsound v]) = [0]> then\n                        replace item (20) of [@list_playsound v] with [1]\n                    end\n                    broadcast (Play_Sound v)\n                    set [@ismenuon v] to [0]\n                    broadcast (clear_all_sprite v)\n                    switch backdrop to (level_choice v)\n                    broadcast (selectlevel v)\n                else\n                    set [@ismenuon v] to [0]\n                    set [@start v] to [1]\n                end\n            end\n            broadcast (Play_Sound v)\n        end\n    end\nend\n\nwhen I receive [create_scroll1 v]\nset [@ismenuon v] to [0]\ngo to x: (0) y: (50)\nswitch costume to (costume1 v)\ncreate clone of (_myself_ v)\ngo to x: (0) y: (0)\nswitch costume to (costume2 v)\ncreate clone of (_myself_ v)\ngo to x: (0) y: (-50)\nswitch costume to (costume3 v)\n\nwhen I receive [clear_all_sprite v]\nhide\ndelete this clone\n\n@Sol\n\ndefine None\ngo to x: ((x) * (480)) y: ((y) * (360))\nset [x v] to ((x) * (480))\nset [y v] to ((y) * (360))\ncreate clone of (_myself_ v)\n\nwhen I receive [clear_all_sprite v]\nhide\ndelete this clone\n\nwhen I receive [create_ground v]\nshow\nif <(@level) = [1]> then\n    switch costume to (1-1 v)\n    createGroundClone (0) (0)\n    switch costume to (1-2 v)\n    createGroundClone (1) (0)\nend\nif <(@level) = [2]> then\n    switch costume to (3-1 v)\n    createGroundClone (0) (0)\n    switch costume to (3-2 v)\n    createGroundClone (1) (0)\nend\nif <(@level) = [3]> then\n    switch costume to (2-1 v)\n    createGroundClone (0) (0)\n    switch costume to (2-2 v)\n    createGroundClone (1) (0)\nend\nif <(@level) = [4]> then\n    switch costume to (4-1 v)\n    createGroundClone (0) (0)\n    switch costume to (4-2 v)\n    createGroundClone (1) (0)\n    switch costume to (4-11 v)\n    createGroundClone (0) (1)\n    switch costume to (4-12 v)\n    createGroundClone (1) (1)\n    switch costume to (4-21 v)\n    createGroundClone (0) (2)\n    switch costume to (4-22 v)\n    createGroundClone (1) (2)\nend\nif <(@level) = [5]> then\n    switch costume to (5-1 v)\n    createGroundClone (0) (0)\n    switch costume to (5-2 v)\n    createGroundClone (1) (0)\n    switch costume to (5-11 v)\n    createGroundClone (0) (1)\n    switch costume to (5-12 v)\n    createGroundClone (1) (1)\n    switch costume to (5-21 v)\n    createGroundClone (0) (2)\n    switch costume to (5-22 v)\n    createGroundClone (1) (2)\nend\nhide\nset [isgroundloopdone v] to [true]\nbroadcast (Create_Vground v)\n\ndefine None\nif <(x) < [-480]> then\n    change [x v] by (960)\n    switch costume to ((costume [number v]) + (2))\nend\nif <(x) > [480]> then\n    change [x v] by (-960)\n    switch costume to ((costume [number v]) - (2))\nend\ngo to x: (x) y: (y)\n\nwhen I receive [topmvtground v]\nposition x;y ((x) - (@scrollX)) ((y) - (@scrollY))\n\n@son\n\nwhen I receive [play_sound v]\nif <(item (1) of [@list_playsound v]) = [1]> then\n    start sound [jump v]\n    replace item (1) of [@list_playsound v] with [0]\nend\nif <(item (2) of [@list_playsound v]) = [1]> then\n    start sound [punch3 v]\n    replace item (2) of [@list_playsound v] with [0]\nend\nif <(item (3) of [@list_playsound v]) = [1]> then\n    start sound [waterfall v]\n    replace item (3) of [@list_playsound v] with [0]\nend\nif <(item (4) of [@list_playsound v]) = [1]> then\n    start sound [ray_hit_weak01 v]\n    replace item (4) of [@list_playsound v] with [0]\nend\nif <(item (5) of [@list_playsound v]) = [1]> then\n    start sound [ray_land_grass_02 v]\n    replace item (5) of [@list_playsound v] with [0]\nend\nif <(item (6) of [@list_playsound v]) = [1]> then\n    start sound [ouvrecoffre v]\n    replace item (6) of [@list_playsound v] with [0]\nend\nif <(item (7) of [@list_playsound v]) = [1]> then\n    start sound [ding3 v]\n    replace item (7) of [@list_playsound v] with [0]\nend\nif <(item (8) of [@list_playsound v]) = [1]> then\n    start sound [ding2 v]\n    replace item (8) of [@list_playsound v] with [0]\nend\nif <(item (9) of [@list_playsound v]) = [1]> then\n    start sound [sfx_lums_picked_lvl01_01 v]\n    replace item (9) of [@list_playsound v] with [0]\nend\nif <(item (10) of [@list_playsound v]) = [1]> then\n    start sound [findthekey v]\n    replace item (10) of [@list_playsound v] with [0]\nend\nif <(item (11) of [@list_playsound v]) = [1]> then\n    start sound [ouvrecoffre v]\n    replace item (11) of [@list_playsound v] with [0]\nend\nif <(item (12) of [@list_playsound v]) = [1]> then\n    start sound [mortmonstre v]\n    replace item (12) of [@list_playsound v] with [0]\nend\nif <(item (13) of [@list_playsound v]) = [1]> then\n    start sound [menu v]\n    replace item (13) of [@list_playsound v] with [0]\nend\nif <(item (20) of [@list_playsound v]) = [1]> then\n    stop all sounds\n    replace item (20) of [@list_playsound v] with [0]\nend\n\nwhen I receive [startmusique v]\nstop all sounds\nif <(@level) = [1]> then\n    play sound [Hanok song.mp3 v] until done\nend\nif <(@level) = [2]> then\n    play sound [Extrait 1.mp3 v] until done\nend\nif <(@level) = [3]> then\n    play sound [Extrait 2.mp3 v] until done\nend\nif <(@level) = [4]> then\n    play sound [Extrait 4 v2.mp3 v] until done\nend\n\n