Wings Of Fire Platformer!

Instructions: ★ Welcome to Wings Of Fire Platformer! ★\n\nNOTICES:\n↳ Mobile controls added!\n\nHOW TO PLAY:\n↳ In this platformer, you are Clay, trapped in the Queen Scarlet's palace. In order to be set free, you need to find a ruby necklace that is hidden deep in the mountain caves.\n↳ There are 10 levels, and each one has a coin to collect and a scroll explaining how to complete it.\n↳ At the end of the platformer, you get the ruby necklace! Bring it to Queen Scarlet and she will set you free.\n\nCONTROLS:\n↳ Right arrow to move right.\n↳ Left arrow to move left.\n↳ Up arrow to jump.\n↳ Space key to switch dragonets.\n↳ If on mobile, press buttons at the bottom of the screen.\n\nRULES:\n↳ You cannot move/click any buttons when someone is talking.\n↳ If you touch the poison in a level with it, you have to restart the level.\n↳ Make sure to collect the coins in each level!\n↳ Pay attention to the symbols in the first level!\n↳ You can use your head/tail to hook on and jump onto things.\n\nMORE INFORMATION:\n↳ You don't have to know Wings Of Fire to play this game.\n↳ This game contains 0 spoilers for the Wings Of Fire series!\n↳ If you have any questions/suggestions/feedback, feel free to comment!\n↳ Let me know if you want a skip button! I didn't feel it was necessary but if you would like one, comment and I will make one.\n\nOTHER NOTES:\n↳ I recommend playing in full screen!\n↳ If you find any bugs/glitches, please let me know!\n↳ Fonts form fontmeme.com.\n↳ Images from Google.\n↳ Code is 99% by me!\n\n★ Have fun! ★\n#wingsoffire #platformer #adventure

