The Quest of Sir Johnny Bitmap (a platformer) - 2 year old project

Instructions: English:\nInstructions (please read)\n~ Use the arrow keys to move\n~ Press the down arrow key to crouch\n~ Avoid spikes and enemy knights (Don't say I didn't warn you!!!)\n~ Don't stay underwater for too long or you'll drown\n~ Collect heart icons for extra lives\n~ Collect coins to purchase weapons and lives\n~ Press space to use a weapon\n~ Press space to activate a lever to move certain blocks\n\nFrancais:\n~ Utilise les flèches pour te déplacer\n~ Appuyez sur la flèche vers le bas pour vous accroupir\n~ Évitez les pics et les chevaliers ennemis\n~ Ne reste pas sous l'eau trop longtemps ou tu vas te noyer\n~ Recueillir des icônes de coeur pour des vies supplémentaires\n~ Accumulez des pièces pour acheter des armes et des vies\n~ Appuyez sur l'espace pour utiliser une arme\n~ Appuyez sur l'espace pour activer un levier pour déplacer certains blocs

@Stage\n\nwhen flag clicked\nset [ghost v] effect to (0)\nif <<<(current [month v]) > [10]> and <(current [month v]) < [13]>> or <<(current [month v]) > [0]> and <(current [month v]) < [3]>>> then\n    switch backdrop to (intro_winter v)\nend\nif <<(current [month v]) > [8]> and <(current [month v]) < [11]>> then\n    switch backdrop to (intro_fall v)\nend\nif <<(current [month v]) > [3]> and <(current [month v]) < [9]>> then\n    switch backdrop to (intro_summer v)\nend\nif <<(current [month v]) > [2]> and <(current [month v]) < [6]>> then\n    switch backdrop to (intro_spring v)\nend\n\nwhen I receive [main menu v]\nswitch backdrop to (game v)\nset [ghost v] effect to (70)\n\nwhen flag clicked\nforever\n    set volume to (0) %\n    play sound [dance around v] until done\nend\n\n@Player\n\nwhen [right arrow v] key pressed\nset [walk costume v] to [2]\nwait until <not <key (right arrow v) pressed?>>\n\nwhen [left arrow v] key pressed\nset [walk costume v] to [2]\nwait until <not <key (left arrow v) pressed?>>\n\nwhen I receive [start v]\nforever\n    if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> and <<not <key (down arrow v) pressed?>> and <not <key (s v) pressed?>>>> then\n        if <touching (water v)?> then\n            set [y velocity v] to [6.5]\n            wait until <<not <key (up arrow v) pressed?>> and <not <key (w v) pressed?>>>\n        else\n            if <(in air) < [2]> then\n                set [y velocity v] to [10]\n                wait until <<not <key (up arrow v) pressed?>> and <not <key (w v) pressed?>>>\n            end\n        end\n    end\nend\n\nwhen I receive [start v]\nforever\n    if <touching (water v)?> then\n        wait (0.2) seconds\n        if <touching (water v)?> then\n            broadcast (show breath counter v)\n            if <(Breath) > [26]> then\n                set [breath v] to [1]\n                broadcast (Level Start/Switch v)\n                broadcast (lose 3 lives v)\n                wait (2) seconds\n            end\n            if <(PLAY) = [+]> then\n                change [breath v] by (1)\n            end\n            wait (0.6) seconds\n        end\n    end\nend\n\nwhen flag clicked\nset [character v] to [1]\n\nwhen I receive [start v]\nforever\n    set [climb costume v] to [7]\n    set [pow costume v] to [10]\n    wait (0.2) seconds\n    set [climb costume v] to [8]\n    set [pow costume v] to [11]\n    wait (0.2) seconds\nend\n\nwhen I receive [start v]\nforever\n    set [walk costume v] to [1]\n    wait (0.1) seconds\n    set [walk costume v] to [2]\n    wait (0.1) seconds\n    set [walk costume v] to [1]\n    wait (0.1) seconds\n    set [walk costume v] to [3]\n    wait (0.1) seconds\nend\n\nwhen I receive [next character v]\nif <(character) < [4]> then\n    change [character v] by (1)\nelse\n    set [character v] to [1]\nend\n\nwhen I receive [previous character v]\nif <(character) > [1]> then\n    change [character v] by (-1)\nelse\n    set [character v] to [4]\nend\n\nwhen I receive [start v]\nforever\n    if <touching (water v)?> then\n        set volume to (100) %\n        play sound [bubbles v] until done\n    end\nend\n\nwhen I receive [start v]\nforever\n    if <(PLAY) = [+]> then\n        if <not <touching (water v)?>> then\n            go to [front v] layer\n            go [backward v] (9) layers\n        end\n        if <(y position) < [-170]> then\n            set [y velocity v] to [0]\n            broadcast (lose life v)\n            broadcast (Level Start/Switch v)\n        end\n        if <not <touching (water v)?>> then\n            set [breath v] to [1]\n            broadcast (hide breath counter v)\n        end\n        if <touching (spring v)?> then\n            set [y velocity v] to [13]\n        end\n        if <<(x position) = [238]> or <(x position) > [238]>> then\n            set x to (-200)\n            broadcast (Level Start/Switch v)\n            broadcast (nextLevelcoins v)\n            change [level v] by (1)\n        end\n    end\nend\n\nwhen I receive [start v]\nshow\nwait (0.1) seconds\nforever\n    wait until <touching (water v)?>\n    wait (0.1) seconds\n    if <touching (water v)?> then\n        broadcast (plunge v)\n    end\n    wait until <not <touching (water v)?>>\n    wait (0.1) seconds\nend\n\nset [character v] to [2]\n\nwhen I receive [start v]\nset [level v] to [1]\nforever\n    if <(PLAY) = [+]> then\n        if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n            point in direction (-90)\n            if <not <touching (water v)?>> then\n                Move (-3)\n            else\n                Move (-1)\n            end\n        end\n        if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n            point in direction (90)\n            if <not <touching (water v)?>> then\n                Move (3)\n            else\n                Move (1)\n            end\n        end\n    end\nend\n\nwhen I receive [dead v]\nwait (0.1) seconds\nif <(character) = [1]> then\n    switch costume to (1dead v)\nend\nif <(character) = [2]> then\n    switch costume to (2dead v)\nend\nif <(character) = [3]> then\n    switch costume to (3dead v)\nend\nstop [other scripts in sprite v]\nif <(character) = [1]> then\n    switch costume to (1dead v)\nend\nif <(character) = [2]> then\n    switch costume to (2dead v)\nend\nif <(character) = [3]> then\n    switch costume to (3dead v)\nend\n\ndefine Sense_Ground <y vel > 0 >\nif <<key (down arrow v) pressed?> or <key (s v) pressed?>> then\n    switch costume to (crouchhitbox v)\nelse\n    switch costume to (naturalhitbox v)\nend\nrepeat until <<<not <touching (groundhitbox v)?>> and <<not <touching (m.p x v)?>> and <not <touching (m.p y v)?>>>> and <not <touching (block v)?>>>\n    if <y vel > 0 > then\n        change y by (-1)\n    else\n        change y by (1)\n        set [in air v] to [0]\n    end\n    set [y velocity v] to [0]\nend\nif <touching (spikes v)?> then\n    broadcast (level start/switch v)\n    broadcast (lose life v)\nend\nif <<touching (lever v)?> and <key (space v) pressed?>> then\n    broadcast (touching player v)\nend\nswitch costume to (movingplatformhitbox v)\nif <(in air) = [0]> then\n    if <<touching (m.p x v)?> and <([moving v] of [m.p x v]) = [Left]>> then\n        Move (-3)\n    end\n    if <<touching (m.p x v)?> and <([moving v] of [m.p x v]) = [Right]>> then\n        Move (3)\n    end\n    if <<touching (m.p x v)?> and <([moving v] of [m.p x v]) = [Stop]>> then\n        Move (0)\n    end\nend\nif <touching (ladder v)?> then\n    set [y velocity v] to [0]\n    switch costume to (hitbox v)\n    if <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n        change y by (3)\n        Correct_Costume\n    end\n    if <<key (down arrow v) pressed?> or <key (s v) pressed?>> then\n        change y by (-3)\n        Correct_Costume\n    end\n    if <touching (levels v)?> then\n        Correct_Costume\n    else\n        if <<not <<key (up arrow v) pressed?> and <not <key (w v) pressed?>>>> and <<not <key (down arrow v) pressed?>> and <not <key (s v) pressed?>>>> then\n            Correct_Costume\n        end\n    end\nend\nCorrect_Costume\n\nwhen I receive [start v]\nbroadcast (level start/switch v)\nshow\nrepeat (7)\n    go to [front v] layer\nend\n\nwhen I receive [start v]\nforever\n    if <touching (water v)?> then\n        go [backward v] (100) layers\n    end\nend\n\ndefine Correct_Costume\nif <(character) = [1]> then\n    if <touching (ladder v)?> then\n        if <<key (down arrow v) pressed?> or <key (s v) pressed?>> then\n            switch costume to (Climb Costume)\n        end\n        if <touching (levels v)?> then\n            switch costume to (1stand v)\n        else\n            if <<<not <key (up arrow v) pressed?>> and <not <key (w v) pressed?>>> and <<not <key (down arrow v) pressed?>> and <not <key (s v) pressed?>>>> then\n                switch costume to (1climb1 v)\n            end\n        end\n    end\n    if <<(y velocity) = [0]> and <not <touching (ladder v)?>>> then\n        if <<(ground lift) < [8]> and <<<key (right arrow v) pressed?> or <key (left arrow v) pressed?>> or <<key (d v) pressed?> or <key (a v) pressed?>>>> then\n            switch costume to (Walk Costume)\n        else\n            switch costume to (1stand v)\n        end\n    end\n    if <(y velocity) > [0]> then\n        switch costume to (1jump v)\n    end\n    if <(y velocity) < [0]> then\n        switch costume to (1fall v)\n    end\n    if <<touching (ladder v)?> and <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<key (down arrow v) pressed?> or <key (s v) pressed?>>>> then\n        switch costume to (Climb Costume)\n    end\n    if <(in air) = [0]> then\n        if <<<not <touching (ladder v)?>> and <(y velocity) = [0]>> and <<key (down arrow v) pressed?> or <key (s v) pressed?>>> then\n            switch costume to (1crouch v)\n        end\n        if <([weapon v] of [weapon list v]) = [1]> then\n            if <<<(Punch) = [+]> and <(y velocity) = [0]>> and <<not <key (down arrow v) pressed?>> and <not <key (s v) pressed?>>>> then\n                switch costume to (Pow Costume)\n            end\n        end\n    end\nend\nif <(character) = [2]> then\n    if <touching (ladder v)?> then\n        if <<key (down arrow v) pressed?> or <key (s v) pressed?>> then\n            switch costume to ((Climb Costume) + (11))\n        end\n        if <touching (levels v)?> then\n            switch costume to (2stand v)\n        else\n            if <<<not <key (up arrow v) pressed?>> and <not <key (w v) pressed?>>> and <<not <key (down arrow v) pressed?>> and <not <key (s v) pressed?>>>> then\n                switch costume to (2climb1 v)\n            end\n        end\n    end\n    if <<(y velocity) = [0]> and <not <touching (ladder v)?>>> then\n        if <<<<key (right arrow v) pressed?> or <key (left arrow v) pressed?>> or <<key (d v) pressed?> or <key (a v) pressed?>>> and <(ground lift) < [8]>> then\n            switch costume to ((Walk Costume) + (11))\n        else\n            switch costume to (2stand v)\n        end\n    end\n    if <(y velocity) > [0]> then\n        switch costume to (2jump v)\n    end\n    if <(y velocity) < [0]> then\n        switch costume to (2fall v)\n    end\n    if <<touching (ladder v)?> and <<key (up arrow v) pressed?> or <key (down arrow v) pressed?>>> then\n        switch costume to ((Climb Costume) + (11))\n    end\n    if <(in air) = [0]> then\n        if <<<not <touching (ladder v)?>> and <(y velocity) = [0]>> and <<key (down arrow v) pressed?> or <key (s v) pressed?>>> then\n            switch costume to (2crouch v)\n        end\n        if <([weapon v] of [weapon list v]) = [1]> then\n            if <<<(Punch) = [+]> and <(y velocity) = [0]>> and <<not <key (down arrow v) pressed?>> and <not <key (s v) pressed?>>>> then\n                switch costume to (2pow v)\n            end\n        end\n    end\nend\nif <(character) = [3]> then\n    if <touching (ladder v)?> then\n        if <<key (down arrow v) pressed?> or <key (s v) pressed?>> then\n            switch costume to ((Climb Costume) + (22))\n        end\n        if <touching (levels v)?> then\n            switch costume to (3stand v)\n        else\n            if <<<not <key (up arrow v) pressed?>> and <not <key (w v) pressed?>>> and <<not <key (down arrow v) pressed?>> and <not <key (s v) pressed?>>>> then\n                switch costume to (3climb1 v)\n            end\n        end\n    end\n    if <<(in air) = [0]> and <not <touching (ladder v)?>>> then\n        if <<<<key (right arrow v) pressed?> or <key (left arrow v) pressed?>> or <<key (d v) pressed?> or <key (a v) pressed?>>> and <(ground lift) < [8]>> then\n            switch costume to ((Walk Costume) + (22))\n        else\n            switch costume to (3stand v)\n        end\n    end\n    if <<<(y velocity) = [0]> and <not <(in air) = [0]>>> and <not <touching (ladder v)?>>> then\n        switch costume to (3fall v)\n    end\n    if <(y velocity) > [0]> then\n        switch costume to (3jump v)\n    end\n    if <(y velocity) < [0]> then\n        switch costume to (3fall v)\n    end\n    if <<touching (ladder v)?> and <<key (up arrow v) pressed?> or <key (down arrow v) pressed?>>> then\n        switch costume to ((Climb Costume) + (22))\n    end\n    if <(in air) = [0]> then\n        if <<<not <touching (ladder v)?>> and <(y velocity) = [0]>> and <<key (down arrow v) pressed?> or <key (s v) pressed?>>> then\n            switch costume to (3crouch v)\n        end\n        if <([weapon v] of [weapon list v]) = [1]> then\n            if <<<(Punch) = [+]> and <(y velocity) = [0]>> and <<not <key (down arrow v) pressed?>> and <not <key (s v) pressed?>>>> then\n                switch costume to (3pow v)\n            end\n        end\n    end\nend\nif <(character) = [4]> then\n    if <touching (ladder v)?> then\n        if <<key (down arrow v) pressed?> or <key (s v) pressed?>> then\n            switch costume to ((Climb Costume) + (33))\n        end\n        if <touching (levels v)?> then\n            switch costume to (4stand v)\n        else\n            if <<<not <key (up arrow v) pressed?>> and <not <key (w v) pressed?>>> and <<not <key (down arrow v) pressed?>> and <not <key (s v) pressed?>>>> then\n                switch costume to (4climb1 v)\n            end\n        end\n    end\n    if <<(in air) = [0]> and <not <touching (ladder v)?>>> then\n        if <<<<key (right arrow v) pressed?> or <key (left arrow v) pressed?>> or <<key (d v) pressed?> or <key (a v) pressed?>>> and <(ground lift) < [8]>> then\n            switch costume to ((Walk Costume) + (33))\n        else\n            switch costume to (4stand v)\n        end\n    end\n    if <<<(y velocity) = [0]> and <not <(in air) = [0]>>> and <not <touching (ladder v)?>>> then\n        switch costume to (4fall v)\n    end\n    if <(y velocity) > [0]> then\n        switch costume to (4jump v)\n    end\n    if <(y velocity) < [0]> then\n        switch costume to (4fall v)\n    end\n    if <<touching (ladder v)?> and <<key (up arrow v) pressed?> or <key (down arrow v) pressed?>>> then\n        switch costume to ((Climb Costume) + (33))\n    end\n    if <(in air) = [0]> then\n        if <<<not <touching (ladder v)?>> and <(y velocity) = [0]>> and <<key (down arrow v) pressed?> or <key (s v) pressed?>>> then\n            switch costume to (4crouch v)\n        end\n        if <([weapon v] of [weapon list v]) = [1]> then\n            if <<<(Punch) = [+]> and <(y velocity) = [0]>> and <<not <key (down arrow v) pressed?>> and <not <key (s v) pressed?>>>> then\n                switch costume to ((Pow Costume) + (33))\n            end\n        end\n    end\nend\n\nwhen I receive [start v]\nset [punch v] to [-]\nforever\n    if <<key (space v) pressed?> and <([weapon v] of [weapon list v]) = [1]>> then\n        set [punch v] to [+]\n        wait (0.2) seconds\n        set [punch v] to [-]\n        wait until <not <key (space v) pressed?>>\n    end\nend\n\nwhen flag clicked\nset size to (70) %\nset x to (-124)\nset [ghost v] effect to (100)\n\nwhen I receive [plunge v]\nset volume to (100) %\nstart sound [plunge v]\n\nwhen I receive [start v]\nforever\n    if <not <touching (water v)?>> then\n        set volume to (0) %\n    end\nend\n\nwhen I receive [level start/switch v]\ngo to x: (-223) y: (-156)\nif <(Level) = [1]> then\n    go to x: (-210) y: (-102)\nend\nif <(Level) = [2]> then\n    go to x: (-223) y: (119)\nend\nif <(Level) = [3]> then\n    go to x: (-223) y: (92)\nend\nif <(Level) = [4]> then\n    go to x: (-223) y: (-156)\nend\nif <(Level) = [5]> then\n    go to x: (-210) y: (-146)\nend\nif <(Level) = [6]> then\n    go to x: (-210) y: (118)\nend\nif <(Level) = [7]> then\n    go to x: (-219) y: (-141)\nend\n\nwhen I receive [start v]\nclear graphic effects\nset rotation style [left-right v]\nset [y velocity v] to [0]\nforever\n    if <(PLAY) = [+]> then\n        if <not <touching (ladder v)?>> then\n            if <not <touching (water v)?>> then\n                change [y velocity v] by (-1)\n            else\n                change [y velocity v] by (-1)\n            end\n        end\n        change y by (y velocity)\n        change [in air v] by (1)\n        Sense_Ground <(y velocity) > [0]>\n    end\nend\n\nwhen I receive [start v]\nforever\n    set size to (70) %\nend\n\ndefine Move (steps)\nif <key (down arrow v) pressed?> then\n    if <not <touching (ladder v)?>> then\n        switch costume to (crouchhitbox v)\n    end\nelse\n    switch costume to (naturalhitbox v)\nend\nchange x by (steps)\nset [ground lift v] to [0]\nrepeat until <<<<not <touching (groundhitbox v)?>> and <not <touching (block v)?>>> and <<not <touching (m.p x v)?>> and <not <touching (m.p y v)?>>>> or <(ground lift) = [8]>>\n    change y by (1)\n    change [ground lift v] by (1)\nend\nif <(ground lift) = [8]> then\n    change x by ((-1) * (steps))\n    change y by (-8)\nend\nCorrect_Costume\n\nwhen flag clicked\nhide\n\nwhen I receive [start v]\nbroadcast (nextlevelcoins v)\n\nwhen I receive [fullbreath v]\nset [breath v] to [1]\n\n@Wizard\n\nwhen I receive [dead v]\nhide\n\ndefine Sense_Ground <y vel > 0 >\nswitch costume to (naturalhitbox v)\nrepeat until <<<not <touching (groundhitbox v)?>> and <<not <touching (m.p x v)?>> and <not <touching (m.p y v)?>>>> and <not <touching (block v)?>>>\n    if <y vel > 0 > then\n        change y by (-1)\n    else\n        change y by (1)\n        set [in air v] to [0]\n    end\n    set [y velocity v] to [0]\nend\nswitch costume to (movingplatformhitbox v)\nif <(in air) = [0]> then\n    if <<touching (m.p x v)?> and <([moving v] of [m.p x v]) = [Left]>> then\n        Move (-3)\n    end\n    if <<touching (m.p x v)?> and <([moving v] of [m.p x v]) = [Right]>> then\n        Move (3)\n    end\n    if <<touching (m.p x v)?> and <([moving v] of [m.p x v]) = [Stop]>> then\n        Move (0)\n    end\nend\nswitch costume to (1stand v)\n\nwhen I receive [start v]\nbroadcast (level start/switch v)\nshow\nrepeat (7)\n    go to [front v] layer\nend\n\nwhen I receive [start v]\nforever\n    if <touching (water v)?> then\n        go [backward v] (100) layers\n    end\nend\n\nwhen flag clicked\nset size to (70) %\nset x to (-124)\nset [ghost v] effect to (100)\n\nwhen I receive [plunge v]\nset volume to (100) %\nstart sound [plunge v]\n\nwhen I receive [start v]\nforever\n    if <not <touching (water v)?>> then\n        set volume to (0) %\n    end\nend\n\nwhen I receive [level start/switch v]\ngo to x: (-223) y: (-156)\nif <(Level) = [1]> then\n    go to x: (-210) y: (-102)\nend\nif <(Level) = [2]> then\n    go to x: (-223) y: (119)\nend\nif <(Level) = [3]> then\n    go to x: (-223) y: (92)\nend\nif <(Level) = [4]> then\n    go to x: (-223) y: (-156)\nend\nif <(Level) = [5]> then\n    go to x: (-210) y: (-146)\nend\nif <(Level) = [6]> then\n    go to x: (-210) y: (118)\nend\nif <(Level) = [7]> then\n    go to x: (-219) y: (-141)\nend\n\nwhen I receive [start v]\nhide\nclear graphic effects\nset rotation style [left-right v]\nset [y velocity v] to [0]\nforever\n    if <(PLAY) = [+]> then\n        if <not <touching (ladder v)?>> then\n            if <not <touching (water v)?>> then\n                change [y velocity v] by (-1)\n            else\n                change [y velocity v] by (-1)\n            end\n        end\n        change y by (y velocity)\n        change [in air v] by (1)\n        Sense_Ground <(y velocity) > [0]>\n    end\nend\n\nwhen I receive [start v]\nforever\n    set size to (70) %\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [start v]\nbroadcast (nextlevelcoins v)\n\ndefine Move (steps)\nswitch costume to (naturalhitbox v)\nchange x by (steps)\nset [ground lift v] to [0]\nrepeat until <<<<not <touching (groundhitbox v)?>> and <not <touching (block v)?>>> and <<not <touching (m.p x v)?>> and <not <touching (m.p y v)?>>>> or <(ground lift) = [8]>>\n    change y by (1)\n    change [ground lift v] by (1)\nend\nif <(ground lift) = [8]> then\n    change x by ((-1) * (steps))\n    change y by (-8)\nend\n\n@Enemy \n\nwhen I start as a clone\nforever\n    set [walk costume v] to [1]\n    wait (0.05) seconds\n    set [walk costume v] to [2]\n    wait (0.05) seconds\n    set [walk costume v] to [1]\n    wait (0.05) seconds\n    set [walk costume v] to [3]\n    wait (0.05) seconds\nend\n\nwhen I start as a clone\nset [death life v] to [life]\nset [moving v] to [+]\nif <(enemy type) = [1]> then\n    set [enemyhealth v] to [2]\nend\nforever\n    if <(enemy type) = [1]> then\n        if <<<touching (player v)?> and <([punch v] of [player v]) = [+]>> or <(death life) = [dead]>> then\n            if <(EnemyHealth) > [1]> then\n                change [enemyhealth v] by (-1)\n                start sound [punch soft v]\n                set [ghost v] effect to (50)\n                set [moving v] to [-]\n                if <([x position v] of [player v]) > (x position)> then\n                    set [y velocity v] to [5]\n                    repeat (5)\n                        walk (-3)\n                    end\n                else\n                    set [y velocity v] to [5]\n                    repeat (5)\n                        walk (3)\n                    end\n                end\n                wait (0.2) seconds\n                set [moving v] to [+]\n                clear graphic effects\n            else\n                set [enemyhealth v] to [0]\n                start sound [punch soft v]\n                knight die\n            end\n        end\n    end\nend\n\nwhen I receive [edge v]\nset [edge v] to [+]\n\nwhen I start as a clone\nforever\n    if <<(distance to [player v]) < [18]> and <<not <(costume [number v]) = [7]>> and <not <(costume [number v]) = [16]>>>> then\n        if <(moving) = [+]> then\n            broadcast (Level Start/Switch v)\n            broadcast (lose life v)\n        end\n    end\nend\n\nwhen I start as a clone\nforever\n    if <(enemy type) = [2]> then\n        if <(y position) < [-185]> then\n            delete this clone\n        end\n    end\nend\n\ndefine None\nchange x by (steps)\nset [ground lift v] to [0]\nrepeat until <<<<not <touching (enemyground v)?>> and <not <touching (block v)?>>> and <not <touching (m.p x v)?>>> or <(ground lift) = [8]>>\n    change y by (1)\n    change [ground lift v] by (1)\nend\nif <(ground lift) = [8]> then\n    turn right (180) degrees\n    change x by ((-1) * (steps))\n    change y by (-8)\nend\nif <(enemy type) = [1]> then\n    if <(death life) = [life]> then\n        switch costume to (Walk Costume)\n    end\n    if <(death life) = [dead]> then\n        switch costume to (enemy1_dead v)\n    end\nend\nif <(enemy type) = [3]> then\n    if <(death life) = [life]> then\n        switch costume to (swim costume)\n    end\n    if <(death life) = [dead]> then\n        switch costume to (crocodile_3 v)\n    end\nend\n\nwhen I receive [level start/switch v]\nrepeat (20)\n    delete this clone\nend\n\nwhen I start as a clone\nforever\n    if <(enemy type) = [2]> then\n        set size to (70) %\n        if <(costume [number v]) = [10]> then\n            set rotation style [left-right v]\n            point towards (player v)\n        end\n    end\nend\n\nwhen I start as a clone\nforever\n    if <(enemy type) = [3]> then\n        set [swim costume v] to [14]\n        wait (0.1) seconds\n        set [swim costume v] to [15]\n        wait (0.1) seconds\n    end\nend\n\nwhen I start as a clone\nforever\nend\n\nwhen I start as a clone\nshow\nif <(enemy type) = [2]> then\n    if <(costume [number v]) = [12]> then\n        set rotation style [left-right v]\n        set rotation style [left-right v]\n        switch costume to (enemy2_arrow v)\n        set rotation style [left-right v]\n        repeat until <<touching (player v)?> or <<touching (_edge_ v)?> or <touching (groundhitbox v)?>>>\n            set rotation style [left-right v]\n            move (6) steps\n        end\n        if <touching (player v)?> then\n            broadcast (Level Start/Switch v)\n            broadcast (lose life v)\n            delete this clone\n        end\n        wait (1) seconds\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n        delete this clone\n    end\nend\n\ndefine None\nset [enemy type v] to [1]\ngo to x: (x) y: (y)\nswitch costume to (enemy1_stand v)\ncreate clone of (_myself_ v)\nhide\n\nwhen I start as a clone\nforever\n    set [pow costume v] to [8]\n    wait (0.2) seconds\n    set [pow costume v] to [9]\n    wait (0.2) seconds\nend\n\ndefine None\nset [enemy type v] to [2]\ngo to x: (x) y: (y)\nswitch costume to (enemy2_stand v)\ncreate clone of (_myself_ v)\nswitch costume to (enemy2_arrowspwan v)\ncreate clone of (_myself_ v)\nswitch costume to (enemy2_stand v)\nhide\n\nwhen I receive [level start/switch v]\nhide\nrepeat (10)\n    delete this clone\nend\nif <(Level) = [1]> then\n    hide\nend\nif <(Level) = [2]> then\n    walk knight at x (0) y (-129)\nend\nif <(Level) = [3]> then\n    walk knight at x (90) y (-152)\nend\nif <(Level) = [4]> then\n    walk knight at x (-135) y (-67)\nend\nif <(Level) = [5]> then\n    walk knight at x (-32) y (44)\n    walk knight at x (-73) y (44)\n    walk knight at x (13) y (-151)\nend\nif <(Level) = [6]> then\n    walk knight at x (30) y (-151)\nend\nif <(Level) = [7]> then\n    walk knight at x (-82) y (124)\nend\n\ndefine handle ground <>\nswitch costume to (hitbox v)\nrepeat until <<not <touching (enemyground v)?>> and <<not <touching (m.p x v)?>> and <not <touching (block v)?>>>>\n    if <moving up> then\n        change y by (-1)\n    else\n        change y by (1)\n        set [in air v] to [0]\n    end\n    set [y velocity v] to [0]\nend\nif <(death life) = [life]> then\n    switch costume to (enemy1_stand v)\nend\nif <(enemy type) = [1]> then\n    if <(death life) = [dead]> then\n        switch costume to (enemy1_dead v)\n    end\nend\nif <(enemy type) = [3]> then\n    if <(death life) = [dead]> then\n        switch costume to (crocodile_3 v)\n    end\nend\n\nif <(enemy type) = [3]> then\n    if <<touching (player v)?> and <<<([costume # v] of [player v]) = [10]> or <([costume # v] of [player v]) = [11]>> or <([costume # v] of [player v]) = [21]>>> then\n        if <(enemy type) = [3]> then\n            switch costume to (crocodile_3 v)\n        end\n        set [death life v] to [dead]\n        if <(direction) < [0]> then\n            if <(enemy type) = [3]> then\n                switch costume to (crocodile_3 v)\n            end\n            walk (5)\n            set [y velocity v] to [12]\n            walk (5)\n            wait (3) seconds\n            delete this clone\n        else\n            if <(enemy type) = [3]> then\n                switch costume to (crocodile_3 v)\n            end\n            walk (-5)\n            set [y velocity v] to [12]\n            walk (-5)\n            wait (3) seconds\n            delete this clone\n        end\n    end\nend\n\nwhen I start as a clone\nforever\n    if <(enemy type) = [2]> then\n        if <(costume [number v]) = [11]> then\n            switch costume to (enemy2_arrow v)\n            create clone of (_myself_ v)\n            switch costume to (enemy2_arrowspwan v)\n            wait (1) seconds\n        end\n    end\nend\n\nwhen I start as a clone\nforever\n    if <(PLAY) = [+]> then\n        if <(enemy type) = [1]> then\n            if <(death life) = [life]> then\n                if <(y velocity) > [0]> then\n                    switch costume to (enemy1_jump v)\n                end\n                if <(y velocity) < [0]> then\n                    switch costume to (enemy1_fall v)\n                end\n            end\n        end\n    end\nend\n\nwhen I start as a clone\nset rotation style [left-right v]\nset [y velocity v] to [0]\nforever\n    if <(PLAY) = [+]> then\n        if <<(enemy type) = [1]> or <(enemy type) = [3]>> then\n            change [y velocity v] by (-1)\n            change y by (y velocity)\n            change [in air v] by (1)\n            handle ground <(y velocity) > [0]>\n        end\n    end\nend\n\nwhen I start as a clone\nshow\nforever\n    if <(PLAY) = [+]> then\n        if <(enemy type) = [1]> then\n            set size to (70) %\n            if <not <touching (water v)?>> then\n                go to [front v] layer\n            else\n                go to [front v] layer\n                go [backward v] (4) layers\n            end\n            if <touching (_edge_ v)?> then\n                turn right (180) degrees\n                if <(direction) < [0]> then\n                    change x by (10)\n                else\n                    change x by (-10)\n                end\n                wait (1) seconds\n            end\n        end\n        if <(enemy type) = [3]> then\n            set size to (50) %\n            if <not <touching (water v)?>> then\n                go to [front v] layer\n            else\n                go [backward v] (4) layers\n            end\n            if <touching (_edge_ v)?> then\n                turn right (180) degrees\n                if <(direction) < [0]> then\n                    change x by (10)\n                else\n                    change x by (-10)\n                end\n                wait (1) seconds\n            end\n        end\n    end\nend\n\nwhen I start as a clone\nforever\n    if <(PLAY) = [+]> then\n        if <<(enemy type) = [1]> or <(enemy type) = [3]>> then\n            if <<(death life) = [life]> and <(moving) = [+]>> then\n                if <(direction) < [0]> then\n                    point in direction (-90)\n                    if <(ground lift) = [8]> then\n                        walk (-7)\n                    else\n                        walk (-2.8)\n                    end\n                else\n                    point in direction (90)\n                    if <(ground lift) = [8]> then\n                        walk (7)\n                    else\n                        walk (2.8)\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen I receive [enemy die v]\nif <<touching color (#462903)?> and <touching (weapons v)?>> then\n    if <(death life) = [life]> then\n        knight die\n    end\nend\n\ndefine knight die\nset [moving v] to [-]\nset [death life v] to [dead]\nif <(direction) < [0]> then\n    if <(enemy type) = [1]> then\n        switch costume to (enemy1_dead v)\n    end\n    walk (5)\n    set [y velocity v] to [12]\n    walk (5)\n    wait (3) seconds\n    delete this clone\nelse\n    if <(enemy type) = [1]> then\n        switch costume to (enemy1_dead v)\n    end\n    walk (-5)\n    set [y velocity v] to [12]\n    walk (-5)\n    wait (3) seconds\n    delete this clone\nend\n\ndefine None\nset [enemy type v] to [3]\ngo to x: (x) y: (y)\nswitch costume to (crocodile_1 v)\ncreate clone of (_myself_ v)\nhide\n\n@Weapons\n\nwhen flag clicked\nhide\nset size to (100) %\nset [arrows v] to [0]\nforever\n    set rotation style [left-right v]\n    if <<([weapon v] of [weapon list v]) = [2]> and <[weapons v] contains [Bow]?>> then\n        go to (player v)\n        show\n        if <not <key (down arrow v) pressed?>> then\n            if <<(PLAY) = [+]> and <not <touching (water v)?>>> then\n                go to [front v] layer\n            end\n            if <touching (water v)?> then\n                go [backward v] (1) layers\n            end\n            if <(Arrows) = [0]> then\n                switch costume to (bowempty v)\n            end\n            if <(Arrows) > [0]> then\n                if <key (space v) pressed?> then\n                    switch costume to (bowarrowshoot v)\n                else\n                    switch costume to (bowarrow v)\n                end\n            end\n        else\n            if <([in air v] of [player v]) = [0]> then\n                switch costume to (bowdown v)\n                go [backward v] (1) layers\n            end\n        end\n    else\n        hide\n    end\nend\n\nwhen [space v] key pressed\nset [arrow speed v] to [0]\nif <<([weapon v] of [weapon list v]) = [2]> and <<(Arrows) > [0]> and <[weapons v] contains [Bow]?>>> then\n    if <<not <([costume # v] of [player v]) = [6]>> and <<not <([costume # v] of [player v]) = [17]>> and <not <([costume # v] of [player v]) = [28]>>>> then\n        repeat until <not <key (space v) pressed?>>\n            change [arrow speed v] by (1)\n            wait (0.01) seconds\n            if <key (up arrow v) pressed?> then\n                if <([direction v] of [player v]) = [90]> then\n            end\n        end\n        arrow\n        wait (0.3) seconds\n    end\nend\n\nwhen I receive [arrow v]\nchange [arrows v] by (1)\n\ndefine arrow\nchange [arrows v] by (-1)\nswitch costume to (arrow v)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\npoint in direction ([direction v] of [player v])\nif <not <touching (water v)?>> then\n    go to [front v] layer\nelse\n    go [backward v] (50) layers\nend\nif <<(costume [number v]) = [2]> or <(costume [number v]) = [4]>> then\n    set rotation style [all around v]\n    go to (player v)\n    show\n    if <(arrow speed) < [4]> then\n        switch costume to (arrow v)\n        repeat (3)\n            move (5) steps\n        end\n        if <(direction) < [0]> then\n            repeat until <<<touching (_edge_ v)?> or <touching (groundhitbox v)?>> or <touching (block v)?>>\n                if <not <(direction) = [180]>> then\n                    turn left (10) degrees\n                    move (8) steps\n                end\n                if <(direction) = [180]> then\n                    move (9) steps\n                end\n                if <touching (lever v)?> then\n                    broadcast (touching player v)\n                end\n                if <touching (enemy  v)?> then\n                    broadcast (enemy die v)\n                end\n            end\n        else\n            repeat until <<<touching (_edge_ v)?> or <touching (groundhitbox v)?>> or <touching (block v)?>>\n                if <not <(direction) = [180]>> then\n                    turn right (10) degrees\n                    move (8) steps\n                end\n                if <(direction) = [180]> then\n                    move (9) steps\n                end\n                if <touching (lever v)?> then\n                    broadcast (touching player v)\n                end\n                if <touching (enemy  v)?> then\n                    broadcast (enemy die v)\n                end\n            end\n        end\n        if <<touching (groundhitbox v)?> or <touching (block v)?>> then\n            wait (1) seconds\n            repeat (10)\n                change [ghost v] effect by (10)\n            end\n            delete this clone\n        end\n        if <touching (_edge_ v)?> then\n            repeat (3)\n                move (10) steps\n            end\n            delete this clone\n        end\n    end\n    if <<(arrow speed) = [4]> or <<(arrow speed) = [5]> or <(arrow speed) = [6]>>> then\n        switch costume to (arrow v)\n        if <(direction) < [0]> then\n            repeat until <<<touching (_edge_ v)?> or <touching (groundhitbox v)?>> or <touching (block v)?>>\n                if <not <(direction) = [180]>> then\n                    turn left (2.5) degrees\n                    move (16) steps\n                end\n                if <(direction) = [180]> then\n                    move (14) steps\n                end\n                if <touching (lever v)?> then\n                    broadcast (touching player v)\n                end\n                if <touching (enemy  v)?> then\n                    broadcast (enemy die v)\n                end\n            end\n        else\n            repeat until <<<touching (_edge_ v)?> or <touching (groundhitbox v)?>> or <touching (block v)?>>\n                if <not <(direction) = [180]>> then\n                    turn right (2.5) degrees\n                    move (16) steps\n                end\n                if <(direction) = [180]> then\n                    move (16) steps\n                end\n                if <touching (lever v)?> then\n                    broadcast (touching player v)\n                end\n                if <touching (enemy  v)?> then\n                    broadcast (enemy die v)\n                end\n            end\n        end\n        if <<touching (groundhitbox v)?> or <touching (block v)?>> then\n            wait (1) seconds\n            repeat (10)\n                change [ghost v] effect by (10)\n            end\n            delete this clone\n        end\n        if <touching (_edge_ v)?> then\n            repeat (3)\n                move (10) steps\n            end\n            delete this clone\n        end\n    end\n    if <(arrow speed) > [6]> then\n        switch costume to (arrowfast v)\n        repeat until <<<touching (_edge_ v)?> or <touching (groundhitbox v)?>> or <touching (block v)?>>\n            go to [front v] layer\n            move (18) steps\n            if <touching (lever v)?> then\n                broadcast (touching player v)\n            end\n            if <touching (enemy  v)?> then\n                broadcast (enemy die v)\n            end\n        end\n        switch costume to (arrow v)\n    end\n    if <<touching (groundhitbox v)?> or <touching (block v)?>> then\n        wait (1) seconds\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n        delete this clone\n    end\n    if <touching (_edge_ v)?> then\n        repeat (3)\n            move (10) steps\n        end\n        delete this clone\n    end\nend\n\nwhen I start as a clone\nforever\n    if <<touching (groundhitbox v)?> or <touching (block v)?>> then\n        wait (1) seconds\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n        delete this clone\n    end\n    if <touching (_edge_ v)?> then\n        repeat (3)\n            move (10) steps\n        end\n        delete this clone\n    end\nend\n\nset [coins v] to [10000]\n\nwhen I receive [level start/switch v]\ndelete this clone\n\nwhen flag clicked\nforever\n    point in direction ([direction v] of [player v])\nend\n\n@choose character\n\nwhen flag clicked\nhide\n\nwhen I receive [main menu v]\nhide\n\nwhen I receive [character v]\nshow\nforever\n    go to [front v] layer\n    go to x: (0) y: (0)\n    switch costume to ([character v] of [player v])\nend\n\n@Water\n\nwhen I receive [level start/switch v]\nswitch costume to (Level)\nset [brightness v] effect to (100)\ngo to [front v] layer\nwait (0.1) seconds\nclear graphic effects\n\nwhen I receive [start v]\ngo to [front v] layer\ngo [backward v] (10) layers\nshow\nforever\n    switch costume to ([costume # v] of [groundhitbox v])\n    go to x: (0) y: (0)\n    set [ghost v] effect to (50)\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [dead v]\nclear graphic effects\nstop [other scripts in sprite v]\ngo [backward v] (100) layers\n\nset [level v] to [8]\nbroadcast (Level Start/Switch v)\nbroadcast (nextLevelcoins v)\n\n@GroundHitbox\n\nwhen flag clicked\nhide\nforever\n    go to x: (0) y: (0)\n    set [ghost v] effect to (100)\nend\n\nwhen flag clicked\nwait (0.1) seconds\nswitch costume to (level1 v)\n\nwhen I receive [level start/switch v]\nswitch costume to (Level)\n\nwhen I receive [start v]\nshow\n\nwhen I receive [main menu v]\nhide\n\nset [level v] to [8]\nbroadcast (level start/switch v)\nbroadcast (nextlevelcoins v)\n\nset [ghost v] effect to (0)\ngo to [front v] layer\n\n@Levels\n\nwhen flag clicked\nhide\n\nwhen I receive [level start/switch v]\nswitch costume to (Level)\nset [brightness v] effect to (100)\nwait (0.1) seconds\nclear graphic effects\ngo to [front v] layer\n\nwhen I receive [dead v]\nset [brightness v] effect to (0)\nstop [other scripts in sprite v]\ngo [backward v] (100) layers\n\nwhen I receive [start v]\ngo to [front v] layer\nshow\ngo to [front v] layer\nforever\n    switch costume to ([costume # v] of [groundhitbox v])\n    go to x: (0) y: (0)\n    if <(costume [number v]) > [8]> then\n        broadcast (message v)\n        stop [all v]\n    end\nend\n\n@EnemyGround\n\nwhen flag clicked\nhide\nforever\n    go to x: (0) y: (0)\n    set [ghost v] effect to (100)\n    switch costume to ([costume # v] of [groundhitbox v])\nend\n\nwhen flag clicked\nwait (0.1) seconds\nswitch costume to (level1 v)\n\nwhen I receive [main menu v]\nhide\n\nset [ghost v] effect to (0)\ngo to [front v] layer\n\nwhen I receive [level start/switch v]\n\nwhen I receive [start v]\nshow\n\n@Spikes\n\nwhen flag clicked\nhide\nforever\n    switch costume to ([costume # v] of [groundhitbox v])\nend\n\nwhen I receive [start v]\nshow\nrepeat (5)\n    go to [front v] layer\nend\nforever\n    go to x: (0) y: (0)\nend\n\nwhen I receive [level start/switch v]\nrepeat (5)\n    go to [front v] layer\nend\ngo to [front v] layer\n\n@lever\n\nwhen flag clicked\nhide\n\ndefine delete clones\nhide\nrepeat (10)\n    delete this clone\nend\n\nwhen I receive [level start/switch v]\nhide\ndelete clones\nif <(Level) = [1]> then\n    hide\nend\nif <(Level) = [2]> then\n    set [levers v] to [1]\n    clone at x (107) y (-147)\nend\nif <(Level) = [3]> then\n    set [levers v] to [2]\n    clone at x (-131) y (100)\n    clone at x (15) y (-167)\nend\nif <(Level) = [4]> then\n    set [levers v] to [1]\n    clone at x (-163) y (142)\nend\nif <(Level) = [5]> then\n    set [levers v] to [3]\n    clone at x (-222) y (117)\n    clone at x (-63) y (28)\n    clone at x (0) y (-167)\nend\nif <(Level) = [6]> then\n    set [levers v] to [1]\n    clone at x (70) y (100)\nend\nif <(Level) = [7]> then\n    set [levers v] to [1]\n    clone at x (-86) y (14)\nend\nif <(Level) = [8]> then\n    set [levers v] to [1]\n    clone at x (209) y (-154)\nend\n\ndefine clone at x (x) y (y)\nhide\nswitch costume to (deactivated v)\ngo to x: (x) y: (y)\ncreate clone of (_myself_ v)\ngo to x: (0) y: (0)\n\nwhen I receive [touching player v]\nif <<touching (player v)?> and <(Activated?) = [false]>> then\n    broadcast (-1 levers v)\n    start sound [ding v]\n    animation [0.1]\n    set [activated? v] to [true]\nend\n\nwhen I receive [-1 levers v]\nwait (1) seconds\nchange [levers v] by (-1)\n\nwhen I start as a clone\nset [activated? v] to [false]\nrepeat (10)\n    go to [front v] layer\n    show\nend\n\nwhen I receive [touching player v]\nif <<(Activated?) = [false]> and <<<touching color (#462903)?> or <touching color (#ff0000)?>> and <touching (weapons v)?>>> then\n    broadcast (-1 levers v)\n    start sound [ding v]\n    switch costume to (deactivated v)\n    animation [0.1]\n    set [activated? v] to [true]\nend\n\nrepeat (4)\n    wait (0.5) seconds\n    next costume\nend\n\ndefine animation (speed?)\nswitch costume to (deactivated v)\nwait (speed?) seconds\nswitch costume to (deactivated2 v)\nwait (speed?) seconds\nswitch costume to (deactivated3 v)\nwait (speed?) seconds\nswitch costume to (deactivated4 v)\nwait (speed?) seconds\nswitch costume to (activated v)\n\n@game over\n\nwhen flag clicked\nhide\nwait (0.1) seconds\nset size to (150) %\ngo to x: (-49) y: (-89)\nhide\nwait until <([costume # v] of [life v]) = [19]>\nset [play v] to [-]\nset [ghost v] effect to (100)\nshow\nbroadcast (dead v)\nwait (3) seconds\nbroadcast (dead v)\nrepeat (20)\n    go to [front v] layer\n    change [ghost v] effect by (-5)\n    switch costume to ([character v] of [player v])\nend\nwait (3) seconds\nbroadcast (game over restart v)\nbroadcast (main menu v)\n\nwhen flag clicked\nforever\n    go to [front v] layer\nend\n\nwhen I receive [game over restart v]\nhide\nwait (0.1) seconds\nset size to (150) %\ngo to x: (-49) y: (-89)\nhide\nwait until <([costume # v] of [life v]) = [19]>\nset [ghost v] effect to (100)\nshow\nset [play v] to [-]\nbroadcast (dead v)\nwait (3) seconds\nbroadcast (dead v)\nset [play v] to [-]\nrepeat (20)\n    go to [front v] layer\n    change [ghost v] effect by (-5)\n    switch costume to ([character v] of [player v])\n    go to [front v] layer\nend\nwait (3) seconds\nbroadcast (game over restart v)\nbroadcast (main menu v)\n\nwhen flag clicked\nforever\n    go to [front v] layer\nend\n\n@Main menu\n\nwhen flag clicked\nhide\n\nwhen I start as a clone\nforever\n    go to [front v] layer\n    if <touching (mouse-pointer v)?> then\n        set size to (120) %\n    else\n        set size to (100) %\n    end\n    if <<(costume [number v]) = [2]> or <(costume [number v]) = [13]>> then\n        go to x: (0) y: (-100)\n    end\n    if <(costume [number v]) = [3]> then\n        go to x: (0) y: (-30)\n    end\n    if <(costume [number v]) = [5]> then\n        go to x: (205) y: (150)\n    end\n    if <<(costume [number v]) = [6]> or <(costume [number v]) = [14]>> then\n        go to x: (0) y: (20)\n    end\n    if <(costume [number v]) = [9]> then\n        go to x: (80) y: (0)\n    end\n    if <(costume [number v]) = [10]> then\n        go to x: (-80) y: (0)\n    end\n    if <(costume [number v]) = [11]> then\n        go to x: (0) y: (-140)\n    end\nend\n\ndefine clones main menu.E\nswitch costume to (play.e v)\ncreate clone of (_myself_ v)\nswitch costume to (instruction icon.e v)\ncreate clone of (_myself_ v)\nswitch costume to (character icon.e v)\ncreate clone of (_myself_ v)\nswitch costume to (bitmap bricks.e v)\nshow\nset [play v] to [-]\n\nwhen this sprite clicked\nif <<(costume [number v]) = [2]> or <(costume [number v]) = [13]>> then\n    start sound [dink v]\n    set [play v] to [+]\n    broadcast (start v)\nend\nif <(costume [number v]) = [3]> then\n    start sound [dink v]\n    broadcast (instructions v)\nend\nif <(costume [number v]) = [5]> then\n    start sound [dink v]\n    broadcast (main menu v)\nend\nif <<(costume [number v]) = [6]> or <(costume [number v]) = [14]>> then\n    start sound [dink v]\n    broadcast (character v)\nend\nif <(costume [number v]) = [9]> then\n    start sound [dink v]\n    broadcast (next character v)\nend\nif <(costume [number v]) = [10]> then\n    start sound [dink v]\n    broadcast (previous character v)\nend\nif <(costume [number v]) = [11]> then\n    broadcast (main menu v)\n    play sound [dink v] until done\nend\n\nwhen I receive [start v]\nhide\ndelete this clone\n\ndefine instructions.E\nif <(Language) = [1]> then\n    switch costume to (instructions.e v)\nend\nif <(Language) = [2]> then\n    switch costume to (instructions.f v)\nend\nrepeat (1)\n    delete this clone\nend\nswitch costume to (close v)\ncreate clone of (_myself_ v)\nif <(Language) = [1]> then\n    switch costume to (instructions.e v)\nend\nif <(Language) = [2]> then\n    switch costume to (instructions.f v)\nend\n\nwhen I receive [character v]\nif <(Language) = [1]> then\n    switch costume to (choose player.e v)\nend\nif <(Language) = [2]> then\n    switch costume to (choose player.f v)\nend\nrepeat (1)\n    delete this clone\nend\nswitch costume to (choose character arrow 1 v)\ncreate clone of (_myself_ v)\nswitch costume to (choose character arrow 2 v)\ncreate clone of (_myself_ v)\nswitch costume to (ok v)\ncreate clone of (_myself_ v)\nif <(Language) = [1]> then\n    switch costume to (choose player.e v)\nend\nif <(Language) = [2]> then\n    switch costume to (choose player.f v)\nend\n\nwhen I receive [main menu v]\nswitch costume to (bitmap bricks.e v)\nrepeat (1)\n    delete this clone\nend\nif <(Language) = [1]> then\n    clones main menu.E\nend\nif <(Language) = [2]> then\n    Clones Main Menu.F\nend\n\nwhen flag clicked\nforever\n    go to [front v] layer\n    go to x: (0) y: (0)\n    go [backward v] (2) layers\nend\n\ndefine Clones Main Menu.F\nswitch costume to (play.f v)\ncreate clone of (_myself_ v)\nswitch costume to (instruction icon.e v)\ncreate clone of (_myself_ v)\nswitch costume to (character icon.f v)\ncreate clone of (_myself_ v)\nswitch costume to (bitmap bricks.f v)\nshow\nset [play v] to [-]\n\nwhen I receive [main menu v]\nrepeat (1)\n    delete this clone\nend\nclones main menu.E\n\nwhen I receive [instructions v]\ninstructions.E\n\nrepeat (1)\n    delete this clone\nend\n\n@Life\n\nwhen flag clicked\nswitch costume to (costume1 v)\ngo to x: (195) y: (156)\nset size to (50) %\nhide\nforever\n    if <(PLAY) = [+]> then\n        go to [front v] layer\n    end\nend\n\nwhen I receive [lose life v]\nbroadcast (level start/switch v)\nnext costume\n\nwhen I receive [start v]\nshow\n\nwhen I receive [game over restart v]\nswitch costume to (costume1 v)\ngo to x: (195) y: (156)\nset size to (50) %\nhide\nforever\n    if <(PLAY) = [+]> then\n        go to [front v] layer\n    end\nend\n\nwhen I receive [lose 3 lives v]\nrepeat (3)\n    if <not <(costume [number v]) = [19]>> then\n        next costume\n        wait (0.001) seconds\n    end\nend\n\nwhen I receive [extra life v]\nif <not <(costume [number v]) = [1]>> then\n    switch costume to ((costume [number v]) - (1))\nend\n\n@extra life\n\nwhen I start as a clone\nshow\nif <(HealthType) = [1]> then\n    set rotation style [left-right v]\n    set size to (50) %\n    show\n    switch costume to (heart17 v)\n    repeat (5)\n        go to [front v] layer\n    end\n    repeat until <touching (player v)?>\n        if <(PLAY) = [+]> then\n            next costume\n            if <touching (water v)?> then\n                go [backward v] (20) layers\n            end\n            if <(costume [number v]) = [37]> then\n                switch costume to (heart1 v)\n            end\n            wait (0.05) seconds\n        end\n    end\n    start sound [A minor ukulele v]\n    switch costume to (heartdone v)\n    point towards (life v)\n    repeat until <touching (life v)?>\n        move (10) steps\n        change size by (-0.5)\n        if <(distance to [life v]) < [60]> then\n            change size by (-5)\n            change [ghost v] effect by (10)\n        end\n    end\n    broadcast (extra life v)\n    delete this clone\nend\n\nwhen flag clicked\nhide\nforever\n    switch costume to (bubbles1 v)\n    go to [front v] layer\nend\n\nwhen I start as a clone\ngo to [front v] layer\nforever\n    if <(HealthType) = [2]> then\n        set size to (50) %\n        if <<touching (player v)?> and <(PLAY) = [+]>> then\n            broadcast (FULLBREATH v)\n        end\n    end\nend\n\nwhen I start as a clone\nforever\n    if <(HealthType) = [2]> then\n        if <(PLAY) = [+]> then\n            switch costume to (bubbles1 v)\n            wait (0.1) seconds\n            switch costume to (bubbles2 v)\n            wait (0.1) seconds\n            switch costume to (bubbles3 v)\n            wait (0.1) seconds\n            switch costume to (bubbles4 v)\n            wait (0.1) seconds\n            switch costume to (bubbles5 v)\n            wait (0.5) seconds\n            switch costume to (bubbles6 v)\n            wait (0.1) seconds\n        end\n    end\nend\n\nswitch costume to (heartdone v)\n\nwhen I receive [level start/switch v]\nhide\nrepeat (1)\n    delete this clone\nend\nif <(Level) = [1]> then\n    hide\nend\nif <(Level) = [2]> then\n    hide\nend\nif <(Level) = [3]> then\n    Life at X (125) Y (21)\nend\nif <(Level) = [4]> then\n    Life at X (14) Y (4)\nend\nif <(Level) = [5]> then\n    Life at X (201) Y (23)\nend\nif <(Level) = [6]> then\n    Life at X (80) Y (48)\n    Life at X (-91) Y (-91)\nend\nif <(Level) = [7]> then\n    hide\nend\nif <(Level) = [8]> then\n    Breath at X (-160) Y (56)\n    Breath at X (160) Y (56)\n    Breath at X (0) Y (2)\n    Breath at X (-160) Y (-53)\n    Breath at X (160) Y (-53)\n    Breath at X (0) Y (-105)\n    Breath at X (-160) Y (-144)\n    Breath at X (160) Y (-144)\nend\n\ndefine None\nset [healthtype v] to [2]\ngo to x: (x) y: (y)\ncreate clone of (_myself_ v)\nhide\n\ndefine None\nset [healthtype v] to [1]\ngo to x: (x) y: (y)\ncreate clone of (_myself_ v)\nhide\n\n@coins\n\nwhen flag clicked\nset [coins v] to [0]\nhide\n\ndefine coin at x (x) y (y)\nset size to (60) %\nset [currency v] to [1]\nswitch costume to (coin1 v)\ngo to x: (x) y: (y)\ncreate clone of (_myself_ v)\nhide\n\nwhen I start as a clone\ngo to [front v] layer\nset [collected? v] to [false]\nforever\n    if <(PLAY) = [+]> then\n        if <touching (water v)?> then\n            go [backward v] (1) layers\n        end\n        next costume\n        if <<(currency) = [1]> and <(costume [number v]) > [6]>> then\n            switch costume to (coin1 v)\n        end\n        if <<(currency) = [2]> and <(costume [number v]) = [28]>> then\n            switch costume to (bluegem1 v)\n        end\n        wait (0.08) seconds\n    end\nend\n\nwhen I receive [level start/switch v]\nwait (0.1) seconds\nrepeat (1)\n    delete this clone\nend\nif <(PLAY) = [+]> then\n    if <(Level) = [1]> then\n        coin at x (-113) y (111)\n        coin at x (-41) y (120)\n    end\n    if <(Level) = [2]> then\n        coin at x (-175) y (-58)\n        coin at x (-175) y (-83)\n        coin at x (-175) y (-108)\n        coin at x (182) y (96)\n        coin at x (210) y (96)\n    end\n    if <(Level) = [3]> then\n        coin at x (58) y (152)\n        coin at x (84) y (152)\n        coin at x (11) y (29)\n        coin at x (-115) y (-87)\n        coin at x (-90) y (-87)\n    end\n    if <(Level) = [4]> then\n        coin at x (50) y (99)\n        coin at x (70) y (99)\n        coin at x (-90) y (-53)\n        coin at x (-70) y (-53)\n        coin at x (-207) y (-35)\n        coin at x (-207) y (32)\n        coin at x (-160) y (0)\n        coin at x (-160) y (73)\n        coin at x (-207) y (110)\n        coin at x (-123) y (155)\n        coin at x (-103) y (155)\n        coin at x (-83) y (155)\n        coin at x (-63) y (155)\n    end\n    if <(Level) = [5]> then\n        coin at x (-83) y (-123)\n        coin at x (-47) y (-123)\n        coin at x (-65) y (-57)\n        coin at x (35) y (-45)\n        coin at x (67) y (-81)\n        coin at x (103) y (-105)\n        coin at x (138) y (-131)\n        coin at x (-79) y (146)\n        coin at x (-32) y (146)\n        coin at x (-148) y (146)\n        coin at x (-133) y (146)\n        coin at x (-133) y (163)\n        coin at x (-148) y (163)\n        gem at x (-180) y (-155)\n    end\n    if <(Level) = [6]> then\n        coin at x (-43) y (-125)\n        coin at x (-43) y (-150)\n        coin at x (-23) y (-125)\n        coin at x (-23) y (-150)\n        coin at x (-3) y (-125)\n        coin at x (-3) y (-150)\n        coin at x (19) y (-125)\n        coin at x (19) y (-150)\n        coin at x (42) y (-150)\n        coin at x (42) y (-125)\n        coin at x (-70) y (-87)\n        coin at x (-70) y (-72)\n        coin at x (-54) y (-87)\n        coin at x (-54) y (-72)\n    end\n    if <(Level) = [7]> then\n        coin at x (135) y (90)\n        coin at x (155) y (90)\n        coin at x (135) y (65)\n        coin at x (155) y (65)\n        coin at x (135) y (40)\n        coin at x (155) y (40)\n        coin at x (135) y (15)\n        coin at x (155) y (15)\n        coin at x (135) y (-10)\n        coin at x (155) y (-10)\n        coin at x (135) y (-35)\n        coin at x (155) y (-35)\n        coin at x (-40) y (-145)\n        coin at x (-20) y (-145)\n        coin at x (0) y (-145)\n        coin at x (20) y (-145)\n        coin at x (40) y (-145)\n    end\n    if <(Level) = [8]> then\n        coin at x (-71) y (59)\n        coin at x (-41) y (59)\n        coin at x (-11) y (59)\n        coin at x (21) y (59)\n        coin at x (51) y (59)\n        coin at x (81) y (59)\n        wait (0) seconds\n        coin at x (-71) y (-50)\n        coin at x (-41) y (-50)\n        coin at x (-11) y (-50)\n        coin at x (21) y (-50)\n        coin at x (51) y (-50)\n        coin at x (81) y (-50)\n        wait (0) seconds\n        coin at x (-71) y (-142)\n        coin at x (-41) y (-142)\n        coin at x (-11) y (-142)\n        coin at x (21) y (-142)\n        coin at x (51) y (-142)\n        coin at x (81) y (-142)\n        wait (0) seconds\n    end\nend\n\nwhen I start as a clone\nshow\nforever\n    if <<(PLAY) = [+]> and <not <touching (water v)?>>> then\n        go to [front v] layer\n    end\n    if <<(PLAY) = [+]> and <touching (water v)?>> then\n        go [backward v] (100) layers\n    end\n    if <(PLAY) = [-]> then\n        go [backward v] (100) layers\n    end\nend\n\ndefine gem at x (x) y (y)\nset size to (100) %\nset [currency v] to [2]\nswitch costume to (bluegem1 v)\ngo to x: (x) y: (y)\ncreate clone of (_myself_ v)\nhide\n\nwhen I receive [dead v]\nstop [other scripts in sprite v]\nhide\nrepeat (10)\n    delete this clone\nend\n\nwhen I start as a clone\nforever\n    if <(distance to [player v]) < [20]> then\n        broadcast (coin count v)\n        if <(costume [number v]) < [7]> then\n            change [coins v] by (1)\n        end\n        if <(costume [number v]) > [6]> then\n            change [coins v] by (10)\n            switch costume to (bluegem-done v)\n        end\n        broadcast (sound, collect v)\n        repeat (10)\n            if <(costume [number v]) > [6]> then\n                switch costume to (bluegem-done v)\n            end\n            change y by (5)\n            change [ghost v] effect by (10)\n            change size by (-5)\n        end\n        stop [this script v]\n    end\nend\n\nwhen I receive [sound, collect v]\nif <<(Collected?) = [false]> and <(distance to [player v]) < [25]>> then\n    set [collected? v] to [true]\n    set volume to (30) %\n    play sound [collect v] until done\nend\n\nbroadcast (nextlevelcoins v)\n\n@number of coins\n\nwhen flag clicked\nhide\n\ndefine number of coins\ncreate clones\n\nwhen I start as a clone\n\nwhen I receive [coin count v]\nrepeat (1)\n    erase all\n    delete this clone\nend\n\nwhen I receive [coin count v]\nnumber of coins\n\nwhen I receive [start v]\nrepeat (1)\n    erase all\n    delete this clone\nend\nbroadcast (coin count v)\n\ndefine create clones\nset [coin number v] to [0]\ngo to x: (-221) y: (157)\nrepeat (length of (coins))\n    change [coin number v] by (1)\n    switch costume to (letter (coin number) of (coins))\n    stamp\n    change x by (20)\nend\n\ngo to [front v] layer\n\ncreate clone of (_myself_ v)\n\nshow\nforever\n    if <(PLAY) = [+]> then\n        go to [front v] layer\n    end\nend\n\n@Block\n\ndefine None\nswitch costume to (horizontal v)\ngo to x: (x) y: (y)\ncreate clone of (_myself_ v)\nhide\n\nwhen I receive [level start/switch v]\nrepeat (10)\n    delete this clone\nend\nif <(Level) = [1]> then\n    hide\nend\nif <(Level) = [2]> then\n    horizontal block at x (-176) y (-33)\n    vertical block at x (12) y (93)\nend\nif <(Level) = [3]> then\n    vertical block at x (230) y (-137)\nend\nif <(Level) = [4]> then\n    vertical block at x (222) y (66)\nend\nif <(Level) = [5]> then\n    horizontal block at x (180) y (169)\n    horizontal block at x (128) y (169)\nend\nif <(Level) = [6]> then\n    horizontal block at x (201) y (-36)\nend\nif <(Level) = [7]> then\n    horizontal block at x (184) y (172)\n    horizontal block at x (153) y (-103)\nend\nif <(Level) = [8]> then\n    vertical block at x (148) y (144)\n    horizontal block at x (166) y (110)\nend\n\nwhen I receive [dead v]\nhide\nbroadcast (Level Start/Switch v)\nwait (0.001) seconds\ngo [backward v] (100) layers\nstop [other scripts in sprite v]\n\ndefine None\nswitch costume to (vertical v)\ngo to x: (x) y: (y)\ncreate clone of (_myself_ v)\nhide\n\nwhen I start as a clone\nshow\ngo [backward v] (5) layers\nforever\n    if <([levers v] of [lever v]) < [1]> then\n        repeat until <<touching (groundhitbox v)?> or <(y position) < [-210]>>\n            change y by (-10)\n            go [backward v] (1) layers\n        end\n        if <(costume [number v]) = [2]> then\n            change y by (-20)\n        end\n        stop [this script v]\n    end\nend\n\nwhen flag clicked\nhide\n\n@M.P X\n\nwhen flag clicked\nhide\nswitch costume to (ground v)\nset [ghost v] effect to (0)\npoint in direction (90)\nset rotation style [don't rotate v]\n\nwhen I receive [left v]\nset [moving v] to [Left]\n\nwhen I receive [level start/switch v]\nrepeat (1)\n    delete this clone\nend\nhide\nif <(Level) = [1]> then\n    platform x at x (117) y (95)\nend\nif <(Level) = [2]> then\n    platform x at x (130) y (75)\nend\nif <(Level) = [3]> then\n    platform x at x (105) y (90)\nend\nif <(Level) = [4]> then\n    platform x at x (18) y (133)\nend\nif <(Level) = [5]> then\n    hide\nend\nif <(Level) = [6]> then\n    hide\nend\nif <(Level) = [7]> then\n    platform x at x (194) y (-54)\nend\nif <(Level) = [8]> then\n    platform x at x (100) y (111)\nend\nif <(Level) = [9]> then\n    hide\nend\n\nwhen I receive [stop v]\nset [moving v] to [Stop]\n\ndefine None\nset [platform v] to [x]\ngo to x: (x) y: (y)\nshow\n\nwhen I receive [right v]\nset [moving v] to [Right]\n\nwhen I start as a clone\n\nwhen flag clicked\nforever\n    if <(Platform) = [x]> then\n        broadcast (left v)\n        change x by (-5)\n        repeat until <<<touching (groundhitbox v)?> or <touching (block v)?>> or <touching (_edge_ v)?>>\n            if <(PLAY) = [+]> then\n                change x by (-3)\n            end\n        end\n        broadcast (stop v)\n        wait (1) seconds\n        broadcast (right v)\n        change x by (5)\n        repeat until <<<touching (groundhitbox v)?> or <touching (block v)?>> or <touching (_edge_ v)?>>\n            if <(PLAY) = [+]> then\n                change x by (3)\n            end\n        end\n        broadcast (stop v)\n        wait (1) seconds\n    end\nend\n\nwhen flag clicked\nforever\n    if <touching (water v)?> then\n        switch costume to (log v)\n    else\n        switch costume to (ground v)\n    end\nend\n\nplatform x at x (-72) y (-93)\n\n@M.P Y\n\nwhen flag clicked\nhide\nswitch costume to (costume1 v)\npoint in direction (90)\nset rotation style [don't rotate v]\n\nwhen I start as a clone\nshow\nforever\n    repeat until <<<touching (groundhitbox v)?> or <touching (block v)?>> or <touching (_edge_ v)?>>\n        if <(PLAY) = [+]> then\n            change y by (-3)\n        end\n    end\n    wait (1) seconds\n    change y by (4)\n    repeat until <<<touching (groundhitbox v)?> or <touching (block v)?>> or <touching (_edge_ v)?>>\n        if <(PLAY) = [+]> then\n            change y by (3)\n        end\n    end\n    wait (1) seconds\n    change y by (-4)\nend\n\nwhen I receive [level start/switch v]\nhide\nrepeat (10)\n    delete this clone\nend\nif <(Level) = [1]> then\n    hide\nend\nif <(Level) = [2]> then\n    go to x: (-176) y: (-90)\n    create clone of (_myself_ v)\nend\nif <(Level) = [3]> then\n    hide\nend\nif <(Level) = [4]> then\n    hide\nend\nif <(Level) = [5]> then\n    go to x: (155) y: (-38)\n    create clone of (_myself_ v)\nend\nif <(Level) = [6]> then\n    hide\nend\nif <(Level) = [7]> then\n    go to x: (-186) y: (101)\n    create clone of (_myself_ v)\n    go to x: (153) y: (-122)\n    create clone of (_myself_ v)\nend\nif <(Level) = [8]> then\n    hide\nend\nif <(Level) = [9]> then\n    go to x: (-177) y: (-102)\n    create clone of (_myself_ v)\nend\n\n@Spring\n\nwhen flag clicked\nhide\n\nwhen I receive [dead v]\nstop [other scripts in sprite v]\ngo [backward v] (100) layers\n\nwhen I receive [level start/switch v]\nrepeat (10)\n    delete this clone\nend\nif <(Level) = [1]> then\n    hide\nend\nif <(Level) = [2]> then\n    hide\nend\nif <(Level) = [3]> then\n    hide\nend\nif <(Level) = [4]> then\n    hide\nend\nif <(Level) = [5]> then\n    hide\nend\nif <(Level) = [6]> then\n    spring at x (139) y (-102)\nend\nif <(Level) = [7]> then\n    spring at x (-135) y (-58)\nend\n\nwhen I start as a clone\nshow\nforever\n    if <(thing) = [spring]> then\n        if <touching (player v)?> then\n            switch costume to (spring_down v)\n            start sound [boing v]\n            wait (0.05) seconds\n        else\n            switch costume to (spring_up v)\n        end\n        if <(PLAY) = [+]> then\n            go to [front v] layer\n        end\n    end\nend\n\ndefine None\nset [thing v] to [spring]\ngo to x: (x) y: (y)\ncreate clone of (_myself_ v)\nhide\n\n@Ground Textures\n\n@Ladder\n\nwhen flag clicked\nshow\nforever\n    switch costume to ([costume # v] of [groundhitbox v])\n    set x to (0)\n    set y to (0)\nend\n\n@shop\n\nwhen flag clicked\nhide\nset [play v] to [+]\nswitch costume to (shop v)\nrepeat (10)\n    delete this clone\nend\nforever\n    go to [front v] layer\n    go to x: (0) y: (0)\n    go to [front v] layer\n    set size to (100) %\n    go to [front v] layer\n    go to [front v] layer\nend\n\nwhen [r v] key pressed\nset [play v] to [+]\nswitch costume to (shop v)\nrepeat (10)\n    delete this clone\nend\nstop [this script v]\n\nwhen I start as a clone\nforever\n    go to x: (0) y: (0)\n    set size to (100) %\n    go to [front v] layer\n    show\nend\n\nwhen I receive [slide v]\nif <(Slide) = [1]> then\n    if <not <[weapons v] contains [Sword]?>> then\n        switch costume to (sword 35 v)\n        create clone of (_myself_ v)\n    end\n    if <not <[weapons v] contains [Bow]?>> then\n        switch costume to (bow 45 v)\n        create clone of (_myself_ v)\n    end\n    switch costume to (life refill 100 v)\n    create clone of (_myself_ v)\n    switch costume to (arrow 2 v)\n    create clone of (_myself_ v)\n    if <not <[weapons v] contains [Pick-axe]?>> then\n        switch costume to (pick-axe v)\n        create clone of (_myself_ v)\n    end\nend\nswitch costume to (background v)\n\nwhen I receive [un-shop v]\nswitch costume to (shop v)\nrepeat (10)\n    delete this clone\nend\n\nwhen I receive [start v]\nshow\n\nwhen I start as a clone\nif <<(costume [number v]) = [6]> or <(costume [number v]) = [8]>> then\n    show\n    wait (1) seconds\n    hide\n    delete this clone\nend\n\nwhen this sprite clicked\nif <(costume [number v]) = [1]> then\n    set [slide v] to [1]\n    set [play v] to [-]\n    broadcast (slide v)\n    switch costume to (background v)\n    stop [this script v]\nend\n\nwhen this sprite clicked\nif <(costume [number v]) = [3]> then\n    if <(coins) < [35]> then\n        broadcast (not enough v)\n    end\n    if <(coins) > [34]> then\n        add [Sword] to [weapons v]\n        broadcast (sword v)\n        delete this clone\n    end\nend\nif <(costume [number v]) = [4]> then\n    if <(coins) < [45]> then\n        broadcast (not enough v)\n    end\n    if <(coins) > [44]> then\n        add [Bow] to [weapons v]\n        broadcast (bow v)\n        change [coins v] by (-45)\n        broadcast (coin count v)\n        delete this clone\n    end\nend\nif <(costume [number v]) = [5]> then\n    if <(coins) < [100]> then\n        broadcast (not enough v)\n    end\n    if <(coins) > [99]> then\n        change [coins v] by (-100)\n        broadcast (coin count v)\n        repeat (9)\n            broadcast (extra life v)\n        end\n    end\nend\nif <(costume [number v]) = [7]> then\n    if <(coins) < [2]> then\n        broadcast (not enough v)\n    end\n    if <([arrows v] of [weapons v]) < [16]> then\n        if <(coins) > [1]> then\n            change [coins v] by (-2)\n            broadcast (coin count v)\n            broadcast (arrow v)\n        end\n    end\nend\n\nwhen I receive [not enough v]\nif <(costume [number v]) = [2]> then\n    if <(Language) = [1]> then\n        switch costume to (not enough.e v)\n    end\n    if <(Language) = [2]> then\n        switch costume to (not enough.f v)\n    end\n    create clone of (_myself_ v)\n    switch costume to (background v)\nend\n\nwhen I receive [dead v]\nhide\n\n@plunge\n\nwhen flag clicked\nerase all\ncreate clone of (_myself_ v)\nset [ghost v] effect to (100)\nhide\n\nwhen I receive [hide breath counter v]\nif <(costume [number v]) > [6]> then\n    hide\nend\n\nwhen I receive [plunge v]\nif <(costume [number v]) < [7]> then\n    go to (player v)\n    set [ghost v] effect to (50)\n    switch costume to (costume1 v)\n    set size to (30) %\n    show\n    repeat (5)\n        next costume\n        go to [front v] layer\n        change size by (5)\n        wait (0.04) seconds\n    end\n    switch costume to (costume1 v)\n    set [ghost v] effect to (100)\nend\n\nwhen I receive [show breath counter v]\nif <(costume [number v]) > [6]> then\n    show\nend\n\nwhen I start as a clone\nhide\nforever\n    set [ghost v] effect to (0)\n    set x to ([x position v] of [player v])\n    set y to (([y position v] of [player v]) + (30))\n    set size to (60) %\n    switch costume to (([breath v] of [player v]) + (6))\n    if <(PLAY) = [+]> then\n        go to [front v] layer\n    else\n        go [backward v] (1) layers\n    end\nend\n\n@mentor\n\nwhen flag clicked\nswitch costume to (costume0 v)\nhide\n\nwhen I receive [level start/switch v]\ngo to x: (0) y: (0)\nset [ghost v] effect to (0)\nif <(Language) = [1]> then\n    if <(Level) < [6]> then\n        switch costume to ((Level) + (1))\n    end\n    if <(Level) > [5]> then\n        switch costume to ((Level) + (2))\n    end\n    if <<<(Level) = [6]> and <((coins) + (14)) < [45]>> and <not <[weapons v] contains [Bow]?>>> then\n        switch costume to (lev6.e v)\n    end\n    repeat (10)\n        go to [front v] layer\n    end\n    hide\n    wait until <key (space v) pressed?>\n    repeat (20)\n        change [ghost v] effect by (5)\n    end\n    if <<<(Level) = [6]> and <((coins) + (10)) < [45]>> and <not <[weapons v] contains [Bow]?>>> then\n        set [coins v] to [45]\n        broadcast (coin count v)\n    end\n    hide\nend\nif <(Language) = [2]> then\n    if <(Level) = [1]> then\n        switch costume to (lev1.f v)\n    end\n    if <(Level) = [2]> then\n        switch costume to (lev2.f v)\n    end\n    wait until <key (space v) pressed?>\n    repeat (20)\n        change [ghost v] effect by (5)\n    end\n    if <<<(Level) = [6]> and <((coins) + (10)) < [45]>> and <not <[weapons v] contains [Bow]?>>> then\n        set [coins v] to [45]\n        broadcast (coin count v)\n    end\n    hide\nend\n\nshow\n\nshow\nshow\n\nwhen I receive [dead v]\nstop [other scripts in sprite v]\nhide\n\nwhen I receive [start v]\nforever\n    if <(PLAY) = [+]> then\n        go to [front v] layer\n    end\n    hide\nend\n\n@Weapon list\n\nwhen flag clicked\nhide\ndelete (all) of [weapons v]\nadd [Punch] to [weapons v]\n\nwhen I receive [bow v]\nset [weapon v] to [2]\n\nwhen I receive [start v]\nset [weapon v] to [1]\nforever\n    go to x: (0) y: (160)\n    if <(Weapon) = [1]> then\n        switch costume to (punch v)\n    end\n    if <(length of [weapons v]) = [0]> then\n        show\n        switch costume to (punch v)\n    end\n    if <(length of [weapons v]) > [0]> then\n        show\n    end\n    if <(Weapon) = [2]> then\n        switch costume to (([arrows v] of [weapons v]) + (2))\n        if <([arrows v] of [weapons v]) > [15]> then\n            switch costume to (bowarrows15 v)\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    if <key (z v) pressed?> then\n        if <(Weapon) < (length of [weapons v])> then\n            change [weapon v] by (1)\n            wait (0.3) seconds\n        else\n            set [weapon v] to [1]\n            wait (0.3) seconds\n        end\n    end\nend\n\n@back\n\nwhen this sprite clicked\nif <(costume [number v]) = [6]> then\n    set [play v] to [+]\n    broadcast (un-shop v)\nend\nif <(costume [number v]) = [8]> then\n    switch costume to (music off v)\n    stop [this script v]\nend\nif <(costume [number v]) = [9]> then\n    switch costume to (music on v)\n    stop [this script v]\nend\n\nwhen I receive [start v]\nshow\ncreate clone of (_myself_ v)\n\nwhen [m v] key pressed\nif <(volume) = [0]> then\n    set volume to (100) %\n    stop [this script v]\nend\nif <(volume) = [100]> then\n    set volume to (0) %\n    stop [this script v]\nend\n\nwhen I receive [level start/switch v]\nif <(costume [number v]) = [21]> then\n    go to x: (0) y: (0)\n    show\n    clear graphic effects\n    wait (0.1) seconds\n    hide\nend\n\nwhen I start as a clone\nswitch costume to (costume5 v)\nforever\n    go to [front v] layer\n    if <(costume [number v]) = [8]> then\n        set volume to (70) %\n    end\n    if <(costume [number v]) = [9]> then\n        set volume to (0) %\n    end\nend\n\nwhen flag clicked\nset volume to (70) %\nhide\nforever\n    switch costume to (costume1 v)\n    go to x: (0) y: (0)\n    if <(PLAY) = [+]> then\n        set [ghost v] effect to (100)\n        go to [front v] layer\n    end\n    if <(PLAY) = [-]> then\n        set [ghost v] effect to (50)\n        go to [front v] layer\n        go [backward v] (5) layers\n        show\n    end\nend\n\nwhen I receive [game over restart v]\nset volume to (0) %\nrepeat (1)\n    delete this clone\nend\n\nwhen I receive [start v]\nhide\nforever\n    play sound [Barriera v] until done\nend\n\nwhen I receive [dead v]\nhide\n\nswitch costume to (music on v)\nshow\nclear graphic effects\nforever\n    go to x: (0) y: (0)\n    if <(PLAY) = [+]> then\n        go to [front v] layer\n    end\n    if <(PLAY) = [-]> then\n        go to [front v] layer\n        go [backward v] (10) layers\n        set [ghost v] effect to (0)\n    end\nend\n\n@English/French\n\nwhen I receive [main menu v]\nhide\ndelete this clone\n\nwhen this sprite clicked\nif <(costume [number v]) = [2]> then\n    set [language v] to [1]\n    broadcast (main menu v)\nend\nif <(costume [number v]) = [3]> then\n    set [language v] to [2]\n    broadcast (main menu v)\nend\n\nwhen I start as a clone\nforever\n    go to [front v] layer\n    if <touching (mouse-pointer v)?> then\n        set size to (130) %\n    else\n        set size to (100) %\n    end\n    if <(costume [number v]) = [2]> then\n        go to x: (0) y: (50)\n    end\n    if <(costume [number v]) = [3]> then\n        go to x: (0) y: (-50)\n    end\nend\n\nwhen flag clicked\nhide\nforever\n    go to x: (0) y: (0)\n    go to [front v] layer\n    switch costume to (background v)\nend\n\nwhen I receive [english/french v]\nset [language v] to [1]\nset size to (100) %\ngo to x: (0) y: (0)\nshow\nswitch costume to (english v)\ncreate clone of (_myself_ v)\nswitch costume to (francais v)\ncreate clone of (_myself_ v)\nswitch costume to (background v)\n\n@intro2\n\nwhen I receive [hit u v]\nif <(costume [number v]) = [7]> then\n    repeat until <(y position) < [-208]>\n        change [y velocity v] by (-2)\n        turn right (15) degrees\n    end\n    set [y velocity v] to [0]\n    hide\nend\n\nwhen I start as a clone\npoint in direction (90)\nset [y velocity v] to [0]\nforever\n    if <(costume [number v]) = [7]> then\n        change y by (y velocity)\n        set [y velocity v] to ((y velocity) * (0.9))\n    end\nend\n\nwhen flag clicked\ngo to x: (20) y: (0)\nswitch costume to (c v)\nhide\nrepeat (8)\n    create clone of (_myself_ v)\n    next costume\nend\n\nwhen I start as a clone\nshow\ngo to x: (20) y: (0)\nset [ghost v] effect to (100)\nwait until <touching color (#ae5a06)?>\nwait (0.7) seconds\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\n\nwhen I receive [english/french v]\ndelete this clone\n\n@intro\n\nwhen I receive [0 v]\nswitch costume to (acorn v)\ngo to x: (20) y: (180)\ngo to [front v] layer\nset [y velocity v] to [0]\nswitch costume to (acorn v)\nwait (1) seconds\nshow\nrepeat until <(y position) < [1]>\n    change [y velocity v] by (-1.7)\n    go to [front v] layer\nend\nset [y velocity v] to [0]\nif <(y position) < [0]> then\n    set y to (0)\nend\nbroadcast (hit u v)\nstart sound [Hit the U v]\nwait (1) seconds\nswitch costume to (acornfall1 v)\nwait (speed) seconds\nswitch costume to (acornfall2 v)\nwait (speed) seconds\nswitch costume to (acornfall3 v)\nwait (speed) seconds\nswitch costume to (acornfall4 v)\nwait (speed) seconds\nswitch costume to (acornfall5 v)\nwait (speed) seconds\nswitch costume to (acornfall6 v)\nwait (2) seconds\nstart sound [pop v]\nswitch costume to (0pop v)\nwait (0.03) seconds\nswitch costume to (0 v)\nwait (3) seconds\nhide\nbroadcast (English/French v)\nstop [this script v]\n\nwhen I start as a clone\nif <(Clone) = [1]> then\n    go to x: (-270) y: (-60)\n    show\n    clear graphic effects\nend\n\nwhen flag clicked\nset [clone v] to [1]\ngo to x: (0) y: (-108)\ncreate clone of (_myself_ v)\nhide\ngo to x: (20) y: (0)\nswitch costume to (run1 v)\nhide\n\nwhen flag clicked\nset [y velocity v] to [0]\nset [speed v] to [0.02]\nswitch costume to (acorn v)\ngo to x: (20) y: (195)\nhide\nforever\n    change y by (y velocity)\n    set [y velocity v] to ((y velocity) * (0.9))\nend\n\nwhen I start as a clone\nif <(Clone) = [1]> then\n    clear graphic effects\n    show\nend\nforever\n    go to [front v] layer\n    if <(x position) < [330]> then\n        next costume\n        if <(costume [number v]) > [12]> then\n            switch costume to (run1 v)\n        end\n        change x by (6)\n    else\n        broadcast (0 v)\n        delete this clone\n    end\nend\n\nwhen I receive [0 v]\n\nwhen I start as a clone\nforever\n    if <(costume [number v]) = [8]> then\n        start sound [footstep wood v]\n    end\nend\n\n@thumbnail\n\nwhen flag clicked\nswitch costume to (costume1 v)\nhide\n\nwhen I receive [message v]\nswitch costume to (costume2 v)\nshow\ngo to [front v] layer\n\n