⭐ Escape The House ⭐ ll A puzzle platformer and an entry by Xx_InfiniteGame_xX

Instructions: ⭐ Ad ⭐\n\nCheck out my first PFC Application! https://scratch.mit.edu/projects/468784763/\n\n----------------------------------------------------------------------\n\nEscape The House ll A puzzle platformer and an entry by Xx_InfiniteGame_xX\n\n---------------------------------------------------------------------\n⭐ Instruction ⭐\n\n➡️ Spam the green flag\n\n➡️ [<] [>] [^] [v] or [W] [A] [S] [D] to move the player\n\n➡️ Find the keys, jump booster and more things to escape the house!\n\n➡️ When a calculator-thing pop out at your screen, enter the code. If you don't know yet, just spam the calculator. XD\n\n➡️ You'll finish this game if you are at outside of the house.\n\n➡️ Hope you enjoy! :D\n\n---------------------------------------------------------------------\n⭐ Notes ⭐\n\n➡️ This is an entry for @-PickleAnimator-'s contest\n\n➡️ Yeah, I know there are some annoying bug, I'll try to fix it. Don't comment bug.\n\n➡️ Find the easter egg! (shoutout to @ScratchNinjaCoder for find the easter egg first)\n\n➡️ Don't comment the code! >:(\n\n➡️ If you enjoy, feel free to love and fav this game! Thanks!\n\n---------------------------------------------------------------------\n⭐ Credits ⭐\n\n➡️Platfromer engine made by me, inspired by @0014049 for basic platformer engine and @GameDev46 for ground impact inspo.\n➡️Background songs are from YT.\n➡️Some of the SFX was made on LeshySFX by me.\n➡️The text on the thumbnail was made on Google Drawing.\n➡️ @TheBlueGuy- for title idea\n➡️ @Game-Cloud for thumbnail inspo.\n➡️ @TimMcCool for love and fav detector.\n➡️ @0014049 for tileset inspo. (art by me)\n➡️ @QuaXX for the idea from the project "Dungeon"\n➡️ @Xx_InfiniteGame_xX (me) for everything else.\n\n---------------------------------------------------------------------\n⭐ Updates ⭐\n\n(dd/mm/yyyy)\n\n➡️ 19/12/2020 - Game shared! Loved by @TNTend!\n\n---------------------------------------------------------------------\n⭐ Tags ⭐\n\n#all #escape #the #house #game #puzzle #platformer #entry #player #key #code #lock #door \n\nSay no to unrelated tags ;)