@Stage\n\nwhen flag clicked\nset [ghost v] effect to (100)\nset [pixelate v] effect to (0)\nswitch backdrop to (start v)\nrepeat (50)\n    change [ghost v] effect by (-2)\nend\nwait (3) seconds\nrepeat (50)\n    change [ghost v] effect by (2)\nend\nswitch backdrop to (throneroom v)\nwait (.5) seconds\nbroadcast (Start! v)\nrepeat (50)\n    change [ghost v] effect by (-2)\nend\nswitch backdrop to (throneroom v)\n\nwhen backdrop switches to [cavesoutside v]\nset [pixelate v] effect to (75)\n\nwhen backdrop switches to [throneroom v]\nset [pixelate v] effect to (0)\n\nwhen backdrop switches to [cavesinside v]\nset [pixelate v] effect to (50)\n\nwhen I receive [done v]\nswitch backdrop to (cavesoutsideend v)\nset [pixelate v] effect to (75)\n\nwhen I receive [done2 v]\nrepeat (50)\n    change [ghost v] effect by (2)\nend\nswitch backdrop to (start v)\nwait (.5) seconds\nrepeat (50)\n    change [ghost v] effect by (-2)\nend\n\n@Thumbnail\n\nwhen flag clicked\ngo to x: (0) y: (0)\nset [ghost v] effect to (100)\nforever\n    go to [front v] layer\nend\n\n@Dragonets\n\ndefine platform gravity: (gravity) jump height: (jump height) side movement speed: (side movement speed) friction: (friction) slope: (slope)\nchange [y velocity v] by (gravity)\nchange y by (Y Velocity)\nif <<touching (level v)?> or <touching (levelblock v)?>> then\n    repeat until <not <<touching (level v)?> or <touching (levelblock v)?>>>\n        change y by ((([abs v] of (Y Velocity) ) / (Y Velocity)) * (-1))\n    end\n    set [y velocity v] to [0]\n    if <<key (up arrow v) pressed?> or <(Walk3) = [1]>> then\n        set [y velocity v] to (jump height)\n    end\nend\nset [x velocity v] to (((X Velocity) + ((<<key (left arrow v) pressed?> or <(Walk1) = [1]>> * ((side movement speed) * (-1))) + (<<key (right arrow v) pressed?> or <(Walk2) = [1]>> * (side movement speed)))) * (friction))\nchange x by (X Velocity)\nset [slope v] to [0]\nrepeat until <<(Slope) = ((slope) * (-1))> or <not <<touching (level v)?> or <touching (levelblock v)?>>>>\n    change y by (1)\n    change [slope v] by (-1)\nend\nif <<touching (level v)?> or <touching (levelblock v)?>> then\n    change y by (Slope)\n    repeat until <not <<touching (level v)?> or <touching (levelblock v)?>>>\n        change x by ((([abs v] of (X Velocity) ) / (X Velocity)) * (-1))\n    end\nend\n\ndefine say (text) for (seconds) seconds\nset [currenttext v] to []\nset [textprogress v] to [0]\nrepeat (length of (text))\n    say (join (CurrentText) (letter (TextProgress) of (text)))\n    set [currenttext v] to (join (CurrentText) (letter (TextProgress) of (text)))\n    change [textprogress v] by (1)\nend\nsay (text) for (seconds) seconds\n\nwhen flag clicked\nset [clickable v] to [0]\nset [x velocity v] to [0]\nset [y velocity v] to [0]\nset [level # v] to [0]\nset [controls? v] to [No]\nset [random2 v] to [No]\nset [done v] to [0]\nset [dragonet v] to [Clay]\nset [edge v] to [Yes]\ngo to [back v] layer\ngo [forward v] (2) layers\ngo to x: (-175) y: (-135)\nswitch costume to (clayright v)\nset [ghost v] effect to (100)\nhide\n\nwhen I receive [start! v]\nshow\nrepeat (50)\n    change [ghost v] effect by (-2)\nend\n\nwhen [right arrow v] key pressed\nif <(Controls?) = [Yes]> then\n    if <(Dragonet) = [Clay]> then\n        switch costume to (clayright v)\n    end\n    if <(Dragonet) = [Tsunami]> then\n        switch costume to (tsunamiright v)\n    end\n    if <(Dragonet) = [Glory]> then\n        switch costume to (gloryright v)\n    end\n    if <(Dragonet) = [Starflight]> then\n        switch costume to (starflightright v)\n    end\n    if <(Dragonet) = [Sunny]> then\n        switch costume to (sunnyright v)\n    end\nend\n\nwhen [left arrow v] key pressed\nif <(Controls?) = [Yes]> then\n    if <(Dragonet) = [Clay]> then\n        switch costume to (clayleft v)\n    end\n    if <(Dragonet) = [Tsunami]> then\n        switch costume to (tsunamileft v)\n    end\n    if <(Dragonet) = [Glory]> then\n        switch costume to (gloryleft v)\n    end\n    if <(Dragonet) = [Starflight]> then\n        switch costume to (starflightleft v)\n    end\n    if <(Dragonet) = [Sunny]> then\n        switch costume to (sunnyleft v)\n    end\nend\n\nwhen backdrop switches to [throneroom v]\nif <(Dragonet) = [Clay]> then\n    switch costume to (clayright v)\nend\nif <(Dragonet) = [Tsunami]> then\n    switch costume to (tsunamiright v)\nend\nif <(Dragonet) = [Glory]> then\n    switch costume to (gloryright v)\nend\nif <(Dragonet) = [Starflight]> then\n    switch costume to (starflightright v)\nend\nif <(Dragonet) = [Sunny]> then\n    switch costume to (sunnyright v)\nend\ngo to x: (-175) y: (-135)\nif <(Done) = [1]> then\n    broadcast (End v)\nend\n\nwhen backdrop switches to [cavesoutside v]\nif <(Dragonet) = [Clay]> then\n    switch costume to (clayright v)\nend\nif <(Dragonet) = [Tsunami]> then\n    switch costume to (tsunamiright v)\nend\nif <(Dragonet) = [Glory]> then\n    switch costume to (gloryright v)\nend\nif <(Dragonet) = [Starflight]> then\n    switch costume to (starflightright v)\nend\nif <(Dragonet) = [Sunny]> then\n    switch costume to (sunnyright v)\nend\ngo to x: (-175) y: (-135)\n\nwhen I receive [start platformer v]\nglide (.5) secs to x: (-95) y: (-60)\nwait (.1) seconds\nglide (1) secs to x: (100) y: (-60)\nswitch backdrop to (cavesinside v)\ngo to x: (-200) y: (-101)\nset [level # v] to [1]\nbroadcast (Message v)\n\nwhen I receive [controls v]\nset [controls? v] to [Yes]\nforever\n    platform gravity: [-1] jump height: [15] side movement speed: [3] friction: [.7] slope: [8]\nend\n\nwhen I receive [start platformer v]\nforever\n    if <<touching (edge v)?> and <(Edge) = [Yes]>> then\n        broadcast (NextLevel v)\n        stop [this script v]\n    end\nend\n\nwhen I receive [nextlevel v]\nif <(Level #) = [2]> then\n    go to x: (-200) y: (-101)\nend\nif <(Level #) = [3]> then\n    go to x: (-200) y: (3)\nend\nif <(Level #) = [4]> then\n    go to x: (-200) y: (3)\nend\nif <(Level #) = [5]> then\n    go to x: (-200) y: (54)\nend\nif <(Level #) = [6]> then\n    go to x: (-200) y: (-48)\nend\nif <(Level #) = [7]> then\n    go to x: (-200) y: (-91)\nend\nif <(Level #) = [8]> then\n    go to x: (-200) y: (-91)\nend\nif <(Level #) = [9]> then\n    go to x: (-200) y: (-91)\nend\nif <(Level #) = [10]> then\n    go to x: (-200) y: (-91)\nend\nbroadcast (NextLevel! v)\n\nwhen I receive [nextlevel! v]\nforever\n    if <<touching (edge v)?> and <(Edge) = [Yes]>> then\n        if <(Level #) = [10]> then\n            broadcast (Done v)\n            stop [this script v]\n        end\n        if <(Random2) = [No]> then\n            broadcast (NextLevel v)\n            stop [this script v]\n        end\n    end\nend\n\nwhen I receive [start platformer v]\nforever\n    if <touching (poison v)?> then\n        broadcast (Restart v)\n    end\nend\n\nwhen I receive [restart v]\nif <(Dragonet) = [Clay]> then\n    switch costume to (clayright v)\nend\nif <(Dragonet) = [Tsunami]> then\n    switch costume to (tsunamiright v)\nend\nif <(Dragonet) = [Glory]> then\n    switch costume to (gloryright v)\nend\nif <(Dragonet) = [Starflight]> then\n    switch costume to (starflightright v)\nend\nif <(Dragonet) = [Sunny]> then\n    switch costume to (sunnyright v)\nend\nif <(Level #) = [1]> then\n    go to x: (-200) y: (-101)\nend\nif <(Level #) = [2]> then\n    go to x: (-200) y: (-101)\nend\nif <(Level #) = [3]> then\n    go to x: (-200) y: (3)\nend\nif <(Level #) = [4]> then\n    go to x: (-200) y: (3)\nend\nif <(Level #) = [5]> then\n    go to x: (-200) y: (54)\nend\nif <(Level #) = [6]> then\n    go to x: (-200) y: (-48)\nend\nif <(Level #) = [7]> then\n    go to x: (-200) y: (-91)\nend\nif <(Level #) = [8]> then\n    go to x: (-200) y: (-91)\nend\nif <(Level #) = [9]> then\n    go to x: (-200) y: (-91)\nend\nif <(Level #) = [10]> then\n    go to x: (-200) y: (-91)\nend\n\nwhen I receive [start platformer v]\nforever\n    if <touching (coin v)?> then\n        broadcast (Coin v)\n        stop [this script v]\n    end\nend\n\nwhen I receive [nextlevel! v]\nforever\n    if <touching (coin v)?> then\n        broadcast (Coin v)\n        stop [this script v]\n    end\nend\n\nwhen I receive [controls v]\nforever\n    if <(Level #) = [6]> then\n        if <touching (blockcrusher v)?> then\n            broadcast (Restart v)\n        end\n    end\nend\n\nwhen I receive [controls v]\nforever\n    if <(Level #) = [7]> then\n        if <touching (missles v)?> then\n            broadcast (Restart v)\n        end\n    end\nend\n\nwhen I receive [controls v]\nwait until <(Level #) = [8]>\nset [random2 v] to [Yes]\nwait until <(Level #) = [9]>\nset [random2 v] to [Yes]\nwait until <(Level #) = [10]>\nset [random2 v] to [Yes]\n\nwhen I receive [done v]\ngo to x: (20) y: (-70)\n\nwhen I receive [done v]\nstop [other scripts in sprite v]\nset [done v] to [1]\nset [controls? v] to [No]\nset [clickable v] to [1]\n\nwhen I receive [done2 v]\nrepeat (50)\n    change [ghost v] effect by (2)\nend\nhide\n\nwhen I receive [restart v]\nforever\n    if <touching (coin v)?> then\n        broadcast (Coin v)\n        stop [this script v]\n    end\nend\n\nwhen I receive [walk1 v]\nif <(Controls?) = [Yes]> then\n    if <(Dragonet) = [Clay]> then\n        switch costume to (clayleft v)\n    end\n    if <(Dragonet) = [Tsunami]> then\n        switch costume to (tsunamileft v)\n    end\n    if <(Dragonet) = [Glory]> then\n        switch costume to (gloryleft v)\n    end\n    if <(Dragonet) = [Starflight]> then\n        switch costume to (starflightleft v)\n    end\n    if <(Dragonet) = [Sunny]> then\n        switch costume to (sunnyleft v)\n    end\nend\n\nwhen I receive [walk2 v]\nif <(Controls?) = [Yes]> then\n    if <(Dragonet) = [Clay]> then\n        switch costume to (clayright v)\n    end\n    if <(Dragonet) = [Tsunami]> then\n        switch costume to (tsunamiright v)\n    end\n    if <(Dragonet) = [Glory]> then\n        switch costume to (gloryright v)\n    end\n    if <(Dragonet) = [Starflight]> then\n        switch costume to (starflightright v)\n    end\n    if <(Dragonet) = [Sunny]> then\n        switch costume to (sunnyright v)\n    end\nend\n\nwhen [space v] key pressed\nif <(Dragonet) = [Clay]> then\n    set [dragonet v] to [Tsunami]\n    set size to (115) %\n    if < (costume [name v]) contains [Right]?> then\n        switch costume to (tsunamiright v)\n    end\n    if < (costume [name v]) contains [Left]?> then\n        switch costume to (tsunamileft v)\n    end\n    stop [this script v]\nend\nif <(Dragonet) = [Tsunami]> then\n    set [dragonet v] to [Glory]\n    set size to (110) %\n    if < (costume [name v]) contains [Right]?> then\n        switch costume to (gloryright v)\n    end\n    if < (costume [name v]) contains [Left]?> then\n        switch costume to (gloryleft v)\n    end\n    stop [this script v]\nend\nif <(Dragonet) = [Glory]> then\n    set [dragonet v] to [Starflight]\n    set size to (110) %\n    if < (costume [name v]) contains [Right]?> then\n        switch costume to (starflightright v)\n    end\n    if < (costume [name v]) contains [Left]?> then\n        switch costume to (starflightleft v)\n    end\n    stop [this script v]\nend\nif <(Dragonet) = [Starflight]> then\n    set [dragonet v] to [Sunny]\n    set size to (110) %\n    if < (costume [name v]) contains [Right]?> then\n        switch costume to (sunnyright v)\n    end\n    if < (costume [name v]) contains [Left]?> then\n        switch costume to (sunnyleft v)\n    end\n    stop [this script v]\nend\nif <(Dragonet) = [Sunny]> then\n    set [dragonet v] to [Clay]\n    set size to (120) %\n    if < (costume [name v]) contains [Right]?> then\n        switch costume to (clayright v)\n    end\n    if < (costume [name v]) contains [Left]?> then\n        switch costume to (clayleft v)\n    end\n    stop [this script v]\nend\n\nwhen I receive [dragon v]\nif <(Dragonet) = [Clay]> then\n    set [dragonet v] to [Tsunami]\n    set size to (115) %\n    if < (costume [name v]) contains [Right]?> then\n        switch costume to (tsunamiright v)\n    end\n    if < (costume [name v]) contains [Left]?> then\n        switch costume to (tsunamileft v)\n    end\n    stop [this script v]\nend\nif <(Dragonet) = [Tsunami]> then\n    set [dragonet v] to [Glory]\n    set size to (110) %\n    if < (costume [name v]) contains [Right]?> then\n        switch costume to (gloryright v)\n    end\n    if < (costume [name v]) contains [Left]?> then\n        switch costume to (gloryleft v)\n    end\n    stop [this script v]\nend\nif <(Dragonet) = [Glory]> then\n    set [dragonet v] to [Starflight]\n    set size to (110) %\n    if < (costume [name v]) contains [Right]?> then\n        switch costume to (starflightright v)\n    end\n    if < (costume [name v]) contains [Left]?> then\n        switch costume to (starflightleft v)\n    end\n    stop [this script v]\nend\nif <(Dragonet) = [Starflight]> then\n    set [dragonet v] to [Sunny]\n    set size to (110) %\n    if < (costume [name v]) contains [Right]?> then\n        switch costume to (sunnyright v)\n    end\n    if < (costume [name v]) contains [Left]?> then\n        switch costume to (sunnyleft v)\n    end\n    stop [this script v]\nend\nif <(Dragonet) = [Sunny]> then\n    set [dragonet v] to [Clay]\n    set size to (120) %\n    if < (costume [name v]) contains [Right]?> then\n        switch costume to (clayright v)\n    end\n    if < (costume [name v]) contains [Left]?> then\n        switch costume to (clayleft v)\n    end\n    stop [this script v]\nend\n\n@Scarlet\n\nwhen flag clicked\ngo to x: (4) y: (-18)\nset [ghost v] effect to (100)\nswitch costume to (left v)\nhide\n\nwhen I receive [start! v]\nshow\nrepeat (50)\n    change [ghost v] effect by (-2)\nend\nwait (.5) seconds\nsay [Hᴇʟʟᴏ, ᴅʀᴀɢᴏɴᴇᴛꜱ.] for [1] seconds\nsay [Iғ ʏᴏᴜ ᴡᴀɴᴛ ᴛᴏ ʙᴇ ғʀᴇᴇᴅ ғʀᴏᴍ ᴛʜᴇ Sᴋʏ Kɪɴɢᴅᴏᴍ, ʏᴏᴜ ᴡɪʟʟ ɴᴇᴇᴅ ᴛᴏ ғɪɴᴅ sᴏᴍᴇᴛʜɪɴɢ ғᴏʀ ᴍᴇ.] for [3.5] seconds\nsay [Iᴛ ɪs ᴀ ʀᴜʙʏ ɴᴇᴄᴋʟᴀᴄᴇ ᴛʜᴀᴛ ɪs ʜɪᴅᴅᴇɴ ɪɴ ᴛʜᴇ ᴍᴏᴜɴᴛᴀɪɴ ᴄᴀᴠᴇs sᴏᴍᴇᴡʜᴇʀᴇ.] for [3] seconds\nsay [Yᴏᴜ ᴡɪʟʟ ʜᴀᴠᴇ ᴛᴏ ɢᴇᴛ ᴛʜʀᴏᴜɢʜ ᴀ sᴇʀɪᴇs ᴏғ ᴘᴀssᴀɢᴇᴡᴀʏs ᴛᴏ ғɪɴᴅ ɪᴛ.] for [3] seconds\nwait (.5) seconds\nsay [Iғ ʏᴏᴜ ғɪɴᴅ ᴛʜᴇ ɴᴇᴄᴋʟᴀᴄᴇ, ʏᴏᴜ ᴡɪʟʟ ʙᴇ ꜰʀᴇᴇ.] for [2] seconds\nsay [Iғ ʏᴏᴜ ᴅᴏɴ’ᴛ, ɪ ɢᴜᴇss ʏᴏᴜ’ʟʟ ʙᴇ sᴛᴜᴄᴋ ʜᴇʀᴇ ғᴏʀᴇᴠᴇʀ.] for [2] seconds\nwait (.5) seconds\nbroadcast (Show Buttons v)\nsay [Wʜᴇɴ ʏᴏᴜ ᴀʀᴇ ʀᴇᴀᴅʏ, ᴄʟɪᴄᴋ ᴏɴ ᴛʜᴇ Mᴀᴘ ʙᴜᴛᴛᴏɴ ᴀɴᴅ ᴘʀᴇss ᴛʜᴇ Cᴀᴠᴇ.] for [2] seconds\nsay [Cᴏᴍᴇ ʙᴀᴄᴋ ᴛᴏ ᴛʜᴇ Tʜʀᴏɴᴇ Rᴏᴏᴍ ᴡʜᴇɴ ʏᴏᴜ ᴀʀᴇ ᴅᴏɴᴇ.] for [2] seconds\nset [clickable v] to [1]\n\nwhen backdrop switches to [throneroom v]\nshow\n\nwhen backdrop switches to [cavesoutside v]\nhide\n\nwhen I receive [end v]\nwait (.5) seconds\nsay [ɪ ꜱᴇᴇ ʏᴏᴜ ʜᴀᴠᴇ ꜰᴏᴜɴᴅ ᴛʜᴇ ʀᴜʙʏ ɴᴇᴄᴋʟᴀᴄᴇ.] for [1] seconds\nsay [ʜᴍ...] for [1] seconds\nwait (.5) seconds\nsay [ɪ ɢᴜᴇꜱꜱ ɪ ᴡɪʟʟ ʜᴀᴠᴇ ᴛᴏ ꜱᴇᴛ ʏᴏᴜ ꜰʀᴇᴇ.] for [1] seconds\nwait (.5) seconds\nsay [ᴅʀᴀɢᴏɴᴇᴛꜱ, ʏᴏᴜ ᴀʀᴇ ᴏꜰꜰɪᴄɪᴀʟʟʏ ꜰʀᴇᴇ ꜰʀᴏᴍ ᴛʜᴇ ꜱᴋʏ ᴋɪɴɢᴅᴏᴍ.] for [1.5] seconds\nwait (1) seconds\nbroadcast (Done2 v)\n\ndefine say (text) for (seconds) seconds\nset [currenttext v] to []\nset [textprogress v] to [0]\nrepeat (length of (text))\n    say (join (CurrentText) (letter (TextProgress) of (text)))\n    set [currenttext v] to (join (CurrentText) (letter (TextProgress) of (text)))\n    change [textprogress v] by (1)\nend\nsay (text) for (seconds) seconds\n\nwhen I receive [done2 v]\nrepeat (50)\n    change [ghost v] effect by (2)\nend\nhide\n\n@Level\n\nwhen flag clicked\ngo to x: (0) y: (0)\nswitch costume to (1 v)\nset [pixelate v] effect to (100)\nhide\n\nwhen backdrop switches to [cavesinside v]\nbroadcast (Controls v)\nshow\n\nwhen I receive [nextlevel v]\nnext costume\nset [level # v] to (costume [name v])\n\nwhen I receive [done v]\nhide\n\n@Poison\n\nwhen flag clicked\ngo to x: (0) y: (0)\nset [pixelate v] effect to (100)\nhide\n\nwhen I receive [start platformer v]\nforever\n    if <(Level #) = [1]> then\n        hide\n    end\n    if <(Level #) = [2]> then\n        hide\n    end\n    if <(Level #) = [3]> then\n        switch costume to (normal v)\n        show\n    end\n    if <(Level #) = [4]> then\n        switch costume to (normal v)\n        show\n    end\n    if <(Level #) = [5]> then\n        show\n    end\n    if <(Level #) = [6]> then\n        hide\n    end\n    if <(Level #) = [7]> then\n        hide\n    end\n    if <(Level #) = [8]> then\n        hide\n    end\n    if <(Level #) = [9]> then\n        hide\n    end\n    if <(Level #) = [10]> then\n        hide\n    end\nend\n\nwhen I receive [controls v]\nforever\n    if <(Level #) = [5]> then\n        repeat until <(Level #) = [6]>\n            switch costume to (normal v)\n            wait (.5) seconds\n            repeat (7)\n                wait (.2) seconds\n                next costume\n            end\n            wait (1) seconds\n        end\n    end\nend\n\nwhen I receive [controls v]\nforever\n    if <(Level #) = [6]> then\n        hide\n    end\nend\n\n@Coin\n\nwhen flag clicked\ngo to x: (5) y: (-60)\nset [coins v] to [0]\nhide\n\nwhen I receive [controls v]\nshow\nforever\n    if <(Level #) = [1]> then\n        go to x: (5) y: (-60)\n    end\n    if <(Level #) = [2]> then\n        go to x: (-18) y: (-110)\n    end\n    if <(Level #) = [3]> then\n        go to x: (65) y: (-5)\n    end\n    if <(Level #) = [4]> then\n        go to x: (-50) y: (70)\n    end\n    if <(Level #) = [5]> then\n        go to x: (0) y: (50)\n    end\n    if <(Level #) = [6]> then\n        go to x: (105) y: (-130)\n    end\n    if <(Level #) = [7]> then\n        go to x: (0) y: (50)\n    end\n    if <(Level #) = [8]> then\n        hide\n    end\n    if <(Level #) = [9]> then\n        hide\n    end\n    if <(Level #) = [10]> then\n        hide\n    end\nend\n\nwhen I receive [coin v]\nchange [coins v] by (1)\nset [coin v] to [Collected]\nhide\n\nwhen I receive [nextlevel v]\nset [coin v] to [NotCollected]\nshow\n\nwhen I receive [nextlevel! v]\nset [coin v] to [NotCollected]\nshow\n\nwhen I receive [restart v]\nif <(Level #) = [1]> then\n    go to x: (5) y: (-60)\nend\nif <(Level #) = [2]> then\n    go to x: (-18) y: (-110)\nend\nif <(Level #) = [3]> then\n    go to x: (65) y: (-5)\nend\nif <(Level #) = [4]> then\n    go to x: (-50) y: (70)\nend\nif <(Level #) = [5]> then\n    go to x: (0) y: (50)\nend\nif <(Level #) = [6]> then\n    go to x: (105) y: (-130)\nend\nif <(Level #) = [7]> then\n    go to x: (0) y: (50)\nend\nshow\nif <(Coin) = [Collected]> then\n    change [coins v] by (-1)\n    set [coin v] to [NotCollected]\nend\n\n@Scroll\n\nwhen flag clicked\nswitch costume to (enter v)\nset [random1 v] to [0]\ngo to x: (-185) y: (130)\ngo to [back v] layer\nhide\n\nwhen backdrop switches to [cavesoutside v]\nswitch costume to (enter v)\ngo to x: (-185) y: (130)\nshow\n\nwhen backdrop switches to [throneroom v]\nhide\n\nwhen this sprite clicked\nif <(Random1) = [0]> then\n    broadcast (Start Platformer v)\n    set [random1 v] to [1]\n    hide\nend\n\nwhen backdrop switches to [cavesinside v]\nshow\ngo to x: (-185) y: (110)\nswitch costume to (1 v)\n\nwhen I receive [message v]\nforever\n    switch costume to (Level #)\nend\n\nwhen I receive [done v]\nhide\n\n@Map\n\nwhen flag clicked\ngo to x: (207) y: (141)\nswitch costume to (button v)\nhide\n\nwhen I receive [show buttons v]\nshow\n\nwhen this sprite clicked\nif <(Clickable) = [1]> then\n    broadcast (Show Map v)\nend\n\nwhen I receive [show map v]\nswitch costume to (map v)\ngo to x: (0) y: (0)\n\nwhen I receive [hide map v]\ngo to x: (207) y: (141)\nswitch costume to (button v)\n\nwhen I receive [start platformer v]\nset [clickable v] to [0]\nhide\n\nwhen backdrop switches to [cavesoutside v]\nshow\n\nwhen I receive [start platformer v]\nset [clickable v] to [0]\n\nwhen backdrop switches to [cavesinside v]\nhide\n\nwhen I receive [done v]\nshow\n\nwhen I receive [done2 v]\nrepeat (50)\n    change [ghost v] effect by (2)\nend\nhide\n\n@Edge\n\nwhen flag clicked\ngo to [back v] layer\ngo to x: (0) y: (0)\nhide\n\nwhen backdrop switches to [cavesinside v]\nshow\n\nwhen backdrop switches to [cavesoutside v]\nhide\n\nwhen backdrop switches to [throneroom v]\nhide\n\nwhen I receive [done v]\nhide\n\n@ThoneRoom\n\nwhen flag clicked\ngo to x: (-25) y: (-70)\nhide\n\nwhen I receive [show map v]\nshow\n\nwhen I receive [hide map v]\nhide\n\nwhen this sprite clicked\nbroadcast (Hide Map v)\nswitch backdrop to (throneroom v)\n\n@Caves\n\nwhen flag clicked\ngo to x: (20) y: (0)\nhide\n\nwhen I receive [show map v]\nshow\n\nwhen I receive [hide map v]\nhide\n\nwhen this sprite clicked\nbroadcast (Hide Map v)\nswitch backdrop to (cavesoutside v)\n\n@MapX\n\nwhen flag clicked\ngo to x: (60) y: (-90)\nhide\n\nwhen I receive [show map v]\nshow\n\nwhen this sprite clicked\nbroadcast (Hide Map v)\n\nwhen I receive [hide map v]\nhide\n\n@Chunks\n\nwhen flag clicked\ngo to [back v] layer\ngo [forward v] (3) layers\nset [pixelate v] effect to (75)\nswitch costume to (outside v)\nset size to (100) %\ngo to x: (0) y: (0)\nhide\n\nwhen backdrop switches to [throneroom v]\nhide\n\nwhen backdrop switches to [cavesoutside v]\nshow\n\nwhen backdrop switches to [cavesinside v]\nhide\n\nwhen I receive [controls v]\nswitch costume to (cave v)\ngo to [front v] layer\nwait until <(Level #) = [9]>\nset [pixelate v] effect to (50)\nshow\nwait until <(Level #) = [10]>\nshow\nswitch costume to (treasurechest v)\ngo to x: (171) y: (-69)\nset size to (50) %\nset [pixelate v] effect to (0)\ngo to [front v] layer\n\nwhen I receive [keyfound v]\nhide\n\nwhen I receive [rubynecklace v]\nwait (.2) seconds\nhide\n\n@LevelBlock\n\nwhen flag clicked\ngo to x: (-90) y: (-80)\nset [pixelate v] effect to (100)\nhide\n\nwhen I receive [controls v]\nforever\n    if <(Level #) = [4]> then\n        show\n        repeat until <(Level #) = [5]>\n            glide (2) secs to x: (90) y: (-80)\n            wait (.5) seconds\n            hide\n            go to x: (-90) y: (-80)\n            wait (.1) seconds\n            show\n        end\n    else\n        hide\n    end\nend\n\nwhen I receive [controls v]\nforever\n    if <(Level #) = [5]> then\n        hide\n    end\nend\n\n@BlockCrusher\n\nwhen flag clicked\ngo to x: (0) y: (0)\nswitch costume to (1 v)\nset [pixelate v] effect to (100)\nhide\n\nwhen I receive [controls v]\nforever\n    if <(Level #) = [6]> then\n        repeat until <(Level #) = [7]>\n            hide\n            switch costume to (1 v)\n            wait (.5) seconds\n            show\n            repeat (6)\n                wait (.3) seconds\n                next costume\n            end\n            wait (1) seconds\n        end\n    end\nend\n\nwhen I receive [controls v]\nforever\n    if <(Level #) = [7]> then\n        hide\n    end\nend\n\n@Symbols/Coins\n\nwhen flag clicked\nset [pixelate v] effect to (35)\ngo to x: (5) y: (50)\nswitch costume to (symbol v)\ngo to [back v] layer\nhide\n\nwhen flag clicked\nforever\n    if <(Level #) = [1]> then\n        show\n    end\n    if <(Level #) = [2]> then\n        hide\n    end\n    if <(Level #) = [9]> then\n        hide\n    end\nend\n\nwhen I receive [checkcoins v]\nset [pixelate v] effect to (0)\nwait (.5) seconds\nswitch costume to (0 v)\nshow\nif <(Coins) = [0]> then\n    switch costume to (0 v)\nend\nif <(Coins) = [1]> then\n    next costume\nend\nif <(Coins) = [2]> then\n    repeat (2)\n        next costume\n        wait (.5) seconds\n    end\nend\nif <(Coins) = [3]> then\n    repeat (3)\n        next costume\n        wait (.5) seconds\n    end\nend\nif <(Coins) = [4]> then\n    repeat (4)\n        next costume\n        wait (.5) seconds\n    end\nend\nif <(Coins) = [5]> then\n    repeat (5)\n        next costume\n        wait (.5) seconds\n    end\nend\nif <(Coins) = [6]> then\n    repeat (6)\n        next costume\n        wait (.5) seconds\n    end\nend\nif <(Coins) = [7]> then\n    repeat (7)\n        next costume\n        wait (.5) seconds\n    end\nend\nif <(Coins) = [7]> then\n    broadcast (Enough v)\nelse\n    broadcast (NotEnough v)\nend\nwait (1) seconds\nhide\n\n@Missles\n\nwhen flag clicked\nset [pixelate v] effect to (100)\nhide\n\nwhen I receive [controls v]\nforever\n    if <(Level #) = [8]> then\n        hide\n    end\nend\n\nwhen I receive [controls v]\nforever\n    if <(Level #) = [7]> then\n        repeat until <(Level #) = [8]>\n            hide\n            go to x: (252) y: (pick random (170) to (-170))\n            wait (.5) seconds\n            show\n            glide (1) secs to x: (-252) y: (y position)\n        end\n    end\nend\n\n@Key\n\nwhen I receive [controls v]\nwait until <(Level #) = [9]>\nshow\nwait until <(Level #) = [10]>\nhide\n\nwhen flag clicked\ngo to x: (34) y: (-40)\ngo to [back v] layer\nhide\n\nwhen this sprite clicked\nglide (.5) secs to x: (210) y: (145)\nset [random2 v] to [No]\nbroadcast (KeyFound v)\n\n@CheckCoins\n\nwhen flag clicked\ngo to x: (165) y: (115)\nset [brightness v] effect to (90)\nhide\n\nwhen I receive [controls v]\nwait until <(Level #) = [8]>\nshow\n\nwhen this sprite clicked\nhide\nbroadcast (CheckCoins v)\n\n@CoinChecker\n\nwhen flag clicked\nhide\ngo to x: (40) y: (237)\nforever\n    if <(costume [name v]) = [Enough]> then\n        set [pixelate v] effect to (25)\n    else\n        set [pixelate v] effect to (0)\n    end\n    if <<(costume [name v]) = [Enough]> or <(costume [name v]) = [NotEnough]>> then\n        go to x: (40) y: (237)\n        set size to (100) %\n    end\n    if <(Level #) = [9]> then\n        hide\n    end\nend\n\nwhen I receive [enough v]\nswitch costume to (enough v)\nwait (.5) seconds\nshow\nset [random2 v] to [No]\nwait (.5) seconds\nhide\nwait (.5) seconds\ngo to x: (185) y: (110)\nset size to (50) %\nswitch costume to (enoughmessage v)\nshow\n\nwhen I receive [notenough v]\nswitch costume to (notenough v)\nwait (.5) seconds\nshow\nwait (.5) seconds\nhide\nwait (.5) seconds\ngo to x: (185) y: (110)\nset size to (50) %\nswitch costume to (notenoughmessage v)\nshow\n\n@Treasure Chest closed 254x254\n\nwhen I receive [controls v]\nwait until <(Level #) = [10]>\nset [edge v] to [No]\nshow\n\nwhen flag clicked\ngo to x: (170) y: (-69)\nswitch costume to (closed v)\nhide\n\nwhen I receive [rubynecklace v]\nwait (.5) seconds\nswitch costume to (open v)\nwait (1) seconds\nset [edge v] to [Yes]\n\nwhen I receive [done v]\nhide\n\n@RubyNecklace\n\nwhen flag clicked\ngo to x: (174) y: (-99)\nswitch costume to (1 v)\nhide\n\nwhen I receive [rubynecklace v]\nwait (.5) seconds\nshow\nglide (.5) secs to x: (174) y: (50)\nswitch costume to (2 v)\nset [random2 v] to [No]\n\nwhen I receive [done v]\nswitch costume to (1 v)\ngo to x: (-205) y: (137)\n\nwhen I receive [done2 v]\nrepeat (50)\n    change [ghost v] effect by (2)\nend\nhide\n\n@HeartButton\n\nwhen flag clicked\nset [pixelate v] effect to (35)\ngo to x: (136) y: (-17)\nhide\n\nwhen I receive [rubynecklace v]\nhide\n\nwhen this sprite clicked\nbroadcast (Heart v)\n\nwhen I receive [controls v]\nwait until <(Level #) = [10]>\nshow\n\n@CircleButton\n\nwhen flag clicked\nset [pixelate v] effect to (35)\ngo to x: (198) y: (-17)\nhide\n\nwhen I receive [rubynecklace v]\nhide\n\nwhen I receive [controls v]\nwait until <(Level #) = [10]>\nshow\n\nwhen this sprite clicked\nbroadcast (Circle v)\n\n@StarButton\n\nwhen flag clicked\nset [pixelate v] effect to (35)\ngo to x: (198) y: (-17)\nhide\n\nwhen I receive [rubynecklace v]\nhide\n\nwhen I receive [controls v]\nwait until <(Level #) = [10]>\nshow\n\nwhen this sprite clicked\nbroadcast (Star v)\n\n@ComboBox\n\nwhen flag clicked\ngo to x: (160) y: (7)\nhide\n\nwhen I receive [donecombo v]\nwait (.5) seconds\nif <<(Combo1) = [S]> and <<(Combo2) = [H]> and <(Combo3) = [C]>>> then\n    broadcast (CorrectCombo v)\nelse\n    broadcast (IncorrectCombo v)\nend\n\nwhen I receive [rubynecklace v]\nhide\n\nwhen I receive [controls v]\nwait until <(Level #) = [10]>\nset [combonumber v] to [1]\nset [combo1 v] to [0]\nset [combo2 v] to [0]\nset [combo3 v] to [0]\nshow\n\n@ComboShape1\n\nwhen flag clicked\nset [pixelate v] effect to (35)\ngo to x: (104) y: (12)\nhide\n\nwhen I receive [heart v]\nif <(ComboNumber) = [1]> then\n    switch costume to (heart v)\n    show\n    set [combonumber v] to [2]\n    set [combo1 v] to [H]\nend\n\nwhen I receive [star v]\nif <(ComboNumber) = [1]> then\n    switch costume to (star v)\n    show\n    set [combonumber v] to [2]\n    set [combo1 v] to [S]\nend\n\nwhen I receive [circle v]\nif <(ComboNumber) = [1]> then\n    switch costume to (circle v)\n    show\n    set [combonumber v] to [2]\n    set [combo1 v] to [C]\nend\n\nwhen I receive [incorrectcombo v]\nwait (.6) seconds\nhide\n\nwhen I receive [rubynecklace v]\nhide\n\n@ComboShape2\n\nwhen flag clicked\nset [pixelate v] effect to (35)\ngo to x: (139) y: (12)\nhide\n\nwhen I receive [heart v]\nif <(ComboNumber) = [2]> then\n    switch costume to (heart v)\n    show\n    set [combonumber v] to [3]\n    set [combo2 v] to [H]\nend\n\nwhen I receive [star v]\nif <(ComboNumber) = [2]> then\n    switch costume to (star v)\n    show\n    set [combonumber v] to [3]\n    set [combo2 v] to [S]\nend\n\nwhen I receive [rubynecklace v]\nhide\n\nwhen I receive [circle v]\nif <(ComboNumber) = [2]> then\n    switch costume to (circle v)\n    show\n    set [combonumber v] to [3]\n    set [combo2 v] to [C]\nend\n\nwhen I receive [incorrectcombo v]\nwait (.6) seconds\nhide\n\n@ComboShape3\n\nwhen flag clicked\nset [pixelate v] effect to (35)\ngo to x: (172) y: (12)\nhide\n\nwhen I receive [heart v]\nif <(ComboNumber) = [3]> then\n    switch costume to (heart v)\n    show\n    broadcast (DoneCombo v)\n    set [combo3 v] to [H]\nend\n\nwhen I receive [star v]\nif <(ComboNumber) = [3]> then\n    switch costume to (star v)\n    show\n    broadcast (DoneCombo v)\n    set [combo3 v] to [S]\nend\n\nwhen I receive [rubynecklace v]\nhide\n\nwhen I receive [circle v]\nif <(ComboNumber) = [3]> then\n    switch costume to (circle v)\n    show\n    broadcast (DoneCombo v)\n    set [combo3 v] to [C]\nend\n\nwhen I receive [incorrectcombo v]\nwait (.6) seconds\nhide\n\n@ComboChecker\n\nwhen flag clicked\ngo to x: (170) y: (80)\nhide\nforever\n    if <(costume [number v]) = [2]> then\n        set [pixelate v] effect to (25)\n    end\n    if <(costume [number v]) = [1]> then\n        set [pixelate v] effect to (0)\n    end\nend\n\nwhen I receive [incorrectcombo v]\nswitch costume to (incorrect v)\nshow\nwait (.5) seconds\nhide\nset [combonumber v] to [1]\n\nwhen I receive [correctcombo v]\nswitch costume to (correct v)\nshow\nwait (.5) seconds\nhide\nwait (.2) seconds\nbroadcast (RubyNecklace v)\n\n@Arrow1\n\nwhen this sprite clicked\ngo to [front v] layer\nset [walk1 v] to [1]\nbroadcast (Walk1 v)\nwait (.1) seconds\nset [walk1 v] to [0]\nstop [this script v]\n\nwhen flag clicked\ngo to x: (137) y: (-152)\nset [pixelate v] effect to (30)\nhide\n\nwhen flag clicked\nforever\n    go to [front v] layer\nend\n\nwhen backdrop switches to [cavesinside v]\ngo to [front v] layer\nshow\n\n@Arrow2\n\nwhen this sprite clicked\ngo to [front v] layer\nset [walk2 v] to [1]\nbroadcast (Walk2 v)\nwait (.1) seconds\nset [walk2 v] to [0]\nstop [this script v]\n\nwhen flag clicked\ngo to x: (202) y: (-152)\nset [pixelate v] effect to (30)\nhide\n\nwhen flag clicked\nforever\n    go to [front v] layer\nend\n\nwhen backdrop switches to [cavesinside v]\ngo to [front v] layer\nshow\n\n@Arrow3\n\nwhen this sprite clicked\ngo to [front v] layer\nset [walk3 v] to [1]\nwait (.1) seconds\nset [walk3 v] to [0]\nstop [this script v]\n\nwhen flag clicked\ngo to x: (168) y: (-112)\nset [pixelate v] effect to (30)\nhide\n\nwhen flag clicked\nforever\n    go to [front v] layer\nend\n\nwhen backdrop switches to [cavesinside v]\ngo to [front v] layer\nshow\n\n@Reset\n\nwhen this sprite clicked\nbroadcast (Restart v)\n\nwhen flag clicked\ngo to x: (-209) y: (-160)\nhide\n\nwhen flag clicked\nforever\n    go to [front v] layer\nend\n\nwhen backdrop switches to [cavesinside v]\ngo to [front v] layer\nshow\n\n@Dragonet\n\nwhen this sprite clicked\nbroadcast (Dragon v)\n\nwhen flag clicked\ngo to x: (-167) y: (-159)\nset [pixelate v] effect to (20)\nhide\n\nwhen flag clicked\nforever\n    go to [front v] layer\nend\n\nwhen backdrop switches to [cavesinside v]\ngo to [front v] layer\nshow\n\n