Trapped! a platformer v1.1.4

Instructions: ----- Trapped! -----\nWhen you fall, get back up again.\n\n--Game Controls--\nUse Arrow Keys to move and the Space Bar to attack.\n\n--Leaderboard--\nYou must be a scratcher to have your score recorded.\n\n--Road Map--\nAdd bosses.\nMake the enemies get stronger the longer you survive.\nMake the enemies come in waves.\nAdd more weapons.\n\nv1.0.0\nGame Released.\nv1.1.0\nleaderboard is now fully functional.\nv1.1.1\nBug Fixes and Improvements.\nv1.1.2\nBug Fixes and Improvements.\nHad to reset the leaderboard.\nv1.1.3\nNew Intro.\nv1.1.4\nNew Music\nv1.1.6\nBug Fixes and Improvements.

@Stage\n\nwhen I receive [startmusic v]\nset volume to (50) %\nforever\n    play sound (pick random (1) to (4)) until done\nend\n\n@Player\n\ndefine setup\nhide\ngo to x: (0) y: (-10)\nset size to (65) %\nif <(100) = [true]> then\n    switch costume to (eyes100 v)\nelse\n    switch costume to (eyes v)\nend\ngo to [front v] layer\ngo [backward v] (3) layers\ncreate clone of (_myself_ v)\nset size to (65) %\nif <(100) = [true]> then\n    switch costume to (body100 v)\nelse\n    switch costume to (body v)\nend\nshow\n\nwhen I start as a clone\nif <<(costume [number v]) = [7]> or <(costume [number v]) = [2]>> then\n    go to [front v] layer\n    go [backward v] (2) layers\n    show\n    forever\n        if <<(costume [number v]) = [7]> or <(costume [number v]) = [2]>> then\n            glide (0.1) secs to x: (baseX) y: ((baseY) + (8))\n        end\n    end\nend\n\nwhen I receive [start v]\ngo to x: (0) y: (-60)\nset rotation style [left-right v]\nif <(100) = [true]> then\n    switch costume to (body100 v)\nelse\n    switch costume to (body v)\nend\nset [score v] to [0]\nset [protected? v] to [0]\nset [playerhp v] to [100]\nset [spawn x v] to [0]\nset [player_x v] to [0]\nset [player_y v] to [30]\nset [playerscroll_x v] to [0]\nset [playerscroll_y v] to [0]\nset [cooldowntime v] to [30]\nshow\nbroadcast (playerFootSteps v)\nbroadcast (how to move v)\nsetup\nbroadcast (tick v) and wait\nforever\n    Physics Check\n    broadcast (tick v)\nend\n\ndefine Physics Check\nif <(OnDevice?) = [false]> then\n    change [playerscroll_y v] by (-1)\n    change [falling v] by (1)\n    change y by (PlayerScroll_Y)\n    CollisionDetection\n    KeyControls <<key (up arrow v) pressed?> or <key (w v) pressed?>> <<key (left arrow v) pressed?> or <key (a v) pressed?>> <<key (right arrow v) pressed?> or <key (d v) pressed?>> <key (space v) pressed?>\n    Move\n    change [player_x v] by (x position)\n    change [player_y v] by ((y position) + (10))\n    go to x: (0) y: (-10)\n    MoveEyes <<key (up arrow v) pressed?> or <key (w v) pressed?>> <<key (down arrow v) pressed?> or <key (s v) pressed?>> <<key (left arrow v) pressed?> or <key (a v) pressed?>> <<key (right arrow v) pressed?> or <key (d v) pressed?>>\n    if <(Player_Y) < [-1000]> then\n        set [player_y v] to (spawn y)\n        set [player_x v] to (spawn x)\n    end\nend\n\ndefine Move\nset [playernumbercount v] to [0]\nset [playerscroll_x v] to ((PlayerScroll_X) * (0.8))\nchange x by (round (PlayerScroll_X))\ntouchEnemy?\nrepeat until <<not <touching (level v)?>> or <(PlayerNumberCount) = [8]>>\n    set [isonground? v] to [true]\n    change y by (1)\n    change [playernumbercount v] by (1)\nend\nif <(PlayerNumberCount) = [8]> then\n    change y by (-9)\n    change x by ((0) - (round (PlayerScroll_X)))\n    set [playerscroll_x v] to [0]\nend\n\ndefine KeyControls <up?> <left?> <right?> <attack?>\nif <<up?> and <(Falling) = [0]>> then\n    set [isonground? v] to [false]\n    change [playerscroll_y v] by (20)\nend\nif <<left?> and <[-4330] < (Player_X)>> then\n    change [playerscroll_x v] by (-4)\n    if <<<attack?> and <(CoolDown) > (CoolDownTime)>> and <[-4000] < (Player_X)>> then\n        WaveSword [left]\n        change [playerscroll_x v] by (-50)\n        set [cooldown v] to [0]\n    end\nend\nif <<right?> and <(Player_X) < [4360]>> then\n    change [playerscroll_x v] by (4)\n    if <<<attack?> and <(CoolDown) > (CoolDownTime)>> and <(Player_X) < [4000]>> then\n        WaveSword [right]\n        change [playerscroll_x v] by (50)\n        set [cooldown v] to [0]\n    end\nend\nif <<<attack?> and <<not <left?>> and <not <right?>>>> and <(CoolDown) > (CoolDownTime)>> then\n    WaveSword []\n    set [cooldown v] to [0]\nend\nif <not <attack?>> then\n    if <(PlayerHP) < [100]> then\n        change [playerhp v] by (0.02)\n    else\n        if <not <(PlayerHP) = [100]>> then\n            set [playerhp v] to [100]\n        end\n    end\nend\n\ndefine CollisionDetection\nset [playernumbercount v] to [0]\ntouchEnemy?\nrepeat until <<not <<touching (level v)?> or <touching (enemybody v)?>>> or <(PlayerNumberCount) = [16]>>\n    set [isonground? v] to [true]\n    change [playernumbercount v] by (1)\n    if <<(PlayerScroll_Y) > [-1]> and <(Falling) > [0]>> then\n        change y by (-1)\n    else\n        set [falling v] to [0]\n        change y by (1)\n    end\n    set [playerscroll_y v] to [0]\nend\n\ndefine MoveEyes <up?> <down?> <left?> <right?>\nif <<not <(baseY) = (y position)>> or <not <(baseX) = (x position)>>> then\n    set [basex v] to (x position)\n    set [basey v] to (y position)\nend\nif <up?> then\n    set [basey v] to ((y position) + (4))\nend\nif <down?> then\n    set [basey v] to ((y position) + (-8))\nend\nif <left?> then\n    set [basex v] to ((x position) + (-12))\nend\nif <right?> then\n    set [basex v] to ((x position) + (12))\nend\n\ndefine touchEnemy?\nif <<<(costume [number v]) = [6]> or <(costume [number v]) = [8]>> or <<(costume [number v]) = [1]> or <(costume [number v]) = [3]>>> then\n    if <<<touching (enemybody v)?> and <[8] < (CoolDown)>> and <(Protected?) = [0]>> then\n        if <(100) = [true]> then\n            switch costume to (bodyhit100 v)\n        else\n            switch costume to (bodyhit v)\n        end\n        change [playerhp v] by (-1)\n        if <(PlayerHP) < [1]> then\n            reset\n        end\n    else\n        if <(100) = [true]> then\n            switch costume to (body100 v)\n        else\n            switch costume to (body v)\n        end\n    end\n    if <(CoolDown) < ((CoolDownTime) + (1))> then\n        change [cooldown v] by (1)\n    end\nend\n\nwhen I receive [playerfootsteps v]\nforever\n    if <<<<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<key (left arrow v) pressed?> or <key (a v) pressed?>>> and <(isOnGround?) = [true]>> and <(OnDevice?) = [false]>> then\n        set volume to (130) %\n        play sound [Footsteps v] until done\n    else\n        set volume to (0) %\n    end\nend\n\ndefine reset\nstop [other scripts in sprite v]\nbroadcast (reset v) and wait\nbroadcast (dead v)\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen I receive [flag v]\ndelete all of [fireloc v]\ndelete all of [level with fog v]\nadd [1] to [level with fog v]\ndelete all of [level with rain v]\nadd [1] to [level with rain v]\nset [ondevice? v] to [false]\nset [message v] to [0]\nset [typeclone2 v] to [0]\nset [location v] to [1]\nset [whotexted v] to [none]\nset [player_x v] to [0]\nset [player_y v] to [0]\nbroadcast (start v)\nforever\n    wait (pick random (1) to (6)) seconds\n    if <(pick random (1) to (2)) = [1]> then\n        set [spawnenemyx v] to ((Player_X) + (300))\n    else\n        set [spawnenemyx v] to ((Player_X) - (300))\n    end\n    if <(pick random (1) to (3)) = [1]> then\n        set [sws v] to [true]\n    else\n        set [sws v] to [false]\n    end\n    if <(pick random (1) to (3)) = [1]> then\n        set [sb v] to [true]\n    else\n        set [sb v] to [false]\n    end\n    set [spawnenemyy v] to (Player_Y)\n    broadcast (spawnEnemy v)\nend\n\nwhen flag clicked\nset [100 v] to [false]\ndelete all of [items v]\n\nset [spawnenemyx v] to ((Player_X) + (350))\nset [spawnenemyy v] to [-99]\nbroadcast (spawnEnemy v)\nset [can'tpassx v] to [-50]\n\ndefine WaveSword (direction)\nif <<(costume [name v]) = [bodyHit]> or <<(costume [name v]) = [bodyHit100]> or <<(costume [name v]) = [body100]> or <(costume [name v]) = [body]>>>> then\n    set [savex v] to (x position)\n    set [savey v] to (y position)\n    switch costume to (weapon v)\n    if <(direction) = [left]> then\n        go to x: (-20) y: (-20)\n    else\n        if <(direction) = [right]> then\n            go to x: (20) y: (-20)\n        else\n            go to x: (0) y: (-20)\n        end\n    end\n    create clone of (_myself_ v)\n    go to x: (saveX) y: (saveY)\n    switch costume to (body v)\nend\n\nwhen I start as a clone\nif <<(Protected?) = [1]> and <(costume [name v]) = [Weapon]>> then\n    delete this clone\nend\nif <(costume [name v]) = [Weapon]> then\n    start sound [Low Whoosh v]\n    set [brightness v] effect to (30)\n    set [protected? v] to [1]\n    set size to (100) %\n    go to [front v] layer\n    set rotation style [all around v]\n    if <(x position) = [20]> then\n        set [swingd v] to [r]\n        point in direction (15)\n        repeat (11)\n            if <not <(LagFree?) = [true]>> then\n                SwordParticle\n            end\n            turn right (15) degrees\n            change [ghost v] effect by (9)\n        end\n    else\n        if <(x position) = [-20]> then\n            set [swingd v] to [l]\n            point in direction (150)\n            repeat (11)\n                if <not <(LagFree?) = [true]>> then\n                    SwordParticle\n                end\n                turn right (-15) degrees\n                change [ghost v] effect by (9)\n            end\n        else\n            set [swingd v] to [r]\n            point in direction (0)\n            repeat (20)\n                if <not <(LagFree?) = [true]>> then\n                    SwordParticle\n                end\n                turn right (10) degrees\n                change [ghost v] effect by (5)\n            end\n        end\n    end\n    set [protected? v] to [0]\n    delete this clone\nend\n\ndefine SwordParticle\nif <(costume [name v]) = [Weapon]> then\n    repeat (2)\n        switch costume to (particle v)\n        create clone of (_myself_ v)\n        switch costume to (weapon v)\n    end\nend\n\nwhen I start as a clone\nif <(costume [name v]) = [Particle]> then\n    set [brightness v] effect to (0)\n    set size to (50) %\n    if <(SwingD) = [r]> then\n        turn left (90) degrees\n        move (pick random (30) to (100)) steps\n        turn left (pick random (30) to (150)) degrees\n        set [rn v] to (pick random (5) to (20))\n        set [rns v] to (pick random (3) to (6))\n        set [ghost v] effect to (20)\n        repeat (RN)\n            change x by (pick random (-3.5) to (3.5))\n            change y by (pick random (-3.5) to (3.5))\n            move (RNS) steps\n            change size by (((40) / (RN)) * (-1))\n            change [ghost v] effect by ((80) / (RN))\n        end\n    else\n        turn left (90) degrees\n        move (pick random (30) to (100)) steps\n        turn right (pick random (30) to (150)) degrees\n        set [rn v] to (pick random (5) to (20))\n        set [rns v] to (pick random (3) to (6))\n        set [ghost v] effect to (20)\n        repeat (RN)\n            change x by (pick random (-3.5) to (3.5))\n            change y by (pick random (-3.5) to (3.5))\n            move ((RNS) * (-1)) steps\n            change size by (((40) / (RN)) * (-1))\n            change [ghost v] effect by ((80) / (RN))\n        end\n    end\n    delete this clone\nend\n\ndefine isTouchingEnemy?\n\nbroadcast (flag v)\n\nwhen I receive [leaderboard v]\nhide\n\nwhen flag clicked\nif <[followersusernames v] contains (username)?> then\n    set [is100? v] to [yes]\n    set [100 v] to [true]\nelse\n    set [is100? v] to [no]\n    set [100 v] to [false]\nend\n\n@enemyBody\n\nwhen I start as a clone\nif <<(costume [number v]) = [1]> or <(costume [number v]) = [2]>> then\n    broadcast (EnemyPow v)\n    set [x v] to (spawnEnemyX)\n    set [y v] to (spawnEnemyY)\n    set [enemy_show? v] to [show]\n    if <(canHaveSword?) = [true]> then\n        set [hp v] to [90]\n    else\n        set [hp v] to [50]\n    end\n    if <(SB) = [true]> then\n        set [hp v] to [150]\n        set size to (130) %\n    else\n        set size to (65) %\n    end\n    set [canhavesword? v] to (SWS)\n    show\nend\n\ndefine Pathfind\nif <<((Player_Y) + (1)) < (y)> and <(enemyFalling) = [0]>> then\n    change [enemyscrolly v] by (15)\nend\nif <(Player_X) < (x)> then\n    change [enemyscrollx v] by (-2.5)\nelse\n    change [enemyscrollx v] by (2.5)\nend\nset [enemyprotected? v] to [0]\nif <(canHaveSword?) = [true]> then\n    if <[1] > (EnemyCoolDown)> then\n        if <((x) - (20)) > (Player_X)> then\n            WaveSword [l]\n        else\n            if <((x) + (20)) < (Player_X)> then\n                WaveSword [r]\n            end\n        end\n    else\n        change [enemycooldown v] by (-0.5)\n    end\nend\n\nwhen I receive [tick v]\ntick\n\ndefine tick\nif <<(costume [number v]) = [1]> or <(costume [number v]) = [2]>> then\n    if <(HP) < [1]> then\n        change [score v] by (1)\n        delete this clone\n    end\n    if <(Enemy_Show?) = [show]> then\n        Physics Check\n    else\n        if <(Player_X) < (x)> then\n            change [x v] by (-2.5)\n        else\n            change [x v] by (2.5)\n        end\n        if <(Player_Y) < (y)> then\n            change [y v] by (-2.5)\n        else\n            change [y v] by (2.5)\n        end\n    end\n    add (x) to [enemypos v]\n    add (y) to [enemypos v]\n    isTouchingEnemy?\n    go to x: ((x) - (Player_X)) y: ((y) - (Player_Y))\n    if <<not <((x) - (Player_X)) = (x position)>> or <not <((y) - (Player_Y)) = (y position)>>> then\n        if <(Enemy_Show?) = [show]> then\n            set [enemy_show? v] to [hide]\n            hide\n        end\n    else\n        if <(Enemy_Show?) = [hide]> then\n            set [enemy_show? v] to [show]\n            show\n        end\n    end\nend\n\nwhen I receive [start v]\ndelete all of [enemypos v]\nswitch costume to (master v)\nset [x v] to [0]\nset [y v] to [0]\n\ndefine Physics Check\nchange [enemyscrolly v] by (-1)\nchange [enemyfalling v] by (1)\nchange [y position v] by (enemyScrollY)\nCollisionDetection\nPathfind\nMove\nchange [x v] by (x position)\nchange [y v] by (y position)\nset [y position v] to [0]\nset [x position v] to [0]\n\ndefine CollisionDetection\nset [numbercount v] to [0]\ntouchPlayer\nrepeat until <<not <touching (level v)?>> or <(NumberCount) = [16]>>\n    change [numbercount v] by (1)\n    if <<(enemyScrollY) > [-1]> and <(enemyFalling) > [0]>> then\n        change [y position v] by (-1)\n        change y by (-1)\n    else\n        set [enemyfalling v] to [0]\n        change [y position v] by (1)\n        change y by (1)\n    end\n    set [enemyscrolly v] to [0]\nend\n\ndefine Move\nset [numbercount v] to [0]\nset [enemyscrollx v] to ((enemyScrollX) * (0.8))\nchange [x position v] by (round (enemyScrollX))\ntouchPlayer\nrepeat until <<not <<touching (level v)?> or <(isTouchingEnemy?) = [true]>>> or <(NumberCount) = [8]>>\n    change [y position v] by (1)\n    change y by (1)\n    change [numbercount v] by (1)\nend\nif <(NumberCount) = [8]> then\n    change [y position v] by (-8)\n    change y by (-8)\n    change [x position v] by ((0) - (round (enemyScrollX)))\n    set [enemyscrollx v] to [0]\nend\n\ndefine touchPlayer\nif <<touching (player v)?> and <(EnemyProtected?) = [0]>> then\n    switch costume to (bodyhit v)\n    change [hp v] by (-2)\nelse\n    switch costume to (body v)\nend\n\nwhen I receive [reset v]\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen I receive [spawnenemy v]\nset [enemyfalling v] to [0]\nset [enemyscrollx v] to [0]\nset [enemyscrolly v] to [0]\nif <(costume [number v]) = [3]> then\n    switch costume to (body v)\n    create clone of (_myself_ v)\n    switch costume to (master v)\nend\n\nwhen I receive [enemypow v]\nforever\n    if <touching (player v)?> then\n        play sound [Crunch v] until done\n    end\nend\n\nset volume to (40) %\n\nswitch costume to (body v)\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine WaveSword (direction)\nif <<(costume [name v]) = [body]> and <[1] > (EnemyCoolDown)>> then\n    if <<(SwordRotation) = [135]> or <(SwordRotation) = [30]>> then\n        start sound [Low Whoosh v]\n    end\n    set [enemyprotected? v] to [1]\n    set [savex v] to (x position)\n    set [savey v] to (y position)\n    switch costume to (weapon v)\n    if <(direction) = [l]> then\n        if <(SwordRotation) < [0]> then\n            set [enemycooldown v] to [10]\n            set [swordtransparency v] to [0]\n            set [swordrotation v] to [150]\n        end\n        set [swingd v] to [l]\n        change [swordrotation v] by (-15)\n        change [swordtransparency v] by (9)\n    else\n        if <(direction) = [r]> then\n            if <[170] < (SwordRotation)> then\n                set [enemycooldown v] to [10]\n                set [swordtransparency v] to [0]\n                set [swordrotation v] to [15]\n            end\n            set [swingd v] to [r]\n            change [swordrotation v] by (15)\n            change [swordtransparency v] by (9)\n        end\n    end\n    if <[1] > (EnemyCoolDown)> then\n        create clone of (_myself_ v)\n    end\n    set [x position v] to (saveX)\n    set [y position v] to (saveY)\n    switch costume to (body v)\n    go to x: ((x) - (Player_X)) y: ((y) - (Player_Y))\nend\n\ngo to x: (20) y: (-20)\ngo to x: (-20) y: (-20)\ngo to x: (0) y: (-20)\n\nwhen I start as a clone\nif <(costume [name v]) = [Weapon]> then\n    set rotation style [all around v]\n    set [brightness v] effect to (30)\n    set size to (100) %\n    go to [front v] layer\n    if <(SwingD) = [r]> then\n        go to x: (((x) - (Player_X)) + (20)) y: (((y) - (Player_Y)) - (20))\n    else\n        go to x: (((x) - (Player_X)) + (-20)) y: (((y) - (Player_Y)) - (20))\n    end\n    set [ghost v] effect to (SwordTransparency)\n    point in direction (SwordRotation)\n    wait (0.01) seconds\n    delete this clone\nend\n\nif <<(Protected?) = [1]> and <(costume [name v]) = [Weapon]>> then\n    delete this clone\nend\n\nSwordParticle\n\nSwordParticle\n\nSwordParticle\n\nset [protected? v] to [0]\n\ndefine SwordParticle\nif <(costume [name v]) = [Weapon]> then\n    repeat (2)\n        switch costume to (particle v)\n        create clone of (_myself_ v)\n        switch costume to (weapon v)\n    end\nend\n\nwhen I start as a clone\nif <(costume [name v]) = [Particle]> then\n    point in direction (SwordRotation)\n    set size to (50) %\n    if <(SwingD) = [r]> then\n        turn left (90) degrees\n        move (pick random (30) to (100)) steps\n        turn left (pick random (30) to (150)) degrees\n        set [rn v] to (pick random (5) to (20))\n        set [rns v] to (pick random (3) to (6))\n        set [ghost v] effect to (20)\n        repeat (RN)\n            change x by (pick random (-3.5) to (3.5))\n            change y by (pick random (-3.5) to (3.5))\n            move (RNS) steps\n            change size by (((40) / (RN)) * (-1))\n            change [ghost v] effect by ((80) / (RN))\n        end\n    else\n        turn left (90) degrees\n        move (pick random (30) to (100)) steps\n        turn right (pick random (30) to (150)) degrees\n        set [rn v] to (pick random (5) to (20))\n        set [rns v] to (pick random (3) to (6))\n        set [ghost v] effect to (20)\n        repeat (RN)\n            change x by (pick random (-3.5) to (3.5))\n            change y by (pick random (-3.5) to (3.5))\n            move ((RNS) * (-1)) steps\n            change size by (((40) / (RN)) * (-1))\n            change [ghost v] effect by ((80) / (RN))\n        end\n    end\n    delete this clone\nend\n\ndefine isTouchingEnemy?\nset [numb v] to [0]\nset [istouchingenemy? v] to [false]\nrepeat ((length of [enemypos v]) / (2))\n    set [x? v] to (item ((numb) + (1)) of [enemypos v])\n    set [y? v] to (item ((numb) + (2)) of [enemypos v])\n    if <<not <(x) = (x?)>> and <not <(y) = (y?)>>> then\n        if <<((x) - (-50)) > (x?)> and <<((x) + (-50)) < (x?)> and <<((y) - (-50)) > (y?)> and <((y) + (-50)) < (y?)>>>> then\n            set [istouchingenemy? v] to [true]\n        end\n    end\n    change [numb v] by (2)\nend\n\nwhen I receive [leaderboard v]\nhide\n\n@enemyEyes\n\nwhen I start as a clone\ngo to [front v] layer\ngo [backward v] ((typeClone) + (3)) layers\nshow\n\nwhen I receive [tick v]\nif <(costume [number v]) = [2]> then\n    tick\nend\n\ndefine tick\nif <(costume [number v]) = [2]> then\n    update eyes\nend\n\nwhen I receive [start v]\ndelete all of [enemypos v]\nswitch costume to (master v)\nset [x v] to [0]\nset [y v] to [0]\n\nwhen I receive [updateenemyeyes v]\nif <(costume [number v]) = [1]> then\n    delete this clone\nend\n\ndefine update eyes\nbroadcast (updateEnemyEyes v)\nset [numb v] to [0]\nrepeat ((length of [enemypos v]) / (2))\n    set [x v] to (item ((numb) + (1)) of [enemypos v])\n    set [y v] to (item ((numb) + (2)) of [enemypos v])\n    go to x: ((x) - (Player_X)) y: ((y) - (Player_Y))\n    if <<<((x) - (Player_X)) = (x position)> or <((y) - (Player_Y)) = (y position)>> and <not <touching (_edge_ v)?>>> then\n        switch costume to (eyes v)\n        create clone of (_myself_ v)\n        switch costume to (master v)\n    end\n    change [numb v] by (2)\nend\ndelete all of [enemypos v]\n\nwhen I receive [reset v]\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen I receive [reset v]\ndelete this clone\n\nset [numb v] to [0]\nrepeat ((length of [enemypos v]) / (2))\n    set [x v] to (item ((numb) + (1)) of [enemypos v])\n    set [y v] to (item ((numb) + (2)) of [enemypos v])\n    go to x: ((x) - (Player_X)) y: ((y) - (Player_Y))\n    if <<<((x) - (Player_X)) = (x position)> or <((y) - (Player_Y)) = (y position)>> and <not <touching (_edge_ v)?>>> then\n        switch costume to (eyes v)\n        create clone of (_myself_ v)\n        switch costume to (master v)\n    end\n    change [numb v] by (2)\nend\n\nwhen I receive [leaderboard v]\nhide\n\n@Objects\n\nwhen I receive [tick v]\ntick\n\ndefine tick\ngo to x: ((x) - (Player_X)) y: ((y) - (Player_Y))\nif <<not <((x) - (Player_X)) = (x position)>> or <not <((y) - (Player_Y)) = (y position)>>> then\n    hide\nelse\n    show\nend\n\nwhen I receive [start v]\nset volume to (100) %\nif <(Location) = [1]> then\n    set [x v] to [2000]\n    set [y v] to [-8]\n    switch costume to (costume1 v)\n    create clone of (_myself_ v)\n    set [x v] to [2520]\n    set [y v] to [-128]\n    switch costume to (costume2 v)\n    create clone of (_myself_ v)\n    switch costume to (master v)\nend\nhide\n\nwhen I start as a clone\ngo to [back v] layer\ngo [forward v] (12) layers\nshow\n\nwhen flag clicked\nhide\n\nwhen I receive [leaderboard v]\nhide\n\nwhen I receive [flag v]\nshow\n\n@HP\n\ndefine CreateHealthBar\ngo to x: (0) y: (25)\nbroadcast (HpClear v)\nset [ghost v] effect to (0)\nshow\ngo to [front v] layer\ngo [backward v] (5) layers\nswitch costume to (base v)\ncreate clone of (_myself_ v)\nswitch costume to (1 v)\ncreate clone of (_myself_ v)\nswitch costume to (master v)\nhide\n\nwhen I receive [start v]\nset [oldplayerhp v] to (round (((PlayerHP) / ((100) / (40))) + (1)))\nswitch costume to (master v)\nhide\nforever\n    if <not <(round (((PlayerHP) / ((100) / (40))) + (1))) = (round (OldPlayerHP))>> then\n        CreateHealthBar\n    end\n    set [oldplayerhp v] to (round (((PlayerHP) / ((100) / (40))) + (1)))\nend\n\nwhen I start as a clone\nif <not <<(costume [name v]) = [Master]> or <(costume [name v]) = [Base]>>> then\n    forever\n        set [brightness v] effect to ((PlayerHP) / ((100) / (20)))\n        set [color v] effect to ((PlayerHP) / ((100) / (70)))\n        switch costume to (((PlayerHP) / ((100) / (40))) + (1))\n    end\nend\n\nwhen I start as a clone\nwait (2.5) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\nend\ndelete this clone\n\nwhen I receive [hpclear v]\ndelete this clone\n\nwhen I receive [reset v]\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen I receive [hideenemycomputer v]\nshow\n\nwhen I receive [showenemycomputerone v]\nhide\n\nwhen I receive [leaderboard v]\nhide\n\n@Device\n\nwhen I receive [start v]\nswitch costume to (map1 v)\nif <(costume [name v]) = [map1]> then\n    go to x: (150) y: (140)\n    show\n    switch costume to (player v)\n    set size to (10) %\n    create clone of (_myself_ v)\n    switch costume to (map1 v)\n    set size to (90) %\n    forever\n        go to [front v] layer\n        go [backward v] (4) layers\n    end\nend\n\nwhen I start as a clone\nif <(costume [name v]) = [player]> then\n    go to [front v] layer\n    forever\n        go to [front v] layer\n        go [backward v] (2) layers\n        go to x: (((Player_X) / (72)) + (150)) y: (((Player_Y) / (72)) + (128))\n    end\nend\nif <(costume [name v]) = [Level1Location]> then\n    go to x: (((-900) / (72)) + (150)) y: (((-99) / (72)) + (130))\n    set [ghost v] effect to (100)\n    go to [front v] layer\n    set size to (50) %\n    repeat (10)\n        change size by (-4)\n        change [ghost v] effect by (-10)\n    end\n    forever\n        go to [front v] layer\n        go [backward v] (2) layers\n        go to x: (((-900) / (72)) + (150)) y: (((-99) / (72)) + (130))\n    end\nend\nif <(costume [name v]) = [Level1Location2]> then\n    go to x: (((-500) / (72)) + (150)) y: (((-99) / (72)) + (130))\n    set [ghost v] effect to (100)\n    go to [front v] layer\n    set size to (50) %\n    repeat (10)\n        change size by (-4)\n        change [ghost v] effect by (-10)\n    end\n    forever\n        go to [front v] layer\n        go [backward v] (2) layers\n        go to x: (((-500) / (72)) + (150)) y: (((-99) / (72)) + (130))\n    end\nend\n\nwhen I receive [reset v]\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen I receive [barsshow v]\nshow\nset [ghost v] effect to (0)\nrepeat (20)\n    change [ghost v] effect by (5)\nend\n\nif <(Message) = [1]> then\n    if <(costume [name v]) = [map1]> then\n        switch costume to (level1location v)\n        set size to (10) %\n        create clone of (_myself_ v)\n        switch costume to (map1 v)\n        set size to (90) %\n    end\nend\nif <(Message) = [2]> then\n    if <(costume [name v]) = [map1]> then\n        switch costume to (level1location2 v)\n        set size to (10) %\n        create clone of (_myself_ v)\n        switch costume to (map1 v)\n        set size to (90) %\n    end\nend\nif <<(costume [name v]) = [player]> or <(costume [name v]) = [map1]>> then\n    show\n    set [ghost v] effect to (100)\n    repeat (20)\n        change [ghost v] effect by (-5)\n    end\n    show\nend\n\nwhen I receive [leaderboard v]\nhide\n\n@level\n\nwhen I receive [tick v]\ntick\n\ndefine tick\ngo to x: ((x) - (Player_X)) y: ((y) - (Player_Y))\nif <<not <((x) - (Player_X)) = (x position)>> or <not <((y) - (Player_Y)) = (y position)>>> then\n    hide\nelse\n    show\nend\n\nwhen I receive [start v]\nset [x v] to [0]\nset [y v] to [-495]\nswitch costume to (size v)\nif <(Location) = [1]> then\n    set size to (2000) %\nelse\n    if <(Location) = [2]> then\n        set size to (800) %\n    end\nend\nswitch costume to (join [Location] (Location))\n\nwhen I start as a clone\nif <(costume [number v]) = [3]> then\n    set [x v] to [0]\n    set [y v] to [-750]\nend\nif <(costume [number v]) = [4]> then\n    go to x: (0) y: ((y) - (Player_Y))\nend\n\nwhen I start as a clone\nset size to (120) %\nswitch costume to (costume2 v)\nforever\n    go to [front v] layer\nend\n\nwhen I receive [reset v]\nstop [other scripts in sprite v]\n\nwhen I receive [leaderboard v]\nhide\n\n@Sprite1\n\nwhen I receive [tick v]\ntick\n\ndefine tick\nif <(Location) = [2]> then\n    go to x: (((x) - (Player_X)) / (1.1)) y: (((y) - (Player_Y)) / (1.1))\nelse\n    go to x: (((x) - (Player_X)) / (2)) y: (((y) - (Player_Y)) / (2))\nend\n\nwhen I receive [start v]\nif <(Location) = [2]> then\n    go to [back v] layer\n    go [forward v] (2) layers\n    switch costume to (size v)\n    set size to (1700) %\n    switch costume to (join [Background] (Location))\n    set [x v] to [700]\n    set [y v] to [-670]\nelse\n    go to [back v] layer\n    go [forward v] (2) layers\n    switch costume to (size v)\n    set size to (1200) %\n    switch costume to (join [Background] (Location))\n    set [x v] to [0]\n    set [y v] to [-1040]\nend\n\nwhen I receive [reset v]\nstop [other scripts in sprite v]\n\nwhen I receive [leaderboard v]\nhide\n\nwhen I receive [flag v]\nshow\n\n@Sprite3\n\nwhen I receive [tick v]\ntick\n\ndefine tick\ngo to x: (((x) - (Player_X)) / (3)) y: (((y) - (Player_Y)) / (3))\n\nwhen I receive [start v]\nset [x v] to [0]\nset [y v] to [-750]\ngo to [back v] layer\ngo [forward v] (1) layers\nswitch costume to (size v)\nset size to (800) %\nswitch costume to (join [Background] (Location))\n\nwhen I receive [reset v]\nstop [other scripts in sprite v]\n\nwhen I receive [leaderboard v]\nhide\n\nwhen I receive [flag v]\nshow\n\n@torch\n\ndefine tick\ngo to x: ((x) - (Player_X)) y: ((y) - (Player_Y))\nif <<not <((x) - (Player_X)) = (x position)>> or <not <((y) - (Player_Y)) = (y position)>>> then\n    hide\nelse\n    show\nend\n\nwhen I receive [start v]\ndelete all of [fireloc v]\nif <(Location) = [1]> then\n    hide\n    set [x v] to [-1800]\n    set [y v] to [-78]\n    repeat (4)\n        switch costume to (costume1 v)\n        create clone of (_myself_ v)\n        change [x v] by (400)\n    end\n    repeat (5)\n        change [x v] by (400)\n    end\n    repeat (1)\n        switch costume to (costume1 v)\n        create clone of (_myself_ v)\n        change [x v] by (400)\n    end\n    switch costume to (none v)\nend\n\nwhen I receive [tick v]\ntick\n\nwhen I start as a clone\nadd (x) to [fireloc v]\nadd (y) to [fireloc v]\ngo to [back v] layer\ngo [forward v] (10) layers\nshow\n\nwhen I receive [reset v]\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen I receive [leaderboard v]\nhide\n\nwhen I receive [flag v]\nshow\n\n@fire particle\n\nwhen I start as a clone\nchange [firecone v] by (1)\nswitch costume to (costume2 v)\nset [ghost v] effect to (0)\nshow\nset size to (30) %\nrepeat (50)\n    switch costume to (costume2 v)\n    change size by (-0.5)\n    change [x v] by (pick random (-1.5) to (1.5))\n    change [y v] by (2)\n    change [color v] effect by (-0.75)\n    change [ghost v] effect by (2)\nend\nchange [firecone v] by (-1)\ndelete this clone\n\nwhen I receive [tick v]\ntick\n\ndefine tick\ngo to x: ((x) - (Player_X)) y: ((y) - (Player_Y))\nif <<not <((x) - (Player_X)) = (x position)>> or <not <((y) - (Player_Y)) = (y position)>>> then\n    delete this clone\nend\n\nwhen I receive [start v]\n\ngo to [back v] layer\ngo [forward v] (2) layers\nswitch costume to (fireblob2 v)\n\ndefine CreateFire\nset [numb v] to [0]\nrepeat ((length of [fireloc v]) / (2))\n    set [x v] to (item ((numb) + (1)) of [fireloc v])\n    set [y v] to (item ((numb) + (2)) of [fireloc v])\n    go to x: ((x) - (Player_X)) y: ((y) - (Player_Y))\n    if <<((x) - (Player_X)) = (x position)> or <((y) - (Player_Y)) = (y position)>> then\n        switch costume to (costume2 v)\n        go to [back v] layer\n        go [forward v] (((numb) + ((length of [fireloc v]) / (2))) + (11)) layers\n        switch costume to (master v)\n        create clone of (_myself_ v)\n    end\n    change [numb v] by (2)\nend\n\ngo [backward v] ((typeClone) + (-32)) layers\n\nwhen I receive [reset v]\nstop [other scripts in sprite v]\nbroadcast (go v)\ndelete this clone\n\nwhen I receive [go v]\nif <(costume [name v]) = [master]> then\n    switch costume to (master v)\n    set [firecone v] to [0]\n    hide\n    forever\n        CreateFire\n        if <(LagFree?) = [true]> then\n            wait (0.5) seconds\n        else\n            wait (0.16) seconds\n        end\n    end\nend\n\nwhen flag clicked\nswitch costume to (master v)\nbroadcast (go v)\n\nCreateFire\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen [l v] key pressed\nif <(State) = [1]> then\n    if <(LagFree?) = [true]> then\n        set [lagfree? v] to [false]\n    else\n        set [lagfree? v] to [true]\n    end\nend\n\nwhen I receive [menu v]\nset [state v] to [1]\n\nwhen I receive [flag v]\nset [state v] to [0]\n\nwhen I receive [dead v]\nset [state v] to [1]\n\n@fog particle\n\nwhen I receive [tick v]\ntick\n\nif <[level with fog v] contains (Location)?> then\nend\n\nwhen I receive [start v]\nif <[level with fog v] contains (Location)?> then\n    set [fogclones v] to [0]\n    set [x v] to [0]\n    set [y v] to [-400]\n    set [byy v] to [0]\n    set [byx v] to [0]\n    go to [front v] layer\n    forever\n        if <(FogClones) < (fogTicTime)> then\n            if <(LagFree?) = [true]> then\n                set [fogclones v] to [0]\n                set [x v] to [0]\n                set [y v] to [-400]\n                set [byy v] to [0]\n                set [byx v] to [0]\n                go to [front v] layer\n                set size to (115) %\n                switch costume to (5 v)\n                clear graphic effects\n                show\n            else\n                if <(master) = [0]> then\n                    switch costume to (size v)\n                    set size to (200) %\n                    switch costume to (costume1 v)\n                    create clone of (_myself_ v)\n                    hide\n                end\n            end\n        end\n    end\nend\n\ndefine tick\nif <(LagFree?) = [true]> then\n    set x to (0)\n    set y to ((y) - (Player_Y))\n    delete this clone\nelse\n    if <((fogTicTime) + (1)) > (numb)> then\n        change [numb v] by (1)\n        change [y v] by (byY)\n        change [x v] by (byX)\n        go to x: ((x) - (Player_X)) y: ((y) - (Player_Y))\n        change [ghost v] effect by ((100) / (fogTicTime))\n        if <(numb) > (fogTicTime)> then\n            change [fogclones v] by (-1)\n            delete this clone\n        end\n        if <<<[800] < (x position)> or <(x position) < [-800]>> or <<[800] < (y position)> or <(y position) < [-800]>>> then\n            change [fogclones v] by (-1)\n            delete this clone\n        end\n    end\nend\n\nhide\n\nwhen I start as a clone\nset [master v] to [1]\nshow\nchange [fogclones v] by (1)\nset [x v] to ((Player_X) + (pick random (-700) to (700)))\nset [y v] to [-400]\nset [numb v] to [0]\ngo to [front v] layer\nset [ghost v] effect to (0)\ngo [backward v] (12) layers\nset [byx v] to (pick random (-2) to (2))\nset [byy v] to (pick random (-1) to (4))\n\nwhen I receive [reset v]\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen flag clicked\nset [fogtictime v] to [40]\nset [master v] to [0]\n\nif <(master) = [0]> then\n\nwhen I receive [reset v]\ndelete this clone\n\n@rain particle\n\nwhen I start as a clone\nshow\nset [ghost v] effect to (pick random (40) to (70))\nset size to (pick random (60) to (100)) %\npoint in direction (90)\nset [changeyby v] to (pick random (-10) to (-18))\nset [x v] to ((Player_X) + (pick random (-600) to (600)))\nset [y v] to ((Player_Y) + (300))\ngo to x: (((x) - (Player_X)) / (1.6)) y: (((y) - (Player_Y)) / (1.6))\n\nwhen I receive [tick v]\nif <[level with rain v] contains (Location)?> then\n    tick\nend\n\nwhen I receive [start v]\nswitch costume to (master v)\nhide\nif <[level with rain v] contains (Location)?> then\n    broadcast (rainSounds v)\n    go to [front v] layer\n    go [backward v] (10) layers\n    set [ghost v] effect to (30)\n    forever\n        if <(LagFree?) = [true]> then\n            set [amount v] to [10]\n        else\n            set [amount v] to [35]\n        end\n        wait (pick random (0) to (1.5)) seconds\n        repeat (amount)\n            repeat ((amount) * (2))\n                switch costume to (rain v)\n                create clone of (_myself_ v)\n                switch costume to (master v)\n            end\n        end\n    end\nend\n\ndefine tick\ngo to [front v] layer\ngo [backward v] (12) layers\nchange [y v] by (changeYBy)\ngo to x: (((x) - (Player_X)) / (1.5)) y: (((y) - (Player_Y)) / (1.5))\nif <touching (level v)?> then\n    delete this clone\nend\nif <(y) < [-400]> then\n    delete this clone\nend\n\nwhen I receive [rainsounds v]\nset volume to (70) %\nforever\n    play sound [The-sound-of-rain v] until done\nend\n\nwhen I receive [reset v]\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen I receive [thunder v]\nif <(costume [name v]) = [master]> then\n    wait (pick random (0.3) to (1.5)) seconds\n    play sound (join [thunder] (pick random (1) to (3))) until done\nend\n\nstart sound [thunder3 v]\n\nbroadcast (thunder v)\n\nthink (join [thunder] (pick random (1) to (3))) for (2) seconds\n\nwhen I receive [start v]\nif <(Location) = [1]> then\n    forever\n        wait (pick random (5) to (60)) seconds\n        broadcast (thunder v) and wait\n    end\nend\n\nwhen I receive [reset v]\ndelete this clone\n\n@Sprite2\n\nwhen I receive [tick v]\ntick\n\nwhen I receive [start v]\nset [x v] to [0]\nset [y v] to [0]\ngo to [back v] layer\nswitch costume to (size v)\nset size to (900) %\nswitch costume to (join [backdrop] (Location))\n\ndefine tick\ngo to x: (0) y: ((y) - (Player_Y))\n\nwhen I receive [reset v]\nstop [other scripts in sprite v]\n\nwhen I receive [hideenemycomputer v]\nshow\n\nwhen I receive [leaderboard v]\nhide\n\nwhen I receive [flag v]\nshow\n\n@Thumbnail\n\nwhen flag clicked\nshow\nswitch costume to (thumbnail v)\nset [ghost v] effect to (0)\ngo to x: (0) y: (0)\ngo to [back v] layer\ngo [forward v] (23) layers\nforever\n    go to [back v] layer\n    if <(is100?) = [yes]> then\n        go [forward v] (20) layers\n    else\n        go [forward v] (23) layers\n    end\nend\n\nwhen I receive [dismissthumbnail v]\nstop [other scripts in sprite v]\ngo to [front v] layer\nrepeat (10)\n    go to [front v] layer\n    change [ghost v] effect by (10)\nend\nset [ghost v] effect to (100)\nforever\n    go to [front v] layer\nend\n\nwhen I receive [startmusic v]\nstop [other scripts in sprite v]\nforever\n    go to [front v] layer\n    go [backward v] (3) layers\nend\n\n@dark\n\nwhen I receive [start v]\nif <(Location) = [1]> then\n    show\n    set size to (120) %\n    set [ghost v] effect to (30)\n    forever\n        go to [front v] layer\n        go [backward v] (5) layers\n    end\nelse\n    hide\nend\n\ndefine layer\n\nlayer\n\nwhen I receive [reset v]\nstop [other scripts in sprite v]\n\nwhen I receive [thunder v]\nset [brightness v] effect to (0)\nrepeat (5)\n    change [brightness v] effect by (20)\nend\nset [brightness v] effect to (100)\nrepeat (10)\n    change [brightness v] effect by (-10)\nend\nset [brightness v] effect to (0)\n\nclear graphic effects\n\nwait (0.01) seconds\n\nwait (1) seconds\n\nwhen I receive [leaderboard v]\nhide\n\nwhen I receive [flag v]\nshow\n\n@TutorialAn\n\nswitch costume to (keys v)\nwait (0.6) seconds\nswitch costume to (s pressed v)\nwait (0.6) seconds\n\nwhen I receive [how to move v]\nshow\nset [ghost v] effect to (0)\nswitch costume to (keys v)\nwait (0.6) seconds\nforever\n    switch costume to (a pressed v)\n    wait (0.6) seconds\n    switch costume to (keys v)\n    wait (0.6) seconds\n    switch costume to (w pressed v)\n    wait (0.6) seconds\n    switch costume to (keys v)\n    wait (0.6) seconds\n    switch costume to (d pressed v)\n    wait (0.6) seconds\n    switch costume to (keys v)\n    wait (0.6) seconds\nend\n\nforever\n\nwhen I receive [how to move v]\nrepeat until <<key (up arrow v) pressed?> or <<key (down arrow v) pressed?> or <<key (left arrow v) pressed?> or <<key (right arrow v) pressed?> or <<key (w v) pressed?> or <<key (s v) pressed?> or <<key (a v) pressed?> or <key (d v) pressed?>>>>>>>>\n    go to [front v] layer\n    go [backward v] (2) layers\nend\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\nstop [other scripts in sprite v]\n\nbroadcast (how to move v)\n\nwhen I receive [how to attack v]\nrepeat until <key (space v) pressed?>\n    go to [front v] layer\n    go [backward v] (1) layers\nend\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\nstop [other scripts in sprite v]\n\nwhen I receive [how to attack v]\nshow\nset [ghost v] effect to (0)\nforever\n    switch costume to (space v)\n    wait (1) seconds\n    switch costume to (spacepressed v)\n    wait (1) seconds\nend\n\nwhen I receive [hideenemycomputer v]\nshow\n\nwhen I receive [showenemycomputerone v]\nhide\n\n@Tutorial\n\nwhen I receive [how to move v]\ngo to x: (67) y: (-152)\nswitch costume to (costume1 v)\nset [ghost v] effect to (0)\nset size to (85) %\nshow\nforever\n    repeat (90)\n        change [ghost v] effect by (-0.5)\n        change size by (0.05)\n    end\n    repeat (90)\n        change [ghost v] effect by (0.5)\n        change size by (-0.05)\n    end\nend\n\nwhen I receive [how to move v]\nrepeat until <<key (up arrow v) pressed?> or <<key (down arrow v) pressed?> or <<key (left arrow v) pressed?> or <<key (right arrow v) pressed?> or <<key (w v) pressed?> or <<key (s v) pressed?> or <<key (a v) pressed?> or <key (d v) pressed?>>>>>>>>\n    go to [front v] layer\n    go [backward v] (2) layers\nend\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\nstop [other scripts in sprite v]\nbroadcast (how to attack v) and wait\n\nwhen I receive [how to attack v]\ngo to x: (67) y: (-152)\nswitch costume to (costume2 v)\nset [ghost v] effect to (0)\nset size to (85) %\nshow\nforever\n    repeat (90)\n        change [ghost v] effect by (-0.5)\n        change size by (0.05)\n    end\n    repeat (90)\n        change [ghost v] effect by (0.5)\n        change size by (-0.05)\n    end\nend\n\nwhen I receive [how to attack v]\nrepeat until <key (space v) pressed?>\n    go to [front v] layer\n    go [backward v] (2) layers\nend\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\nstop [other scripts in sprite v]\n\nwhen I receive [message_3 v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\nstop [other scripts in sprite v]\n\nwhen I receive [dead v]\nstop [other scripts in sprite v]\nhide\n\n@Menu\n\nwhen I receive [menu v]\nif <(costume [number v]) = [1]> then\n    setup\n    if <(is100?) = [yes]> then\n        100\n    end\nelse\n    delete this clone\nend\n\nwhen I start as a clone\nshow\ngo to x: (0) y: (0)\nset size to (115) %\nforever\n    go to [front v] layer\n    go [backward v] (1) layers\n    broadcast (Go To Front v)\n    update\nend\n\nwhen I receive [flag v]\ndelete this clone\n\nwhen I start as a clone\nif <<(costume [name v]) = [8]> or <(costume [name v]) = [8-2]>> then\n    wait until <<(playButtonTouch) = [true]> and <mouse down?>>\n    wait until <not <mouse down?>>\n    play sound [Coin v] until done\n    set [playbuttontouch v] to [false]\n    broadcast (flag v)\nend\nif <<(costume [name v]) = [10]> or <(costume [name v]) = [10-2]>> then\n    wait until <<(LeaderboardTouch) = [true]> and <mouse down?>>\n    wait until <not <mouse down?>>\n    play sound [Coin v] until done\n    set [leaderboardtouch v] to [false]\n    broadcast (openLeaderboard v)\nend\n\nwhen flag clicked\nswitch costume to (master v)\n\nbroadcast (menu v)\n\ndefine setup\nswitch costume to (1 v)\nrepeat (11)\n    create clone of (_myself_ v)\n    next costume\nend\nswitch costume to (master v)\n\ndefine pop\ngo to [front v] layer\nset size to (145) %\nrepeat until <(size) < [116]>\n    go to x: ((mouse x) / (30)) y: ((mouse y) / (30))\n    go to [front v] layer\n    change size by (-6)\nend\nset size to (115) %\ngo to [front v] layer\n\nwhen I receive [leaderboard v]\nif <(costume [number v]) = [1]> then\n    setup2\nelse\n    delete this clone\nend\n\ndefine setup2\nswitch costume to (1 v)\nrepeat (6)\n    create clone of (_myself_ v)\n    next costume\nend\nswitch costume to (master v)\n\nhide\n\ndefine update\nbroadcast (Go To Front v)\nif <(costume [name v]) = [1]> then\n    go to x: ((mouse x) / (45)) y: ((mouse y) / (45))\nend\nif <(costume [name v]) = [2]> then\n    go to x: ((mouse x) / (40)) y: ((mouse y) / (40))\nend\nif <(costume [name v]) = [3]> then\n    go to x: ((mouse x) / (30)) y: ((mouse y) / (30))\nend\nif <(costume [name v]) = [4]> then\n    go to x: ((mouse x) / (20)) y: ((mouse y) / (20))\nend\nif <(costume [name v]) = [5]> then\n    go to x: ((mouse x) / (8)) y: ((mouse y) / (8))\n    set [ghost v] effect to (30)\nend\nif <(costume [name v]) = [6]> then\n    go to x: (0) y: (0)\n    set [ghost v] effect to (50)\nend\nif <(costume [name v]) = [7]> then\n    go to x: ((mouse x) / (30)) y: ((mouse y) / (30))\nend\nif <<(costume [name v]) = [8]> or <(costume [name v]) = [8-2]>> then\n    set size to (115) %\n    go to x: ((mouse x) / (30)) y: ((mouse y) / (30))\n    if <(playButtonTouch) = [false]> then\n        switch costume to (8-2 v)\n    else\n        switch costume to (8 v)\n    end\n    set [wastouching? v] to (playButtonTouch)\nend\nif <(costume [name v]) = [9]> then\n    go to x: ((mouse x) / (30)) y: ((mouse y) / (30))\n    set [ghost v] effect to (99)\n    if <touching (mouse-pointer v)?> then\n        set [playbuttontouch v] to [true]\n    else\n        set [playbuttontouch v] to [false]\n    end\nend\nif <<(costume [name v]) = [10]> or <(costume [name v]) = [10-2]>> then\n    set size to (115) %\n    go to x: ((mouse x) / (30)) y: ((mouse y) / (30))\n    if <(LeaderboardTouch) = [false]> then\n        switch costume to (10-2 v)\n    else\n        switch costume to (10 v)\n    end\n    set [wastouching2 v] to (LeaderboardTouch)\nend\nif <(costume [name v]) = [11]> then\n    go to x: ((mouse x) / (30)) y: ((mouse y) / (30))\n    set [ghost v] effect to (99)\n    if <touching (mouse-pointer v)?> then\n        set [leaderboardtouch v] to [true]\n    else\n        set [leaderboardtouch v] to [false]\n    end\nend\nbroadcast (Go To Front v)\n\nif <not <(wasTouching?) = (playButtonTouch)>> then\n    pop\nend\n\nif <not <(wasTouching2) = (LeaderboardTouch)>> then\n    pop\nend\n\nif <[30] < (typeClones)> then\n\ngo [backward v] (80) layers\n\nbroadcast (Go To Front v) and wait\n\ndefine 100\nswitch costume to (button v)\ncreate clone of (_myself_ v)\nswitch costume to (button2 v)\ncreate clone of (_myself_ v)\nswitch costume to (master v)\n\nwhen I start as a clone\nif <(costume [name v]) = [button]> then\n    go to x: (200) y: (0)\n    set size to (60) %\n    clear graphic effects\n    show\n    forever\n        go to x: (((mouse x) / (30)) + (200)) y: ((mouse y) / (30))\n        go to [front v] layer\n        if <(100) = [false]> then\n            set [brightness v] effect to (-10)\n        else\n            set [brightness v] effect to (0)\n        end\n        if <<mouse down?> and <touching (mouse-pointer v)?>> then\n            set [100 v] to [true]\n            wait until <<not <mouse down?>> and <touching (mouse-pointer v)?>>\n        end\n    end\nend\nif <(costume [name v]) = [button2]> then\n    go to x: (200) y: (-50)\n    set size to (60) %\n    clear graphic effects\n    show\n    forever\n        go to x: (((mouse x) / (30)) + (200)) y: (((mouse y) / (30)) - (50))\n        go to [front v] layer\n        if <(100) = [true]> then\n            set [brightness v] effect to (-60)\n        else\n            set [brightness v] effect to (0)\n        end\n        if <<mouse down?> and <touching (mouse-pointer v)?>> then\n            set [100 v] to [false]\n            wait until <<not <mouse down?>> and <touching (mouse-pointer v)?>>\n        end\n    end\nend\n\nif <(100) = [false]> then\nelse\n    set [100 v] to [false]\nend\n\n@Leaderboard\n\nwhen I receive [dead v]\nif <(costume [number v]) = [1]> then\n    broadcast (Leaderboard v)\n    go to [front v] layer\n    show\nend\nwait (0.1) seconds\ncreate clone of (_myself_ v)\nswitch costume to (2 v)\ncreate clone of (_myself_ v)\nswitch costume to (leaderboard v)\nhide\n\nwhen I receive [menu v]\nhide\n\nwhen I start as a clone\nif <not <(costume [number v]) = [1]>> then\n    go to x: (0) y: (-150)\n    set size to (90) %\n    forever\n        go to [front v] layer\n        if <not <touching (mouse-pointer v)?>> then\n            switch costume to (2 v)\n        else\n            if <not <(wasTouching?) = (playButtonTouch)>> then\n                switch costume to (1 v)\n            end\n        end\n        set [wastouching? v] to <touching (mouse-pointer v)?>\n    end\nend\n\nwhen I start as a clone\nset volume to (80) %\nif <not <(costume [number v]) = [1]>> then\n    wait until <<touching (mouse-pointer v)?> and <mouse down?>>\n    wait until <not <mouse down?>>\n    wait (0.1) seconds\n    broadcast (menu v)\n    play sound [Coin v] until done\n    delete this clone\nend\n\nwhen I receive [go to front v]\ngo to [front v] layer\n\nwhen flag clicked\nswitch costume to (leaderboard v)\n\nwhen I receive [openleaderboard v]\nif <(costume [number v]) = [1]> then\n    broadcast (Leaderboard v)\n    go to [front v] layer\n    show\nend\nwait (0.1) seconds\ncreate clone of (_myself_ v)\nswitch costume to (2 v)\ncreate clone of (_myself_ v)\nswitch costume to (leaderboard v)\nhide\n\nwhen I receive [menu v]\nwait (0.1) seconds\ndelete this clone\n\nwhen flag clicked\nset [lagfree? v] to [false]\n\n@Leaderboard2\n\ndefine encode (txt)\nset [encode.textlist v] to [ abcdefghijklmnopqrstuvwxyz0123456789`~-_=+!@#$%^&*\(\)\[\]\{}|;':",./<>?]\nset [encode.encodedtext v] to []\nset [encode.i v] to [0]\nrepeat (length of (txt))\n    set [encode.j v] to [0]\n    change [encode.i v] by (1)\n    repeat until <<(letter (encode.j) of (encode.textList)) = (letter (encode.i) of (txt))> or <(encode.j) > (length of (encode.textList))>>\n        change [encode.j v] by (1)\n    end\n    if <(length of (encode.j)) < [2]> then\n        set [encode.j v] to (join [0] (encode.j))\n    end\n    set [encode.encodedtext v] to (join (encode.encodedText) (encode.j))\nend\n\ndefine setSlot (value) (slot)\nif <(slot) = [1]> then\n    set [☁ listslot_1 v] to (value)\nend\nif <(slot) = [2]> then\n    set [☁ listslot_2 v] to (value)\nend\nif <(slot) = [3]> then\n    set [☁ listslot_3 v] to (value)\nend\nif <(slot) = [4]> then\n    set [☁ listslot_4 v] to (value)\nend\nif <(slot) = [5]> then\n    set [☁ listslot_5 v] to (value)\nend\n\ndefine getUsernameIndex (name)\nset [nameindex.i v] to [0]\nrepeat (length of [names v])\n    change [nameindex.i v] by (1)\n    if <(name) = (item (nameIndex.i) of [names v])> then\n        stop [this script v]\n    end\nend\n\ndefine grabScores\ndelete (all) of [names v]\ndelete (all) of [scores v]\ndecode (☁ ListSlot_1)\ndoubleSplitter (decode.decodedText) [~]\nadd (split.after) to [names v]\nadd (split.before) to [scores v]\ndecode (☁ ListSlot_2)\ndoubleSplitter (decode.decodedText) [~]\nadd (split.after) to [names v]\nadd (split.before) to [scores v]\ndecode (☁ ListSlot_3)\ndoubleSplitter (decode.decodedText) [~]\nadd (split.after) to [names v]\nadd (split.before) to [scores v]\ndecode (☁ ListSlot_4)\ndoubleSplitter (decode.decodedText) [~]\nadd (split.after) to [names v]\nadd (split.before) to [scores v]\ndecode (☁ ListSlot_5)\ndoubleSplitter (decode.decodedText) [~]\nadd (split.after) to [names v]\nadd (split.before) to [scores v]\n\nsetScore [hi] (56)\n\nsetScore [Mid-Low] (3)\nsetScore [High] (10)\nsetScore [Mid-High] (7)\nsetScore [Mid-High2] (900)\nsetScore [Low] (2)\nsetScore [bob] (758)\n\ndefine setScore (username) (score)\ngrabScores\nset [set.i v] to [1]\nrepeat until <<[8] < ((set.i) + (1))> or <(item (set.i) of [scores v]) < (score)>>\n    change [set.i v] by (1)\nend\nif <[0] < (set.i)> then\n    if <[names v] contains (username)?> then\n        getUsernameIndex (username)\n        if <(score) < (item (nameIndex.i) of [scores v])> then\n            stop [this script v]\n        end\n        delete (nameIndex.i) of [scores v]\n        delete (nameIndex.i) of [names v]\n    else\n        delete (last) of [scores v]\n        delete (last) of [names v]\n    end\n    insert (score) at (set.i) of [scores v] \n    insert (username) at (set.i) of [names v] \n    set [set.length v] to (set.i)\n    repeat ((length of [scores v]) - ((set.length) + (-1)))\n        encode (join (item (set.i) of [scores v]) (join [~] (item (set.i) of [names v])))\n        setSlot (encode.encodedText) (set.i)\n        change [set.i v] by (1)\n        wait (0.2) seconds\n    end\nend\nset [numbcon v] to [0]\nrepeat (5)\n    change [numbcon v] by (1)\n    encode (join (item (numbCon) of [scores v]) (join [~] (item (numbCon) of [names v])))\n    setSlot (encode.encodedText) (numbCon)\n    wait (0.2) seconds\nend\n\ndelete (1) of [scores v]\n\ndelete (1) of [names v]\n\ndefine doubleSplitter (str) (spt)\nset [split.before v] to []\nset [split.i v] to [1]\nrepeat until <<(letter (split.i) of (str)) = (spt)> or <(split.i) > (length of (str))>>\n    set [split.before v] to (join (split.before) (letter (split.i) of (str)))\n    change [split.i v] by (1)\nend\nset [split.after v] to []\nchange [split.i v] by (1)\nrepeat until <(split.i) > (length of (str))>\n    set [split.after v] to (join (split.after) (letter (split.i) of (str)))\n    change [split.i v] by (1)\nend\n\ndefine decode (code)\nset [decode.i v] to [1]\nset [decode.textlist v] to [ abcdefghijklmnopqrstuvwxyz0123456789`~-_=+!@#$%^&*\(\)\[\]\{}|;':",./<>?]\nset [decode.decodedtext v] to []\nrepeat until <(decode.i) > (length of (code))>\n    set [decode.decodedtext v] to (join (decode.decodedText) (letter (join (letter (decode.i) of (code)) (letter ((decode.i) + (1)) of (code))) of (decode.textList)))\n    change [decode.i v] by (2)\nend\n\ndefine resetAll\nencode [0~null]\nwait (0.5) seconds\nsetSlot (encode.encodedText) (1)\nwait (0.5) seconds\nsetSlot (encode.encodedText) (2)\nwait (0.5) seconds\nsetSlot (encode.encodedText) (3)\nwait (0.5) seconds\nsetSlot (encode.encodedText) (4)\nwait (0.5) seconds\nsetSlot (encode.encodedText) (5)\n\nwhen flag clicked\nsetupLeaderboard\n\nwhen I receive [dead v]\nsetScore (username) (Score)\nsetupLeaderboard\n\nwhen flag clicked\nif <<(username) = [sirbuildsalot]> and <key (r v) pressed?>> then\n    resetAll\n    setupLeaderboard\nend\n\nchange [numb v] by (1)\nset [numb v] to [0]\n\nset [numb2 v] to [0]\nset [numb v] to [0]\nrepeat (length of [names v])\n    change [numb v] by (1)\n    if <not <(item (numb) of [names v]) = [null]>> then\n        change [numb2 v] by (1)\n    end\nend\n\nsetupLeaderboard\n\nsetScore [pop] (891)\n\ndefine setupLeaderboard\ndelete (all) of [leaderboard v]\ngrabScores\nset [leaderboard.i v] to [0]\nrepeat (length of [names v])\n    change [leaderboard.i v] by (1)\n    if <(item (leaderboard.i) of [scores v]) < [1]> then\n        stop [this script v]\n    end\n    add (join (join (leaderboard.i) [. ]) (join (item (leaderboard.i) of [names v]) (join [ - ] (item (leaderboard.i) of [scores v])))) to [leaderboard v]\nend\n\nwhen I receive [leaderboard v]\nsetupLeaderboard\n\n@Text\n\nwhen I start as a clone\nchange [typeclone2 v] by (1)\nforever\n    go to [front v] layer\nend\n\nwait (0.01) seconds\n\nwhen I start as a clone\nshow\ngo to [front v] layer\nif <(Shake Text) = [YES!]> then\n    forever\n        change y by (2)\n        wait (0.1) seconds\n        change y by (1)\n        wait (0.1) seconds\n        change y by (-1)\n        wait (0.1) seconds\n        change y by (-2)\n        wait (0.1) seconds\n    end\nend\n\nwhen I receive [clear v]\nset [typeclone2 v] to [1]\ndelete this clone\n\ndefine findcode (capitalletter)\nset [j v] to [0]\nrepeat until <(item (j) of [caps v]) = (capitalletter)>\n    change [j v] by (1)\nend\n\ndefine type (string) x: (x) y: (y) Talk: (#) Delay: (sec) Shake: (y/n) Color (color)\nskip (string) x: (x) y: (y) shake (y/n) Color (color)\n\nbroadcast (Clear v)\n\ndefine skip (string) x: (x) y: (y) shake (y/n) Color (color)\ngo to x: (x) y: (y)\nset size to (Text Size) %\nset [brightness v] effect to (100)\nset [i v] to [0]\nif <(y/n) = [Y]> then\n    set [shake text v] to [YES!]\nelse\n    set [shake text v] to [NO]\nend\nset [text color v] to (color)\nrepeat until <(i) = (length of (string))>\n    set size to (Text Size) %\n    change [i v] by (1)\n    if <(letter (i) of (string)) = [\]> then\n        set x to (x)\n        change y by (-30)\n    else\n        if <(letter (i) of (string)) = [|]> then\n            set x to ((x) + (22))\n            change y by (-25)\n        else\n            if <(letter (i) of (string)) = [ ]> then\n                change x by (10)\n            else\n                if <(letter (i) of (string)) = [*]> then\n                    switch costume to (* v)\n                    set size to (Text Size) %\n                    create clone of (_myself_ v)\n                    change x by (25)\n                else\n                    if <<(letter (i) of (string)) = [~]> and <[caps v] contains (letter ((i) + (1)) of (string))?>> then\n                        change [i v] by (1)\n                        findcode (letter (i) of (string))\n                        switch costume to (join (item (j) of [caps v]) [ ])\n                        set [brightness v] effect to (0)\n                        set size to (Text Size) %\n                        create clone of (_myself_ v)\n                        change x by (Letter Distiance)\n                    else\n                        if <<(letter (i) of (string)) = [/]> and <[caps v] contains (letter ((i) + (1)) of (string))?>> then\n                            change [i v] by (1)\n                            findcode (letter (i) of (string))\n                            switch costume to (join (item (j) of [caps v]) [ ])\n                            set [brightness v] effect to (100)\n                            set size to (Text Size) %\n                            create clone of (_myself_ v)\n                            change x by (Letter Distiance)\n                        else\n                            switch costume to (letter (i) of (string))\n                            set [brightness v] effect to (100)\n                            set size to (Text Size) %\n                            create clone of (_myself_ v)\n                            change x by (Letter Distiance)\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen I start as a clone\nif <(Text Color) = [Red]> then\n    set [color v] effect to (-25)\nelse\n    if <(Text Color) = [Orange]> then\n        set [color v] effect to (-15)\n    else\n        if <(Text Color) = [Yellow]> then\n            set [color v] effect to (0)\n        else\n            if <(Text Color) = [Green]> then\n                set [color v] effect to (30)\n            else\n                if <(Text Color) = [Cyan]> then\n                    set [color v] effect to (60)\n                else\n                    if <(Text Color) = [Blue]> then\n                        set [color v] effect to (100)\n                    else\n                        if <(Text Color) = [Purple]> then\n                            set [color v] effect to (120)\n                        else\n                            if <(Text Color) = [Rainbow]> then\n                                repeat until <not <(Text Color) = [Rainbow]>>\n                                    repeat (100)\n                                        change [color v] effect by (2)\n                                    end\n                                    set [color v] effect to (0)\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\ntype [* /You're ~B~L~U~E now.] x: [-100] y: [-80] Talk: [5] Delay: [0.1] Shake: [N] Color [Blue]\nwait until <key (z v) pressed?>\nstart sound [snd_select v]\nbroadcast (Clear v)\ntype [* /Shake shake shake.] x: [-100] y: [-80] Talk: [5] Delay: [0] Shake: [Y] Color [Blue]\nwait until <key (z v) pressed?>\nstart sound [snd_select v]\nbroadcast (Clear v)\ntype [* ~H~O~P~E~S and ~D~R~E~A~M~S] x: [-100] y: [-80] Talk: [5] Delay: [0] Shake: [N] Color [Rainbow]\n\ntype [test] x: [-210] y: [-90] Talk: [2] Delay: [0.001] Shake: [N] Color [Yellow]\ntype [test] x: [-210] y: [-90] Talk: [2] Delay: [0.001] Shake: [N] Color [Yellow]\n\nbroadcast (Clear v)\n\nwhen I receive [reset v]\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen I receive [flag v]\nforever\n    if <(Shake Text) = [YES!]> then\n        forever\n            change y by (4)\n            wait (0.1) seconds\n            change y by (2)\n            wait (0.1) seconds\n            change y by (-2)\n            wait (0.1) seconds\n            change y by (-4)\n            wait (0.1) seconds\n        end\n    end\nend\n\nset volume to (10) %\n\ndefine wait\nwait until <not <key (z v) pressed?>>\nwait until <key (z v) pressed?>\nwait until <not <key (z v) pressed?>>\n\nwhen I receive [openleaderboard v]\nset [text size v] to [100]\nset [letter distiance v] to [17]\nbroadcast (Clear v)\nskip (item (1) of [leaderboard v]) x: [-200] y: [60] shake [N] Color [Yellow]\nskip (item (2) of [leaderboard v]) x: [-200] y: [20] shake [N] Color [Yellow]\nskip (item (3) of [leaderboard v]) x: [-200] y: [-20] shake [N] Color [Yellow]\nskip (item (4) of [leaderboard v]) x: [-200] y: [-60] shake [N] Color [Yellow]\nskip (item (5) of [leaderboard v]) x: [-200] y: [-100] shake [N] Color [Yellow]\n\nwhen I receive [menu v]\nset [typeclones v] to [0]\nbroadcast (Clear v)\n\nwhen I receive [go to front v]\ngo to [front v] layer\n\nwhen I receive [dead v]\nset [text size v] to [100]\nset [letter distiance v] to [17]\nbroadcast (Clear v)\nskip (join [/score: ] (Score)) x: [-120] y: [20] shake [N] Color [Yellow]\nskip (join [/time: ] (timer)) x: [-120] y: [-20] shake [N] Color [Yellow]\nset [text size v] to [60]\nset [letter distiance v] to [10]\nskip [/click to continue to leaderboard.] x: [-170] y: [-100] shake [N] Color [Yellow]\nwait until <<mouse down?> or <key (space v) pressed?>>\nwait until <<not <mouse down?>> and <not <key (space v) pressed?>>>\nbroadcast (Clear v)\nset [text size v] to [100]\nset [letter distiance v] to [17]\nskip (item (1) of [leaderboard v]) x: [-200] y: [60] shake [N] Color [Yellow]\nskip (item (2) of [leaderboard v]) x: [-200] y: [20] shake [N] Color [Yellow]\nskip (item (3) of [leaderboard v]) x: [-200] y: [-20] shake [N] Color [Yellow]\nskip (item (4) of [leaderboard v]) x: [-200] y: [-60] shake [N] Color [Yellow]\nskip (item (5) of [leaderboard v]) x: [-200] y: [-100] shake [N] Color [Yellow]\n\nwhen I receive [flag v]\nreset timer\n\nif <(length of [leaderboard v]) = [1]> then\n    skip (item (1) of [leaderboard v]) x: [-180] y: [60] shake [N] Color [Yellow]\nelse\n    if <(length of [leaderboard v]) = [2]> then\n        skip (item (2) of [leaderboard v]) x: [-180] y: [60] shake [N] Color [Yellow]\n        skip (item (1) of [leaderboard v]) x: [-180] y: [20] shake [N] Color [Yellow]\n    else\n        if <(length of [leaderboard v]) = [3]> then\n            skip (item (3) of [leaderboard v]) x: [-180] y: [60] shake [N] Color [Yellow]\n            skip (item (2) of [leaderboard v]) x: [-180] y: [20] shake [N] Color [Yellow]\n            skip (item (1) of [leaderboard v]) x: [-180] y: [-20] shake [N] Color [Yellow]\n        else\n            if <(length of [leaderboard v]) = [4]> then\n                skip (item (4) of [leaderboard v]) x: [-180] y: [60] shake [N] Color [Yellow]\n                skip (item (3) of [leaderboard v]) x: [-180] y: [20] shake [N] Color [Yellow]\n                skip (item (2) of [leaderboard v]) x: [-180] y: [-20] shake [N] Color [Yellow]\n                skip (item (1) of [leaderboard v]) x: [-180] y: [-60] shake [N] Color [Yellow]\n            else\n            end\n        end\n    end\nend\n\nif <(length of [leaderboard v]) = [1]> then\n    skip (item (1) of [leaderboard v]) x: [-180] y: [60] shake [N] Color [Yellow]\nelse\n    if <(length of [leaderboard v]) = [2]> then\n        skip (item (2) of [leaderboard v]) x: [-180] y: [60] shake [N] Color [Yellow]\n        skip (item (1) of [leaderboard v]) x: [-180] y: [20] shake [N] Color [Yellow]\n    else\n        if <(length of [leaderboard v]) = [3]> then\n            skip (item (3) of [leaderboard v]) x: [-180] y: [60] shake [N] Color [Yellow]\n            skip (item (2) of [leaderboard v]) x: [-180] y: [20] shake [N] Color [Yellow]\n            skip (item (1) of [leaderboard v]) x: [-180] y: [-20] shake [N] Color [Yellow]\n        else\n            if <(length of [leaderboard v]) = [4]> then\n                skip (item (4) of [leaderboard v]) x: [-180] y: [60] shake [N] Color [Yellow]\n                skip (item (3) of [leaderboard v]) x: [-180] y: [20] shake [N] Color [Yellow]\n                skip (item (2) of [leaderboard v]) x: [-180] y: [-20] shake [N] Color [Yellow]\n                skip (item (1) of [leaderboard v]) x: [-180] y: [-60] shake [N] Color [Yellow]\n            else\n                skip (item (5) of [leaderboard v]) x: [-180] y: [60] shake [N] Color [Yellow]\n                skip (item (4) of [leaderboard v]) x: [-180] y: [20] shake [N] Color [Yellow]\n                skip (item (3) of [leaderboard v]) x: [-180] y: [-20] shake [N] Color [Yellow]\n                skip (item (2) of [leaderboard v]) x: [-180] y: [-60] shake [N] Color [Yellow]\n                skip (item (1) of [leaderboard v]) x: [-180] y: [-100] shake [N] Color [Yellow]\n            end\n        end\n    end\nend\n\n@SCORE\n\nwhen I receive [leaderboard v]\ndelete this clone\n\nwhen I start as a clone\nshow\nforever\n    if <(letter (scoreNumber) of (Score)) = [0]> then\n        switch costume to (10 v)\n    else\n        switch costume to (letter (scoreNumber) of (Score))\n    end\n    if <(scoreNumber) = [1]> then\n        show\n        if <(length of (Score)) = [1]> then\n            go to x: (x) y: (y)\n        else\n            if <(length of (Score)) = [2]> then\n                go to x: ((x) - (6)) y: (y)\n            else\n                if <(length of (Score)) = [3]> then\n                    go to x: ((x) - (12)) y: (y)\n                else\n                    if <(length of (Score)) = [4]> then\n                        go to x: ((x) - (18)) y: (y)\n                    else\n                        if <(length of (Score)) = [5]> then\n                            go to x: ((x) - (24)) y: (y)\n                        end\n                    end\n                end\n            end\n        end\n    else\n        if <(scoreNumber) = [2]> then\n            if <(length of (Score)) = [1]> then\n                hide\n            else\n                show\n                if <(length of (Score)) = [2]> then\n                    go to x: ((x) + (6)) y: (y)\n                else\n                    if <(length of (Score)) = [3]> then\n                        go to x: (x) y: (y)\n                    else\n                        if <(length of (Score)) = [4]> then\n                            go to x: ((x) - (6)) y: (y)\n                        else\n                            if <(length of (Score)) = [5]> then\n                                go to x: ((x) - (12)) y: (y)\n                            end\n                        end\n                    end\n                end\n            end\n        else\n            if <(scoreNumber) = [3]> then\n                if <<(length of (Score)) = [1]> or <(length of (Score)) = [2]>> then\n                    hide\n                else\n                    show\n                    if <(length of (Score)) = [3]> then\n                        go to x: ((x) + (12)) y: (y)\n                    else\n                        if <(length of (Score)) = [4]> then\n                            go to x: ((x) + (6)) y: (y)\n                        else\n                            if <(length of (Score)) = [5]> then\n                                go to x: (x) y: (y)\n                            end\n                        end\n                    end\n                end\n            else\n                if <(scoreNumber) = [4]> then\n                    if <<(length of (Score)) = [1]> or <<(length of (Score)) = [2]> or <(length of (Score)) = [3]>>> then\n                        hide\n                    else\n                        show\n                        if <(length of (Score)) = [4]> then\n                            go to x: ((x) + (18)) y: (y)\n                        else\n                            if <(length of (Score)) = [5]> then\n                                go to x: ((x) + (12)) y: (y)\n                            end\n                        end\n                    end\n                else\n                    if <<(length of (Score)) = [1]> or <<(length of (Score)) = [2]> or <<(length of (Score)) = [3]> or <(length of (Score)) = [4]>>>> then\n                        hide\n                    else\n                        show\n                        if <(length of (Score)) = [5]> then\n                            go to x: ((x) + (24)) y: (y)\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen I receive [flag v]\nwait (0.1) seconds\ngo to [front v] layer\ngo [backward v] (1) layers\nhide\nset [scorenumber v] to [1]\nset [y v] to [160]\nset [x v] to [-200]\nrepeat (5)\n    create clone of (_myself_ v)\n    change [scorenumber v] by (1)\nend\nset [scorenumber v] to [0]\n\nwhen I start as a clone\nforever\n    go to [front v] layer\nend\n\n@logo\n\nstart sound [LogoSound v]\n\nstart sound [LogoSound v]\nset [pitch v] effect to (10)\nset volume to (100) %\n\nrepeat (10)\n    change volume by (-10)\nend\nstop all sounds\n\nwhen flag clicked\nset [party v] to [false]\nclear sound effects\nset [pitch v] effect to (10)\nset volume to (100) %\nset [logoseparate v] to [back]\ncreate clone of (_myself_ v)\nset [logoseparate v] to [logo]\ngo to [front v] layer\nshow\ngo to x: (0) y: (0)\npoint in direction (90)\nif <(Party) = [true]> then\n    switch costume to (untitled3 v)\nelse\n    switch costume to (untitled v)\nend\nset size to (0) %\nrepeat (10)\n    change size by (12)\nend\nset [logopopspeed v] to [10]\nrepeat until <(size) < [100]>\n    change [logopopspeed v] by (-1.5)\n    change size by (logoPopSpeed)\nend\nsmoke\nset [logopopspeed v] to [0]\nif <(Party) = [true]> then\n    set [logoseparate v] to [none]\n    switch costume to (costume2 v)\n    create clone of (_myself_ v)\n    switch costume to (costume4 v)\n    create clone of (_myself_ v)\n    set [logoseparate v] to [logo]\n    switch costume to (untitled v)\nend\nrepeat (100)\n    if <(logoPopSpeed) < [5]> then\n        change [logopopspeed v] by (0.2)\n    end\n    turn right (logoPopSpeed) degrees\nend\nset [logojumpspeed v] to [0]\nrepeat (10)\n    change [logojumpspeed v] by (1)\n    change y by (logoJumpSpeed)\n    turn right (logoPopSpeed) degrees\nend\nbroadcast (logohide v)\nrepeat until <(y position) < [-250]>\n    change [logojumpspeed v] by (-1.5)\n    change y by (logoJumpSpeed)\n    turn right (logoPopSpeed) degrees\nend\nhide\nrepeat (10)\n    change volume by (-10)\nend\nstop all sounds\nwait (2) seconds\nbroadcast (menu v)\nbroadcast (dismissThumbnail v)\n\ndefine smoke\nrepeat (30)\n    set [logoseparate v] to [smoke]\n    create clone of (_myself_ v)\nend\nset [logoseparate v] to [logo]\n\nwhen I start as a clone\nif <(logoSeparate) = [smoke]> then\n    set [ghost v] effect to (0)\n    set size to (100) %\n    go to x: (0) y: (0)\n    point in direction (pick random (0) to (360))\n    set [xchange v] to (pick random (-8.0) to (8.0))\n    set [ychange v] to (pick random (-8.0) to (8.0))\n    switch costume to (costume1 v)\n    show\n    set [ghost v] effect to (0)\n    repeat (pick random (10) to (15))\n        change x by (Xchange)\n        change y by (Ychange)\n        change [ghost v] effect by (pick random (5) to (10))\n    end\n    set [ghost v] effect to (100)\n    hide\nend\nif <(logoSeparate) = [back]> then\n    go to x: (0) y: (0)\n    point in direction (90)\n    switch costume to (untitled2 v)\n    go to [front v] layer\n    go [backward v] (1) layers\n    set size to (100) %\n    show\nend\nif <(logoSeparate) = [none]> then\n    go to [front v] layer\nend\n\nwhen I receive [logohide v]\nif <(logoSeparate) = [back]> then\n    wait (1) seconds\n    broadcast (startMusic v)\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\n    delete this clone\nelse\n    if <(logoSeparate) = [none]> then\n        wait (1) seconds\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n        delete this clone\n    else\n        delete this clone\n    end\nend\n\n@HP2\n\ndefine CreateHealthBar\ngo to x: (0) y: (25)\nbroadcast (HpClear v)\nset [ghost v] effect to (0)\nshow\ngo to [front v] layer\ngo [backward v] (5) layers\nswitch costume to (base v)\ncreate clone of (_myself_ v)\nswitch costume to (1 v)\ncreate clone of (_myself_ v)\nswitch costume to (master v)\nhide\n\nwhen I receive [start v]\nset [oldplayerhp v] to (round (((PlayerHP) / ((100) / (40))) + (1)))\nswitch costume to (master v)\nhide\nforever\n    if <not <(round (((PlayerHP) / ((100) / (40))) + (1))) = (round (OldPlayerHP))>> then\n        CreateHealthBar\n    end\n    set [oldplayerhp v] to (round (((PlayerHP) / ((100) / (40))) + (1)))\nend\n\nwhen I start as a clone\nif <not <<(costume [name v]) = [Master]> or <(costume [name v]) = [Base]>>> then\n    forever\n        set [brightness v] effect to ((PlayerHP) / ((100) / (20)))\n        set [color v] effect to ((PlayerHP) / ((100) / (70)))\n        switch costume to (((PlayerHP) / ((100) / (40))) + (1))\n    end\nend\n\nwhen I start as a clone\nwait (2.5) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\nend\ndelete this clone\n\nwhen I receive [hpclear v]\ndelete this clone\n\n