@Stage\n\nwhen flag clicked\nswitch backdrop to (white v)\nset [brightness v] effect to (0)\n\nwhen I receive [run game v]\n\n    if <<<(Lvl. X) = [5]> or <(Lvl. X) = [6]>> and <(Lvl. Y) = [1]>> then\n        switch backdrop to (sky v)\n        set [brightness v] effect to (0)\n    else\n        switch backdrop to (house v)\n        set [brightness v] effect to (-20)\n    end\nend\n\n@Intro\n\nwhen flag clicked\nbroadcast (Intro v)\n\nwhen I receive [intro v]\ngo to x: (0) y: (0)\npoint in direction (90)\nset size to (100) %\nhide\nstart sound [Super Mario Run \(Trap Remix\) v]\nClone all PFP part\nClone [0] [0] [Background]\nClone [0] [0] [Original PFP]\nClone [0] [0] [Beat]\n\ndefine Clone (x) (y) (costume)\nswitch costume to (costume)\ngo to x: (x) y: (y)\ncreate clone of (_myself_ v)\n\ndefine Clone all PFP part\nClone [0] [0] [PFP Part 1]\nClone [0] [206] [PFP Part 2]\nClone [0] [-206] [PFP Part 3]\nClone [-202] [0] [PFP Part 4]\nClone [202] [0] [PFP Part 5]\n\nwhen I start as a clone\nif <(costume [name v]) = [PFP Part 1]> then\n    set size to (0) %\n    show\n    repeat until <(size) > [99.5]>\n        change size by (((100) - (size)) / (10))\n    end\n    set size to (100) %\n    wait (0.8) seconds\nend\nif <(costume [name v]) = [PFP Part 2]> then\n    show\n    repeat until <(y position) < [0.5]>\n        change y by (((0) - (y position)) / (10))\n    end\n    set y to (0)\n    wait (0.5) seconds\nend\nif <(costume [name v]) = [PFP Part 3]> then\n    show\n    repeat until <(y position) > [-0.5]>\n        change y by (((0) - (y position)) / (10))\n    end\n    set y to (0)\n    wait (0.5) seconds\nend\nif <(costume [name v]) = [PFP Part 4]> then\n    show\n    repeat until <(x position) > [-0.5]>\n        change x by (((0) - (x position)) / (10))\n    end\n    set x to (0)\n    wait (0.5) seconds\nend\nif <(costume [name v]) = [PFP Part 5]> then\n    show\n    repeat until <(x position) < [0.5]>\n        change x by (((0) - (x position)) / (10))\n    end\n    set x to (0)\n    wait (0.5) seconds\nend\nif <(costume [name v]) = [Background]> then\n    set [y vel v] to [-1]\n    wait (2.4) seconds\n    show\n    repeat (135)\n        go to x: (0) y: (0)\n    end\n    broadcast (Intro Done v)\n    repeat until <(y position) < [-347]>\n        change y by (y vel)\n        change [y vel v] by ((y vel) / (4))\n        go to [front v] layer\n        go [backward v] (1) layers\n    end\nend\nif <(costume [name v]) = [Original PFP]> then\n    set [var v] to [0]\n    wait (2.4) seconds\n    show\n    wait (0.5) seconds\n    repeat (110)\n        PFP action\n    end\n    repeat until <(size) < [50.5]>\n        change size by (((50) - (size)) / (5))\n        change [ghost v] effect by (8)\n        PFP action\n    end\nend\nif <(costume [name v]) = [Beat]> then\n    set size to (0) %\n    wait (2.35) seconds\n    show\n    repeat until <(size) > [199.5]>\n        change size by (((200) - (size)) / (5))\n        change [ghost v] effect by (5)\n    end\nend\ndelete this clone\n\ndefine PFP action\nchange [var v] by (10)\npoint in direction ((([sin v] of (var) ) * (10)) + (90))\nset y to (([sin v] of ((var) * (2)) ) * (10))\n\n@Setup\n\nwhen flag clicked\ngo to [front v] layer\n\nwhen I receive [intro done v]\nset [lvl. x v] to [1]\nset [lvl. y v] to [1]\nset [player already out? v] to [false]\nset [key door opened? v] to [false]\nset [code door opened? v] to [false]\nset [main key door opened? v] to [false]\nset [player have key? v] to [false]\nset [player have code? v] to [false]\nset [player have main key? v] to [false]\nset [player have jump booster? v] to [false]\nbroadcast (Run Game v)\n\n@Player\n\nwhen I receive [run game v]\nset rotation style [left-right v]\nset [x vel v] to [0]\nset [y vel v] to [0]\nset [have touch ground? v] to [false]\nshow\n\n    if <(player have jump booster?) = [false]> then\n        Platformer physic [3] [0.8] [15] [-1]\n    else\n        Platformer physic [3] [0.8] [20] [-1]\n    end\n    Detect if go to next level\n    Detect if player want to open door\n    Switch to true costume\nend\n\nwhen flag clicked\ngo to x: (-152) y: (107)\nhide\n\ndefine Platformer physic (side speed) (friction) (jump height) (gravity)\nswitch costume to (hitbox v)\nif <touching (ladder v)?> then\n    if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > (y position)>>> then\n        change [y vel v] by (4)\n    end\n    if <<<key (down arrow v) pressed?> or <key (s v) pressed?>> or <<mouse down?> and <(y position) > (mouse y)>>> then\n        change [y vel v] by (-4)\n    end\n    set [y vel v] to ((0.8) * (y vel))\nelse\n    change [y vel v] by (gravity)\nend\nchange y by (y vel)\nTouch ground <(y vel) > [0]>\nset [x vel v] to ((friction) * ((x vel) + ((side speed) * (<<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <(mouse x) > (x position)>>> - <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <(x position) > (mouse x)>>>))))\nchange x by (x vel)\nif <<touching (platform v)?> or <touching (locked door v)?>> then\n    change x by ((x vel) * (-1))\n    set [x vel v] to [0]\nend\nchange y by (-1)\nif <<touching (platform v)?> or <touching (locked door v)?>> then\n    if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > (y position)>>> then\n        set [y vel v] to (jump height)\n        if <(player have jump booster?) = [false]> then\n            start sound [Jump v]\n        else\n            start sound [Big jump v]\n        end\n    end\n    if <(have touch ground?) = [false]> then\n        set [have touch ground? v] to [true]\n        if <<<(Lvl. X) = [5]> or <(Lvl. X) = [6]>> and <(Lvl. Y) = [1]>> then\n            start sound [Impact on dirt v]\n            broadcast (Dirt impact v)\n        else\n            start sound [Impact on wood v]\n            broadcast (Wood impact v)\n        end\n    end\nelse\n    set [have touch ground? v] to [false]\nend\nchange y by (1)\n\ndefine Detect if go to next level\nif <(x position) > [239]> then\n    set x to (-239)\n    change [lvl. x v] by (1)\nelse\n    if <(x position) < [-239]> then\n        set x to (239)\n        change [lvl. x v] by (-1)\n    end\nend\nif <(y position) > [179]> then\n    set y to (-179)\n    change [lvl. y v] by (1)\nelse\n    if <(y position) < [-179]> then\n        set y to (179)\n        change [lvl. y v] by (-1)\n    end\nend\n\ndefine Touch ground <jumping?>\nrepeat until <not <touching (platform v)?>>\n    if <jumping?> then\n        change y by (-1)\n    else\n        change y by (1)\n    end\n    set [y vel v] to [0]\nend\n\ndefine Detect if player want to open door\nif <<<(Lvl. X) = [3]> and <(Lvl. Y) = [3]>> and <<(x position) < [-170]> and <(code door opened?) = [false]>>> then\n    broadcast (Ask for code v) and wait\n    repeat until <(x position) > [-170]>\n        if <(player have jump booster?) = [false]> then\n            Platformer physic [3] [0.8] [15] [-1]\n        else\n            Platformer physic [3] [0.8] [20] [-1]\n        end\n        Detect if go to next level\n    end\nend\nif <<<(Lvl. X) = [2]> and <(Lvl. Y) = [3]>> and <<(x position) < [-170]> and <(key door opened?) = [false]>>> then\n    if <(player have key?) = [true]> then\n        set [key door opened? v] to [true]\n        broadcast (Open key door v)\n    else\n        broadcast (Find key first v)\n        repeat until <(x position) > [-170]>\n            if <(player have jump booster?) = [false]> then\n                Platformer physic [3] [0.8] [15] [-1]\n            else\n                Platformer physic [3] [0.8] [20] [-1]\n            end\n            Detect if go to next level\n            Switch to true costume\n        end\n    end\nend\nif <<<(Lvl. X) = [4]> and <(Lvl. Y) = [1]>> and <<[170] < (x position)> and <(main key door opened?) = [false]>>> then\n    if <(player have main key?) = [true]> then\n        set [main key door opened? v] to [true]\n        broadcast (Open main key door v)\n    else\n        broadcast (Find key first v)\n        repeat until <[170] > (x position)>\n            if <(player have jump booster?) = [false]> then\n                Platformer physic [3] [0.8] [15] [-1]\n            else\n                Platformer physic [3] [0.8] [20] [-1]\n            end\n            Detect if go to next level\n            Switch to true costume\n        end\n    end\nend\n\ndefine Switch to true costume\nif <((x vel) + (-0.2)) > [0]> then\n    set [right / left v] to [right]\nelse\n    if <((x vel) + (0.2)) < [0]> then\n        set [right / left v] to [left]\n    else\n        set [right / left v] to [none]\n    end\nend\nif <((y vel) + (-0.2)) > [0]> then\n    set [up / down v] to [up]\nelse\n    if <((y vel) + (0.2)) < [0]> then\n        set [up / down v] to [down]\n    else\n        set [up / down v] to [none]\n    end\nend\nswitch costume to (join (right / left) (join [ / ] (up / down)))\n\ndefine Detect if any message needed\nif <<<<<(Lvl. X) = [2]> and <(Lvl. Y) = [1]>> and <(player have jump booster?) = [false]>> and <<(x position) > [-100]> and <(y vel) > [0]>>> or <<<<(Lvl. X) = [4]> and <(Lvl. Y) = [3]>> and <(player have jump booster?) = [false]>> and <<<(x position) > [-20]> and <(x position) < [40]>> and <(y vel) > [0]>>>> then\n    broadcast (Need jump booster v)\n    if <<<<(Lvl. X) = [2]> and <(Lvl. Y) = [1]>> and <(player have jump booster?) = [false]>> and <<(x position) > [-100]> and <(y vel) > [0]>>> then\n        wait until <not <(y vel) > [0]>>\n    else\n        wait until <not <(y vel) > [0]>>\n    end\nend\n\nwhen I receive [run game v]\n\n    Detect if any message needed\nend\n\n@Platform\n\nwhen flag clicked\nhide\n\nwhen I receive [run game v]\nshow\n\n    switch costume to (join (join [X : ] (Lvl. X)) (join [ // Y : ] (Lvl. Y)))\nend\n\n@Ladder\n\nwhen flag clicked\nhide\n\nwhen I receive [run game v]\nshow\n\n    switch costume to (join (join [X : ] (Lvl. X)) (join [ // Y : ] (Lvl. Y)))\nend\n\n@Chest\n\nwhen flag clicked\nhide\n\nwhen I receive [run game v]\nCreate a chest at level X : [1] Y : [2] at X : [-170] Y : [-105] Name : [Key]\nCreate a chest at level X : [2] Y : [2] at X : [-171] Y : [106] Name : [Code]\nCreate a chest at level X : [4] Y : [3] at X : [-165] Y : [64] Name : [Main Key]\nCreate a chest at level X : [1] Y : [3] at X : [-170] Y : [-105] Name : [Jump Booster]\n\ndefine Create a chest at level X : (x1) Y : (y1) at X : (x2) Y : (y2) Name : (name)\ngo to x: (x2) y: (y2)\nset [id v] to (join (join (x1) (y1)) (name))\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nswitch costume to (chest animation 1 v)\nset [already touch player? v] to [false]\n\n    go to [back v] layer\n    if <<(Lvl. X) = (letter (1) of (ID))> and <(Lvl. Y) = (letter (2) of (ID))>> then\n        show\n    else\n        hide\n    end\n    if <<touching (player v)?> and <(already touch player?) = [false]>> then\n        set [already touch player? v] to [true]\n        if <<not < (ID) contains [Main]?>> and < (ID) contains [Key]?>> then\n            broadcast (Got key v)\n            set [player have key? v] to [true]\n        end\n        if < (ID) contains [Code]?> then\n            broadcast (Got code v)\n            set [player have code? v] to [true]\n        end\n        if < (ID) contains [Main Key]?> then\n            broadcast (Got main key v)\n            set [player have main key? v] to [true]\n        end\n        if < (ID) contains [Jump Booster]?> then\n            broadcast (Got jump booster v)\n            set [player have jump booster? v] to [true]\n        end\n        repeat (7)\n            wait (0) seconds\n            next costume\n        end\n    end\nend\n\n@Locked Door\n\ndefine Create a locked door at level X : (x1) Y : (y1) at X : (x2) Y : (y2) Name : (name) Dir : (dir)\nset rotation style [left-right v]\ngo to x: (x2) y: (y2)\npoint in direction (dir)\nset [id v] to (join (join (x1) (y1)) (name))\ncreate clone of (_myself_ v)\n\nwhen flag clicked\nhide\n\nwhen I receive [run game v]\nCreate a locked door at level X : [3] Y : [3] at X : [-229] Y : [-50] Name : [Code] Dir : [90]\nCreate a locked door at level X : [2] Y : [3] at X : [-229] Y : [-50] Name : [Key] Dir : [90]\nCreate a locked door at level X : [4] Y : [1] at X : [250] Y : [-50] Name : [Main Key] Dir : [-90]\n\nwhen I start as a clone\n\n    go to [back v] layer\n    if <<(Lvl. X) = (letter (1) of (ID))> and <(Lvl. Y) = (letter (2) of (ID))>> then\n        show\n    else\n        hide\n    end\nend\n\nwhen I receive [correct code v]\nif < (ID) contains [Code]?> then\n    delete this clone\nend\n\nwhen I receive [open key door v]\nif <<not < (ID) contains [Main]?>> and < (ID) contains [Key]?>> then\n    delete this clone\nend\n\nwhen I receive [open main key door v]\nif < (ID) contains [Main Key]?> then\n    delete this clone\nend\n\nset [player have jump booster? v] to [true]\n\n@Message\n\nwhen I receive [run game v]\ngo to x: (0) y: (-100)\nset [ghost v] effect to (100)\nswitch costume to (blank v)\nshow\n\nwhen I receive [got key v]\ngo to x: (0) y: (-100)\nset [ghost v] effect to (100)\nstart sound [Coin v]\nswitch costume to (got key v)\nrepeat until <(y position) > [-0.5]>\n    switch costume to (t h i c c v)\n    change y by (((0) - (y position)) / (5))\n    switch costume to (got key v)\n    change [ghost v] effect by (-5)\nend\nwait (0.5) seconds\nrepeat until <[-99.5] > (y position)>\n    switch costume to (t h i c c v)\n    change y by (((-100) - (y position)) / (5))\n    switch costume to (got key v)\n    change [ghost v] effect by (12)\nend\n\nwhen I receive [got code v]\ngo to x: (0) y: (-100)\nset [ghost v] effect to (100)\nstart sound [Coin v]\nswitch costume to (got code v)\nrepeat until <(y position) > [-0.5]>\n    switch costume to (t h i c c v)\n    change y by (((0) - (y position)) / (5))\n    switch costume to (got code v)\n    change [ghost v] effect by (-5)\nend\nwait (1) seconds\nrepeat until <[-99.5] > (y position)>\n    switch costume to (t h i c c v)\n    change y by (((-100) - (y position)) / (5))\n    switch costume to (got code v)\n    change [ghost v] effect by (12)\nend\n\nwhen I receive [got main key v]\ngo to x: (0) y: (-100)\nset [ghost v] effect to (100)\nstart sound [Coin v]\nswitch costume to (got main key v)\nrepeat until <(y position) > [-0.5]>\n    switch costume to (t h i c c v)\n    change y by (((0) - (y position)) / (5))\n    switch costume to (got main key v)\n    change [ghost v] effect by (-5)\nend\nwait (0.5) seconds\nrepeat until <[-99.5] > (y position)>\n    switch costume to (t h i c c v)\n    change y by (((-100) - (y position)) / (5))\n    switch costume to (got main key v)\n    change [ghost v] effect by (12)\nend\n\nwhen I receive [got jump booster v]\ngo to x: (0) y: (-100)\nset [ghost v] effect to (100)\nstart sound [Coin v]\nswitch costume to (got jump booster v)\nrepeat until <(y position) > [-0.5]>\n    switch costume to (t h i c c v)\n    change y by (((0) - (y position)) / (5))\n    switch costume to (got jump booster v)\n    change [ghost v] effect by (-5)\nend\nwait (0.5) seconds\nrepeat until <[-99.5] > (y position)>\n    switch costume to (t h i c c v)\n    change y by (((-100) - (y position)) / (5))\n    switch costume to (got jump booster v)\n    change [ghost v] effect by (10)\nend\n\nwhen I receive [correct code v]\ngo to x: (0) y: (-100)\nset [ghost v] effect to (100)\nstart sound [Coin v]\nswitch costume to (correct code v)\nrepeat until <(y position) > [-0.5]>\n    switch costume to (t h i c c v)\n    change y by (((0) - (y position)) / (5))\n    switch costume to (correct code v)\n    change [ghost v] effect by (-5)\nend\nwait (0.5) seconds\nrepeat until <[-99.5] > (y position)>\n    switch costume to (t h i c c v)\n    change y by (((-100) - (y position)) / (5))\n    switch costume to (correct code v)\n    change [ghost v] effect by (12)\nend\n\nwhen I receive [incorrect code v]\ngo to x: (0) y: (-100)\nset [ghost v] effect to (100)\nstart sound [Crunch v]\nswitch costume to (incorrect code v)\nrepeat until <(y position) > [-0.5]>\n    switch costume to (t h i c c v)\n    change y by (((0) - (y position)) / (5))\n    switch costume to (incorrect code v)\n    change [ghost v] effect by (-5)\nend\nwait (0.5) seconds\nrepeat until <[-99.5] > (y position)>\n    switch costume to (t h i c c v)\n    change y by (((-100) - (y position)) / (5))\n    switch costume to (incorrect code v)\n    change [ghost v] effect by (12)\nend\n\nwhen I receive [open key door v]\ngo to x: (0) y: (-100)\nset [ghost v] effect to (100)\nstart sound [Coin v]\nswitch costume to (key door opened v)\nrepeat until <(y position) > [-0.5]>\n    switch costume to (t h i c c v)\n    change y by (((0) - (y position)) / (5))\n    switch costume to (key door opened v)\n    change [ghost v] effect by (-5)\nend\nrepeat until <[-99.5] > (y position)>\n    switch costume to (t h i c c v)\n    change y by (((-100) - (y position)) / (5))\n    switch costume to (key door opened v)\n    change [ghost v] effect by (12)\nend\n\nwhen I receive [find key first v]\ngo to x: (0) y: (-100)\nset [ghost v] effect to (100)\nstart sound [Crunch v]\nswitch costume to (find key first v)\nrepeat until <(y position) > [-0.5]>\n    switch costume to (t h i c c v)\n    change y by (((0) - (y position)) / (5))\n    switch costume to (find key first v)\n    change [ghost v] effect by (-5)\nend\nwait (0.5) seconds\nrepeat until <[-99.5] > (y position)>\n    switch costume to (t h i c c v)\n    change y by (((-100) - (y position)) / (5))\n    switch costume to (find key first v)\n    change [ghost v] effect by (12)\nend\n\nwhen I receive [run game v]\n\n    if <<(player already out?) = [false]> and <<(Lvl. X) = [5]> and <(Lvl. Y) = [1]>>> then\n        set [player already out? v] to [true]\n        start sound [Coin v]\n        switch costume to (player out v)\n        repeat until <(y position) > [-0.5]>\n            switch costume to (blank v)\n            change y by (((0) - (y position)) / (5))\n            switch costume to (player out v)\n            change [ghost v] effect by (-4)\n            go to [front v] layer\n        end\n        wait (0.5) seconds\n        repeat until <[-80.5] > (y position)>\n            switch costume to (blank v)\n            change y by (((-100) - (y position)) / (5))\n            switch costume to (player out v)\n            change [ghost v] effect by (12)\n            go to [front v] layer\n        end\n    end\nend\n\nwhen I receive [run game v]\n\n    if <<(player already out?) = [true]> and <not <<<(Lvl. X) = [5]> or <(Lvl. X) = [6]>> and <(Lvl. Y) = [1]>>>> then\n        start sound [Crunch v]\n        switch costume to (why in v)\n        repeat until <(y position) > [-0.5]>\n            switch costume to (blank v)\n            change y by (((0) - (y position)) / (5))\n            switch costume to (why in v)\n            change [ghost v] effect by (-4)\n            go to [front v] layer\n        end\n        wait (0.5) seconds\n        repeat until <[-80.5] > (y position)>\n            switch costume to (blank v)\n            change y by (((-100) - (y position)) / (5))\n            switch costume to (why in v)\n            change [ghost v] effect by (12)\n            go to [front v] layer\n        end\n        wait until <<(Lvl. X) = [5]> and <(Lvl. Y) = [1]>>\n    end\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [stop button pressed v]\nhide\n\nwhen I receive [need jump booster v]\ngo to x: (0) y: (-100)\nset [ghost v] effect to (100)\nstart sound [Crunch v]\nswitch costume to (need jump booster v)\nrepeat until <(y position) > [-0.5]>\n    switch costume to (t h i c c v)\n    change y by (((0) - (y position)) / (5))\n    switch costume to (need jump booster v)\n    change [ghost v] effect by (-5)\nend\nwait (0.5) seconds\nrepeat until <[-99.5] > (y position)>\n    switch costume to (t h i c c v)\n    change y by (((-100) - (y position)) / (5))\n    switch costume to (need jump booster v)\n    change [ghost v] effect by (12)\nend\n\n@Code\n\nwhen I receive [ask for code v]\nClone all asset\nwait (0.1) seconds\nwait until <(length of (entered code)) = [3]>\n\nwhen flag clicked\nhide\n\ndefine Clone all asset\nswitch costume to (base v)\nrepeat (11)\n    create clone of (_myself_ v)\n    next costume\nend\n\nwhen I start as a clone\nset [entered code v] to []\nset y to (-999)\nset [ghost v] effect to (100)\nshow\nrepeat until <(y position) > [-20.5]>\n    change y by (((-20) - (y position)) / (5))\n    change [ghost v] effect by (-10)\nend\nset y to (-20)\nrepeat until <(length of (entered code)) = [3]>\n    if <<not <(costume [name v]) = [Base]>> and <<mouse down?> and <touching (mouse-pointer v)?>>> then\n        set [entered code v] to (join (entered code) (costume [name v]))\n        set [s vel v] to [-1]\n        start sound [Clixk v]\n        repeat (2)\n            change size by (s vel)\n            change [s vel v] by (-5)\n        end\n        wait until <not <<mouse down?> and <touching (mouse-pointer v)?>>>\n        repeat until <(size) > [99.5]>\n            change size by (((100) - (size)) / (5))\n        end\n        set size to (100) %\n    end\nend\nif <(entered code) = [165]> then\n    set [code door opened? v] to [true]\n    broadcast (Correct code v)\nelse\n    broadcast (Incorrect code v)\nend\nrepeat (10)\n    change [ghost v] effect by (10)\nend\ndelete this clone\n\n@Impact Particle Effect\n\nwhen flag clicked\nset [clone? v] to [false]\nhide\n\nwhen I receive [wood impact v]\nif <(clone?) = [false]> then\n    Clone particle effect [15] [1]\nend\n\ndefine Clone particle effect (amount) (type)\nset [type v] to (type)\nrepeat (amount)\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nset [clone? v] to [true]\nset [x vel v] to (pick random (-5.0) to (5.0))\nset [y vel v] to (pick random (2.5) to (7.5))\nset [old lvl. x v] to (Lvl. X)\nset [old lvl. y v] to (Lvl. Y)\npoint in direction (pick random (-179.9) to (180.0))\ngo to (player v)\nchange y by (-10)\nif <(type) = [1]> then\n    switch costume to (costume1 v)\nelse\n    switch costume to (costume2 v)\nend\nset [brightness v] effect to (pick random (-20.0) to (0.0))\nshow\nrepeat until <(y position) < [-179]>\n    change x by (x vel)\n    change y by (y vel)\n    turn right ((x vel) * (2)) degrees\n    if <<not <(Lvl. X) = (old Lvl. X)>> or <not <(Lvl. Y) = (old Lvl. Y)>>> then\n        delete this clone\n    end\n    set [x vel v] to ((0.95) * (x vel))\n    change [y vel v] by (-1)\nend\ndelete this clone\n\nwhen I receive [dirt impact v]\nif <(clone?) = [false]> then\n    Clone particle effect [15] [2]\nend\n\n@TN\n\nwhen flag clicked\nshow\nset [brightness v] effect to (0)\nset [ghost v] effect to (0)\nrepeat (20)\n    set size to (100) %\n    change [ghost v] effect by (5)\n    set [checktimer v] to (timer)\nend\nhide\nforever\n    set [checktimer v] to (timer)\nend\n\nwhen [timer v] > (checkTimer)\nbroadcast (Stop button pressed v)\nshow\nset y to (346)\nrepeat until <(y position) < [0.5]>\n    change y by (((0) - (y position)) / (5))\nend\ngo to x: (0) y: (0)\n\n@Cloud\n\nwhen flag clicked\nhide\n\nwhen I receive [run game v]\n\n    if <<<(Lvl. X) = [5]> or <(Lvl. X) = [6]>> and <(Lvl. Y) = [1]>> then\n        create clone of (_myself_ v)\n        wait (pick random (1.0) to (2.5)) seconds\n    end\nend\n\nwhen I start as a clone\nset rotation style [left-right v]\ngo to x: (275) y: (pick random (70) to (160))\npoint in direction (pick random (-179) to (180))\nset [ghost v] effect to (pick random (20) to (50))\nset size to (pick random (40) to (70)) %\nset [speed v] to (pick random (-2.0) to (-6.0))\nset [var v] to [0]\nshow\nrepeat until <<(x position) < [-239]> or <not <<<(Lvl. X) = [5]> or <(Lvl. X) = [6]>> and <(Lvl. Y) = [1]>>>>\n    change [var v] by (10)\n    change x by (speed)\n    change y by ([sin v] of (var) )\n    go to [back v] layer\nend\ndelete this clone\n\n@Light\n\nwhen flag clicked\nhide\n\nwhen I receive [run game v]\nbroadcast (Start lighting v)\n\nwhen I receive [stop button pressed v]\nhide\n\nwhen I receive [ask for code v]\nhide\nstop [other scripts in sprite v]\nwait (0) seconds\nwait until <(length of (entered code)) = [3]>\nbroadcast (Start lighting v)\n\nwhen I receive [start lighting v]\n\n    go to (player v)\n    if <<(player already out?) = [true]> or <<<(Lvl. X) = [5]> or <(Lvl. X) = [6]>> and <(Lvl. Y) = [1]>>> then\n        hide\n    else\n        show\n    end\nend\n\n@Music 1\n\nwhen I receive [run game v]\n\n    play sound [Hitman - Kevin Macleod v] until done\nend\n\nwhen I receive [run game v]\nwait until <(player already out?) = [true]>\nstop [other scripts in sprite v]\nbroadcast (Next song v)\n\n@Music 2\n\nwhen I receive [next song v]\n\n    play sound [Rhymastic - My Happy Melody \(Instrumental\) v] until done\nend\n\n@detector\n\nwhen flag clicked\nhide\nset [faved___ v] to [0]\nset [loved__ v] to [0]\nset [clone id v] to [0]\ncreate clone of (_myself_ v)\nwait (0.2) seconds\nset [clone id v] to [1]\ncreate clone of (_myself_ v)\nwait until <<(LOVED__) = [1]> and <(FAVED___) = [1]>>\nshow\ngo to x: (0) y: (50)\nswitch costume to (pick random (1) to (4))\nset [ghost v] effect to (100)\nrepeat (35)\n    change y by ((y position) / (-15))\n    change [ghost v] effect by (-3)\nend\nrepeat (35)\n    change y by (((y position) - (-100)) / (-15))\n    change [ghost v] effect by (10)\nend\nhide\n\nwhen I start as a clone\nif <(clone id) = [0]> then\n    go to x: (-15) y: (0)\n    set [loved__ v] to [0]\n    switch costume to (love v)\n    forever\n        set [love? v] to <touching (mouse-pointer v)?>\n        if <touching (mouse-pointer v)?> then\n            set [loved__ v] to [1]\n        end\n    end\nend\nif <(clone id) = [1]> then\n    go to x: (0) y: (0)\n    switch costume to (fave v)\n    set [faved___ v] to [0]\n    forever\n        set [fav v] to <touching (mouse-pointer v)?>\n        if <touching (mouse-pointer v)?> then\n            set [faved___ v] to [1]\n        end\n    end\nend\n\n@Extra message\n\nwhen flag clicked\nhide\n\nwhen I receive [run game v]\nforever\n    go to x: (153) y: (185)\n    set [ghost v] effect to (100)\n    show\n    start sound [High Whoosh v]\n    repeat until <(y position) < [160.5]>\n        change y by (((160) - (y position)) / (5))\n        change [ghost v] effect by (-5)\n    end\n    wait (1) seconds\n    start sound [High Whoosh v]\n    repeat until <(y position) > [184.5]>\n        change y by (((185) - (y position)) / (5))\n        change [ghost v] effect by (5)\n    end\n    wait (pick random (10.0) to (30.0)) seconds\nend\n\n