Blocky Platformer 3


@Stage\n\nwhen flag clicked\nset [location v] to [0]\nset [level v] to [1]\nset [selected block v] to [g]\nhide variable [selected block v]\nhide variable [level v]\nhide variable [location v]\nhide variable [local fastest time v]\n\n    show variable [local fastest time v]\nend\nshow list [custom levels v]\nswitch backdrop to (awesome-llama menu1 v)\nreset save\nbroadcast (! initalise v)\nforever\n    broadcast (tick v)\n    wait (0) seconds\nend\n\nwhen I receive [load level v]\nswitch backdrop to (load screen v)\nwait (1) seconds\nswitch backdrop to (awesome-llama menu1 v)\n\nwhen [l v] key pressed\nif <(Location) = [2]> then\n    ask [Load Save Code \(Cancel by typing nothing\)] and wait\n    if <not <(length of (answer)) = [192]>> then\nend\n\ndelete (all) of [current save v]\n\ndefine reset save\ndelete (all) of [custom levels v]\nshow list [current save v]\ndelete (all) of [current save v]\nrepeat (16)\n    add [g] to [current save v]\n    repeat (11)\n        add [a] to [current save v]\n    end\nend\n\nwhen [b v] key pressed\nif <(Location) = [2]> then\n    ask [Select Block ID] and wait\n    set [selected block v] to (answer)\nend\n\nwhen [s v] key pressed\nwait until <not <key (s v) pressed?>>\nif <(Location) = [2]> then\n    if <not <(item (last) of [custom levels v]) = (Current Save)>> then\n        add (Current Save) to [custom levels v]\n    end\n    hide list [custom levels v]\n    wait until <key (s v) pressed?>\nend\nshow list [custom levels v]\n\nwhen I receive [tick v]\nif <not <(backdrop [name v]) = [Load Screen]>> then\n    if <(Location) = [0]> then\n        switch backdrop to (awesome-llama menu1 v)\n    else\n        switch backdrop to (sky v)\n    end\nend\n\nadd [thing] to [current save v]\n\ndefine load save\nset [load v] to [0]\ndelete (all) of [current save v]\nrepeat (192)\n    change [load v] by (1)\n    add (letter (load) of (answer)) to [current save v]\nend\n\nwhen I receive [! initalise v]\nforever\n    broadcast (5 sec tick v)\n    wait (5) seconds\nend\n\nwhen I receive [play v]\nset volume to (60) %\nwait (2) seconds\nforever\n    play sound [732229.mp3 v] until done\nend\n\nwhen I receive [load custom v]\nask [Input level save:] and wait\nif <(length of (answer)) = [192]> then\n    delete all of [custom levels v]\n    add (answer) to [custom levels v]\n    set [location v] to [3]\n    broadcast (play v)\nend\n\nwhen I receive [play v]\nwait (1) seconds\nwait until <(Level) = [21]>\nset volume to (60) %\n\n@thumbnail\n\nwhen flag clicked\nhide\n\nswitch costume to (menu title v)\ngo to x: (0) y: (0)\nshow\n\n@Menu\n\nwhen I receive [! initalise v]\nclear graphic effects\nswitch costume to (play button v)\nset size to (100) %\ngo to x: (0) y: (0)\nshow\ngo to [front v] layer\ncreate clone of (_myself_ v)\nswitch costume to (level editor v)\ncreate clone of (_myself_ v)\nswitch costume to (load levels v)\ncreate clone of (_myself_ v)\nswitch costume to (menu title v)\n\nwhen I start as a clone\nset size to (400) %\nif <(costume [number v]) = [2]> then\n    go to x: (-180) y: (0)\nelse\n    if <(costume [number v]) = [3]> then\n        go to x: (-180) y: (-50)\n    else\n        go to x: (-180) y: (-100)\n    end\nend\n\nwhen this sprite clicked\nif <not <(costume [number v]) = [1]>> then\n    set [brightness v] effect to (20)\n    hide variable [local fastest time v]\n    broadcast (hide v)\n    if <(costume [number v]) = [2]> then\n        reset timer\n        set [location v] to [1]\n        broadcast (play v)\n    else\n        if <(costume [number v]) = [3]> then\n            reset timer\n            set [location v] to [2]\n            broadcast (load level v)\n        else\n            if <(costume [number v]) = [4]> then\n                broadcast (load custom v)\n            else\n                set [location v] to [0]\n            end\n        end\n    end\n    wait (0) seconds\n    set [brightness v] effect to (0)\nend\n\nwhen I receive [tick v]\nif <<(Location) = [0]> and <[awesome-llama Menu1] = (backdrop [name v])>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [hide v]\nhide\n\nwhen I receive [play v]\nwait (1) seconds\nbroadcast (reset v)\n\nwhen I receive [load custom v]\n\nwait (1) seconds\nwait until <not <(Level) = [1]>>\nset [location v] to [0]\n\n@Player\n\nchange y by (-2)\nchange y by (2)\n\nwhen I receive [tick v]\nif <<(Location) = [1]> or <(Location) = [3]>> then\n    show\nelse\n    hide\nend\nif <(backdrop [name v]) = [Load Screen]> then\n    set [ghost v] effect to (100)\nelse\n    set [ghost v] effect to (0)\nend\n\nset size to (220) %\n\ndefine find air\nset [ghost v] effect to (100)\nshow\nset y to (-130)\nrepeat (12)\n    if <not <touching (tile renderer v)?>> then\n        stop [this script v]\n    end\n    change y by (30)\nend\nhide\n\nwhen [r v] key pressed\nbroadcast (reset v) and wait\nfind air\nclear graphic effects\n\nwhen I receive [reset v]\nhide\nwait (0.1) seconds\nswitch costume to (null v)\ngo to x: (-225) y: (-34)\npoint in direction (90)\nset [xv v] to [0]\nset [yv v] to [0]\nswitch costume to (jelly v)\nhide\nfind air\nhide\nclear graphic effects\n\nwhen I receive [! initalise v]\nset volume to (20) %\nswitch costume to (jelly v)\ngo to x: (-225) y: (-34)\nset [fails v] to [0]\nset [xv v] to [0]\nset [yv v] to [0]\nhide\nforever\n    if <<(Location) = [1]> or <(Location) = [3]>> then\n        set size to (220) %\n        if <[239] < (x position)> then\n            hide\n            if <(Location) = [3]> then\n                set [location v] to [0]\n                broadcast (load menu v)\n            else\n                broadcast (advance level v) and wait\n                go to x: (0) y: (200)\n                broadcast (reset v) and wait\n                show\n            end\n        end\n        if <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <(letter (3) of (keys)) = [1]>> then\n            change [xv v] by (1)\n            point in direction (90)\n        end\n        if <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <(letter (1) of (keys)) = [1]>> then\n            change [xv v] by (-1)\n            point in direction (-90)\n        end\n        set [xv v] to ((Xv) * (0.9))\n        if <touching color (#4a91f7)?> then\n            set [xv v] to ((Xv) * (0.8))\n        else\n            if <touching color (#3bf621)?> then\n                set [xv v] to ((Xv) * (0.8))\n            end\n        end\n        if <(Xv) < [-6]> then\n            set [xv v] to [-6]\n        else\n            if <[6] < (Xv)> then\n                set [xv v] to [6]\n            end\n        end\n        change x by (Xv)\n        set size to (280) %\n        if <<(y position) < [-165]> or <<touching color (#f36b01)?> or <touching color (#ffa002)?>>> then\n            broadcast (lava v)\n            set size to (220) %\n            start sound [burn v]\n            broadcast (death effect v)\n            broadcast (reset v) and wait\n        end\n        set size to (220) %\n        if <touching (tile renderer v)?> then\n            change y by (1)\n            if <touching (tile renderer v)?> then\n                change y by (1)\n                if <touching (tile renderer v)?> then\n                    change y by (1)\n                    if <touching (tile renderer v)?> then\n                        change y by (1)\n                        if <touching (tile renderer v)?> then\n                            change y by (1)\n                            if <touching (tile renderer v)?> then\n                                change x by ((Xv) * (-1))\n                                change y by (-5)\n                                if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <(letter (2) of (keys)) = [1]>> then\n                                    if <(Xv) > [0]> then\n                                        set [xv v] to [-5]\n                                    else\n                                        set [xv v] to [5]\n                                    end\n                                    set [yv v] to [12]\n                                    start sound (pick random (1) to (6))\n                                else\n                                    set [xv v] to [0]\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n        change [yv v] by (-1)\n        change y by (Yv)\n        if <touching (tile renderer v)?> then\n            change y by ((Yv) * (-1))\n            set [yv v] to [0]\n        end\n        change y by (-1)\n        if <touching (tile renderer v)?> then\n            if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <(letter (2) of (keys)) = [1]>> then\n                if <touching color (#3bf621)?> then\n                    set [yv v] to [16.2]\n                    start sound (pick random (1) to (6))\n                else\n                    if <touching color (#4a91f7)?> then\n                        change [yv v] by (10)\n                        start sound [splash v]\n                    else\n                        set [yv v] to [12.5]\n                        start sound (pick random (1) to (6))\n                    end\n                end\n            end\n        end\n        change y by (1)\n    end\n    set size to (230) %\nend\n\nset [level v] to [5]\nbroadcast (load level v)\n\nbroadcast (reset v)\n\nwhen I receive [shift clones v]\nchange x by (-40)\n\ngo to [front v] layer\n\nset [color v] effect to (0)\n\n@Tile Renderer\n\nwhen I receive [switch costume v]\nif <[0] < (id)> then\n    if <(Location) = [2]> then\n        if <[a] = (letter (id) of (Current Save))> then\n            switch costume to (0 v)\n        else\n            switch costume to (letter (id) of (Current Save))\n        end\n    else\n        if <(Location) = [3]> then\n            if <[a] = (letter (id) of (join (item (Level) of [custom levels v]) (item ((Level) + (1)) of [custom levels v])))> then\n                switch costume to (a v)\n            else\n                switch costume to (letter (id) of (join (item (Level) of [custom levels v]) (item ((Level) + (1)) of [custom levels v])))\n            end\n            if <<(costume [number v]) > [16]> and <not <(costume [number v]) = [20]>>> then\n                switch costume to (a v)\n            end\n        else\n            if <[a] = (letter (id) of (join (item (Level) of [levels v]) (item ((Level) + (1)) of [levels v])))> then\n                switch costume to (a v)\n            else\n                switch costume to (letter (id) of (join (item (Level) of [levels v]) (item ((Level) + (1)) of [levels v])))\n            end\n            if <<(costume [number v]) > [16]> and <not <(costume [number v]) = [20]>>> then\n                switch costume to (a v)\n            end\n        end\n    end\nend\n\nwhen I receive [tick v]\nif <(costume [number v]) = [2]> then\n    set [ghost v] effect to (75)\nelse\n    set [ghost v] effect to (0)\nend\nif <(costume [number v]) = [14]> then\n    if <touching (player v)?> then\n        set [brightness v] effect to (-20)\n    else\n        set [brightness v] effect to (0)\n    end\nend\n\nwhen I receive [! initalise v]\nset [id v] to [-1]\nset [vertical layer offset v] to [0]\nset size to (380) %\ngo to x: (-225) y: (-165)\nswitch costume to (x v)\nhide\n\nwhen I receive [advance level v]\nif <(id) < [1]> then\n    change [level v] by (1)\n    broadcast (load level v)\nend\n\nwhen I receive [load level v]\nif <(id) < [1]> then\n    if <(Level) = [21]> then\n        \n            show variable [local fastest time v]\n        end\n        if <(round (timer)) < (local fastest time)> then\n            set [local fastest time v] to (round (timer))\n        end\n    end\n    set size to (380) %\n    hide\n    go to x: (-225) y: (-165)\n    broadcast (delete clones v)\n    wait (0) seconds\n    load level\n    broadcast (load bg v)\nend\n\nwhen I receive [play v]\nif <(id) < [1]> then\n    set [level v] to [1]\n    broadcast (load level v)\nend\n\ndelete (all) of [levels v]\nadd [se***sebddgaes***esbdgaae*****bdg#aas**aa*ddg#aas*aaaaaaaaaabgaaaaaaaaaabgaaaaaaaaaasbg#aaaaaaaaddgaaaaaaaaaddg#aaaaaaaaddgaaaaaaaaadddgaaaaaaaadddddgaaaaaabddddgaaaaaassbddddg#aaasessbddgaaaa] to [levels v]\nadd [esbddddg#aaaesbdgaaaaaaasbdgaaaaaaaasbdg#aaaaaaas*dgaaaaaaaashhlaaaaaaaahhmlaaaaaaaahhhhaaaaaaaahs*haaaaaaaa*eshaaaaaaaaessbaaaaaaaassbdgaaaaaaasbddg#aaaaaaesbdg#aaaaaasssbgaaaaaaaeebdgaaaaaaa] to [levels v]\nadd [*sbdgaaaaaaa*hsbgaaaaaaahhhsssesbg#as*mmh*hsbgaaehmmmmlaaaaa*hmmmmlaaaaahhmmmmlaaaaah*hmmmlaaaaas*hhmhhaaaaashh*hmlaaaaah*se*hlaaaaasehh*hhaaaaasss*hhaaaaaasesheaaaaaaasssbg#aaaaaaesbdgaaaaaaa] to [levels v]\nadd [esbdgaaaaaaaeesbgaaaaaaasesewaaaaaaaeesewaaaaaaaeseswaaaaaaaeesswaaaaaaasesswaaaaaaaeesewaaaaaaasseswaaaaaaasesswaaaaaaaeeessaaaaaaaseseeaaaaaaaeseseeaaaaaasesessbg#aaassesesbgaaaaseseebddg#aa] to [levels v]\nadd [ssbdddddgaaabdddg#aaaaaadgaaaaaaaaaadg#aaaaaaaaadgaaaaaaaaaadgaaaaaaaaaadgaaaaaaaaaadgaaaaaaaaaadgaaaaaaaaaaddgjaaaaaaaabdgaaaagaaaabdg#aaaaaaaabdgaaaaaaaaabdg#aaaaaaaassbg#aagaaaasssssbdgaaaa] to [levels v]\nadd [esbddddgaaaassselapaaaaasesmlapaaaaassmmlapaaaaasesmlapaaaaaessss*g#aaaassss**dgaaaasemlaaaaaaaassmlaaaaaaaaemmlaaaaaaaassesbg#aaaaaesmlaaaaaaaasmmlaaaaaaaassbgaaaaaaaaemmlaaaaaaaaemmlaaaaaaaa] to [levels v]\nadd [esesaaaaaaaasebg#aaaaaaasssbgaaaaaaaebddgaaaaaaassbdgaaaaaaasbddg#aaaaaabddgaaaaaaaadddgaaaaaaaadddwaaaaaaaadddwaaaaaaaadddwaa*gaaaadddg***aaaaabddg*****aaabddg**g**gaasbddg***bg#asssssssbdgaa] to [levels v]\nadd [ssessbddgaaaessesbdg#aaasesssbdg#aaasesbg#aaaaaassbgaaaaaaaasbg#aaaaaaaabdgaaaaaaaaaeswaaaaaaaaasswaa**bdgaasee****sbg#ased***esbdgasswa**sebdgaedwa**ssbddgsdwaa***sbddsee******bddses*****esbd] to [levels v]\nadd [hss*****sesb*heh***essbdmmm***sssebdmmmh***hsssbmmmshh***sebmmmehh*****bmmmh*hh*hh*bmhmm**hhhh*smmmm**h****emmmm*****hhhmmmh*****h*smmmhs***sesb*mmmeh**hsbdhmsmmh**hbdgms*hhh**ebgas*hhhs*h*sbd] to [levels v]\nadd [mmmmh***hsesmmmhe****hesmmm*h***h*sbmmhh***s*sbgmmsh**sssbgamss**hsebdgamme**sssbdg#mhs***esbg#ammla**sssbga*mhaa*sesbgamhseaaesbdgahmsseaaabg#ahhsbgaaaaaaahssebgaaaaaa*hssbg#aaaaaheesbgaaaaaa] to [levels v]\nadd [bddgaaaaaaaabddg#aaaaaaasbdgaaaaaaaasebdgaaaaaaasbddg#aaaaaasbdgaaaaaaaaesbg*gaaaaaases**gaaaaaass**bdgaaaaaess**bg#aaaas*ss*g#aaaaas****gaaaaaas***bdg#aaaae****bdgaaaas**s****aaaasesessebdgaa] to [levels v]\nadd [hesssesbdgaahseessbddg#aseshesbdgaaahhehhlaaaaaahhmhmlaaaaaamhmmmlaaaaaasmmmelaaaaaahmmsssbaaaaammseslaaaaaammmmmlaaaaaamhsmmlaaaaaahmmsmlaaaaaaehmmslaaaaaahmhmhs**bgaahhehmssb#aaaeheselaaaaaa] to [levels v]\nadd [eessshaaaaaah**ehhaaaaaasesh*hhhhaaahh*hehh*hhaahhehmlaaaaaam*mmmlaaaaaa**mmmla-aaaahmmmmlaaaaaa*emmmbaaaaaameemmlaaaaaammmmmlaaaaaahmmmmlaaaaaa*hemml-aaaaahmmmml-aaaaahh*emlaaaaaaehemmlaaaaaa] to [levels v]\nadd [hhaaaaaaaaaahbaaaahbaaaasbaahshhhaaahhaeshemlaaaslaemmmmlaaase*semmmlaaaee*semmmlaaasb**semmlaaaelaasmmmlaaaelaasemmlaaaela*semmlaaass***semlaaaesb**semlaaaesb**ssmlaaaees**emmlaaaese*emmmlaaa] to [levels v]\nadd [shsaaaselaaahlaaaaemlaaaesaaasmmlaaas*aahhmmlaaae**sshmmlaaalaashmmmlaaalaaeshmshhaahaass*sheb#ae*sb****sehhs*eh**sa-asss*b**ssa-aaahab**sssbaaasasahsb#aaaaha-asbaaaaaaeeeshaaaaaaasshbaaaaaaaa] to [levels v]\nadd [sssbaaaaaaaassb-aaaaaaaasba-aaaaaaaasla-aaaaaaaasla-aaaaaaaacla-aaaaaaaactttjaaaaaaaclaaaaaaaaaaclaaaaaaaaaaclaaaaaaaaaaclaaaaaaaaaaclaaaaaaaaaaclaaaaaaaaaaclaaaaaaaaaactttaaaaaaaaclataaaaaaaa] to [levels v]\nadd [ccctaattttaaccctja-aataattttttttataasssbaaatataasssbaaapaaaasssbaaapaaaattttaaapaaaahlapaaapaaaahlapaaapaaaahlapaaapaaaatt-t-t-tttaamlaaaaaaaaaamlaaaaaaaaaamlaaaaaaaaaamlapaaaaaaaamlapaaaaaaaa] to [levels v]\nadd [ssssatttttttlaapatttttttlaaaapapaaaattttapaaaaaas**tapaaaaaas**tapaaapaatt-tapaaapaalaaaapaaaaaalaaaapaaaaaalpaaaaaaaaaalpaaaaaaapaalaaapaaaapaalaaapaaattaalaaapaaapaaalaaapaaapaaaccccccccc-cc] to [levels v]\nadd [ttttaaaaaaaalaapaaaaaaaalaapaaaaaaaalaapaaaaaaaalaapaaaaaaaalaapaaaaaaaabddtaaaaaaaasbgaaaaaaaaaesbgaaaaaaaassbgaaaaaaaasebg#aaaaaaaesbgaaaaaaaasbdgaaaaaaaasbg#aaaaaaaabdgaaaaaaaaaebgaaaaaaaaa] to [levels v]\nadd [ddgaaaaaaaaaddgaaaaaaaaabddg#aaaaaaasbddgaaaaaaaessbgaaaaaaasebddgaaaaaaeesbdg#aaaaasssb**aaaaaaese**bgaaaaases**bdgaaaaess**sbddg#ase***sebgaaaee***sbdg#aase***esbgaaasseessbddgaaessssesbdgaa] to [levels v]\nadd [sesessebdgaassesebddgaaasseaaaaaaaaabg#aaaaaaaaabgjaaaaaaaaadgaaaaaaaaaadg#aaaaaaaaabg#aaaaaaaaadgjaaaaaaaaadgaaaaaaaaaadgaaaaaaaaaadg#aaaaaaaaadgjaaaaaaaaadgaaaaaaabgadg#aaaabddg#ssssssssbgaa] to [levels v]\nadd [gaaaaaaaaaaabaaaaaaatttasaaaaaaaataaecaaaaaatttah*aaaaaaaaaag#aa-aaatttagaaa-aaaaaaagjaa-aaaaaaagaaaaaaaaaaaaaaaaaaaaaaaaapaaaaaaaaasssbaaaaaaaasmmlaaaaaaaasssiaaaaaaatssswaaaaaaasssssssssssss] to [levels v]\n\nset [level v] to [18]\nbroadcast (load level v)\n\nwhen I start as a clone\nbroadcast (switch costume v)\nshow\n\nwhen I receive [delete clones v]\ndelete this clone\n\ndefine load level\nset [id v] to [0]\nrepeat (16)\n    repeat (12)\n        change [id v] by (1)\n        create clone of (_myself_ v)\n        change y by (30)\n    end\n    set y to (-165)\n    change x by (30)\nend\nset [id v] to [-2]\n\nset [vertical layer offset v] to [0]\nrepeat (16)\n    change [vertical layer offset v] by (1)\n    broadcast (shift clones v)\nend\nset [vertical layer offset v] to [0]\n\nwhen I receive [shift clones v]\nif <[0] < (id)> then\n    change [id v] by (12)\n    broadcast (switch costume v)\n    if <(id) < [1]> then\n        delete this clone\n    end\nend\n\nwhen I receive [5 sec tick v]\nif <<(costume [number v]) = [20]> and <<(Location) = [1]> or <(Location) = [3]>>> then\n    hide\n    wait (3) seconds\n    show\nend\n\nwhen this sprite clicked\nif <<[0] < (id)> and <(Location) = [2]>> then\n    if <(Selected Block) = [2]> then\n        set [selected block v] to [3]\n    end\n    replace item (id) of [current save v] with (Selected Block)\n    switch costume to (letter (id) of (Current Save))\n    if <(costume [number v]) = [3]> then\n        switch costume to (0 v)\n    end\nend\n\nadd [gaapaaaaaaaagaaaaaaaaaaagaaiaaaataaagaaiaaaaaaaagaaiaaaaaaaagaawaaaaaaaagaattaaataaagaapaaaaaaaagaapaaaaaaaagaammlaaaaaagaaaaaaaaaaagaaaataaaaaagaaaaaaaaaaaaaaaaaaaaaaagaaaaaaaaaaasssssssbdgaa] to [levels v]\nadd [xasaaaaaaaaaaaaaaaaaaaaaassssiwaaaaaaaaaaiwaaaaaaaaaaiiaaaaaaaaaamlaaaaaaaaaamlaaaaaaaaaaslaaaaaaaaaasbgaaaatttttsbgaaaaacccappaaaaaacccappaaaaaacccappaaaaaacccappaaaaaacccappaaaaaacccappaaaax] to [levels v]\n\nif <touching (mouse-pointer v)?> then\n    say (costume [number v])\nelse\n    say []\nend\n\nadd [ccccccccctcclaapatttttttlaaaapapaaaattttapaaaaaas**tapaaaaaas**tapaaapaatt-tapaaapaalaaaapaaaaaalaaaapaaaaaalpaaaaaaaaaalpaaaaaaapaalaaapaaaapaalaaapaaattaalaaapaaapaaalaaapaaapaaaccccccccc-cc] to [levels v]\n\nadd [gaaaaaaaaaaagaaaaaaaaaaagaaaaaaaaaaagaaaaaaaaaaag#aaaaaaaaaag#aaaaaaaaaag#aaaaaaaaaagaaaaaaaaaaagaaaaaaaaaaagaaaaaaaaaaagaaaaaaaaaaagaaaaaaaaaaagaaaaaaaaaaagaaaaaaaaaaagaaaaaaaaaaagaaaaaaaaaaa] to [levels v]\n\nwhen I receive [load menu v]\ndelete this clone\n\n@BG Tiles\n\nwhen I receive [switch costume v]\n\nif <[0] < (id)> then\n    if <(Location) = [2]> then\n        if <[a] = (letter (id) of (Current Save))> then\n            switch costume to (0 v)\n        else\n            switch costume to (letter (id) of (Current Save))\n        end\n    end\nend\n\nif <(Location) = [2]> then\n    switch costume to (0 v)\nend\n\nif <(costume [number v]) = [2]> then\n    set [ghost v] effect to (95)\nelse\n    set [ghost v] effect to (0)\nend\n\nwhen I receive [! initalise v]\nset [id v] to [-1]\nset size to (380) %\ngo to x: (-225) y: (-165)\nhide\n\nwhen I receive [load bg v]\nif <<(id) < [1]> and <<(Location) = [1]> or <(Location) = [3]>>> then\n    set size to (380) %\n    hide\n    load level\nend\n\ndefine load level\ngo to x: (-225) y: (-165)\nset [id v] to [0]\nrepeat (16)\n    repeat (12)\n        change [id v] by (1)\n        if <(Location) = [3]> then\n            if <[#] = (letter (id) of (join (item (Level) of [custom levels v]) (item ((Level) + (1)) of [custom levels v])))> then\n                switch costume to (# v)\n                create clone of (_myself_ v)\n            else\n                if <[*] = (letter (id) of (join (item (Level) of [custom levels v]) (item ((Level) + (1)) of [custom levels v])))> then\n                    switch costume to (* v)\n                    create clone of (_myself_ v)\n                else\n                    if <[w] = (letter (id) of (join (item (Level) of [custom levels v]) (item ((Level) + (1)) of [custom levels v])))> then\n                        switch costume to (w v)\n                        create clone of (_myself_ v)\n                    else\n                        if <[-] = (letter (id) of (join (item (Level) of [custom levels v]) (item ((Level) + (1)) of [custom levels v])))> then\n                            switch costume to (- v)\n                            create clone of (_myself_ v)\n                        else\n                            if <[%] = (letter (id) of (join (item (Level) of [custom levels v]) (item ((Level) + (1)) of [custom levels v])))> then\n                                switch costume to (% v)\n                                create clone of (_myself_ v)\n                            end\n                        end\n                    end\n                end\n            end\n        else\n            if <[#] = (letter (id) of (join (item (Level) of [levels v]) (item ((Level) + (1)) of [levels v])))> then\n                switch costume to (# v)\n                create clone of (_myself_ v)\n            else\n                if <[*] = (letter (id) of (join (item (Level) of [levels v]) (item ((Level) + (1)) of [levels v])))> then\n                    switch costume to (* v)\n                    create clone of (_myself_ v)\n                else\n                    if <[w] = (letter (id) of (join (item (Level) of [levels v]) (item ((Level) + (1)) of [levels v])))> then\n                        switch costume to (w v)\n                        create clone of (_myself_ v)\n                    else\n                        if <[-] = (letter (id) of (join (item (Level) of [levels v]) (item ((Level) + (1)) of [levels v])))> then\n                            switch costume to (- v)\n                            create clone of (_myself_ v)\n                        else\n                            if <[%] = (letter (id) of (join (item (Level) of [levels v]) (item ((Level) + (1)) of [levels v])))> then\n                                switch costume to (% v)\n                                create clone of (_myself_ v)\n                            end\n                        end\n                    end\n                end\n            end\n        end\n        change y by (30)\n    end\n    set y to (-165)\n    change x by (30)\nend\nset [id v] to [-2]\n\nwhen I receive [delete clones v]\ndelete this clone\n\nwhen I start as a clone\nclear graphic effects\nshow\nif <(costume [number v]) = [7]> then\n    set [ghost v] effect to (50)\nend\n\nwhen I receive [shift clones v]\n\nif <[0] < (id)> then\n    change [id v] by (12)\n    broadcast (switch costume v)\n    if <(id) < [1]> then\n        delete this clone\n    end\nend\n\nif <(Location) = [3]> then\n    if <[a] = (letter (id) of (join (item (Level) of [levels v]) (item ((Level) + (1)) of [levels v])))> then\n        switch costume to (a v)\n    else\n        switch costume to (letter (id) of (join (item (Level) of [levels v]) (item ((Level) + (1)) of [levels v])))\n    end\nend\n\nwhen I start as a clone\n\nbroadcast (load level v)\n\nwhen I receive [load menu v]\ndelete this clone\n\n@Help\n\nwhen I receive [! initalise v]\nswitch costume to (note1 v)\nset [ghost v] effect to (30)\ngo to x: (0) y: (0)\nhide\n\nwhen I receive [play v]\nif <(Location) = [1]> then\n    switch costume to (note1 v)\n    show\nelse\n    hide\nend\n\nwhen I receive [advance level v]\nif <(Location) = [1]> then\n    switch costume to (Level)\n    show\nelse\n    hide\nend\n\nwhen I receive [switch costume v]\nif <(Location) = [1]> then\n    switch costume to (Level)\n    show\nelse\n    hide\nend\n\nwait until <(Level) = [21]>\n\ngo to x: (0) y: (0)\nhide\n\nwhen I receive [load menu v]\nhide\n\n@Effects\n\nwhen I receive [! initalise v]\nhide\n\nwhen I receive [death effect v]\nchange [fails v] by (1)\nset size to (100) %\nset [ghost v] effect to (100)\nset [fisheye v] effect to (-10)\ngo to (player v)\nshow\nrepeat (4)\n    change [ghost v] effect by (-10)\n    change size by (2)\n    change [fisheye v] effect by (2)\n    wait (0) seconds\nend\nwait (0.5) seconds\nrepeat (10)\n    change [ghost v] effect by (8)\n    wait (0) seconds\nend\nhide\n\nwhen I receive [death effect v]\nturn right (pick random (1) to (360)) degrees\nrepeat (50)\n    change y by (1)\n    change size by (3)\n    wait (0) seconds\n    change [fisheye v] effect by (4)\nend\n\nrepeat (10)\n\n@Coin\n\nwhen I receive [! initalise v]\nhide variable [coins v]\nset [coins v] to [0]\ngo to x: (0) y: (0)\nhide\nset size to (200) %\n\nwhen I receive [load bg v]\nhide variable [coins v]\nshow\nif <(Level) = [6]> then\n    go to x: (-70) y: (-15)\nelse\n    if <(Level) = [7]> then\n        go to x: (195) y: (-15)\n    else\n        if <(Level) = [8]> then\n            go to x: (77) y: (163)\n        else\n            if <(Level) = [10]> then\n                go to x: (19) y: (164)\n            else\n                if <(Level) = [11]> then\n                    go to x: (76) y: (-136)\n                else\n                    if <(Level) = [12]> then\n                        go to x: (167) y: (18)\n                    else\n                        if <(Level) = [17]> then\n                            go to x: (-100) y: (-42)\n                        else\n                            if <(Level) = [18]> then\n                                go to x: (-102) y: (-131)\n                            else\n                                if <(Level) = [20]> then\n                                    go to x: (137) y: (-77)\n                                else\n                                    hide\n                                    if <(Level) = [21]> then\n                                        show variable [coins v]\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen I receive [tick v]\nif <touching (player v)?> then\n    hide\n    change [coins v] by (1)\n    go to x: (-999) y: (-999)\n    show variable [coins v]\nend\n\ngo to x: (0) y: (0)\n\nwhen I receive [5 sec tick v]\nwait (0.5) seconds\nrepeat (10)\n    change [brightness v] effect by (2)\nend\nrepeat (10)\n    change [brightness v] effect by (-2)\nend\nwait (0.5) seconds\nrepeat (10)\n    change [brightness v] effect by (1)\nend\nrepeat (10)\n    change [brightness v] effect by (-1)\nend\nwait (0.5) seconds\nrepeat (10)\n    change [brightness v] effect by (1)\nend\nrepeat (10)\n    change [brightness v] effect by (-1)\nend\n\n@Mobile Buttons\n\nwhen I receive [! initalise v]\nset [mobile mode v] to [0]\nhide\nswitch costume to (dot2 v)\ngo to x: ((240) - (80)) y: ((-180) + (80))\ncreate clone of (_myself_ v)\nswitch costume to (dot v)\ncreate clone of (_myself_ v)\nswitch costume to (toggle1 v)\ngo to x: (-150) y: (-165)\nshow\n\nwhen I receive [! initalise v]\ndelete this clone\n\nwhen I start as a clone\nset [ghost v] effect to (20)\nhide\n\nwhen I receive [load level v]\nif <<<<(costume [number v]) = [1]> or <(costume [number v]) = [2]>> and <(Location) = [0]>> or <<<(costume [number v]) = [3]> or <(costume [number v]) = [4]>> and <<(Mobile Mode) = [1]> and <<(Location) = [1]> or <(Location) = [3]>>>>> then\n    show\nelse\n    hide\nend\n\nwhen this sprite clicked\nif <(costume [number v]) = [2]> then\n    switch costume to (toggle1 v)\n    set [mobile mode v] to [0]\nelse\n    if <(costume [number v]) = [1]> then\n        switch costume to (toggle2 v)\n        set [mobile mode v] to [1]\n    end\nend\n\nif <(costume [number v]) = [3]> then\n    if <<mouse down?> and <touching (mouse-pointer v)?>> then\n        set [keys v] to (join (letter (1) of (keys)) (join [1] (letter (3) of (keys))))\n    else\n        set [keys v] to (join (letter (1) of (keys)) (join [0] (letter (3) of (keys))))\n    end\nelse\n    if <(costume [number v]) = [4]> then\n        if <<mouse down?> and <touching (mouse-pointer v)?>> then\n            set [keys v] to (join [1] (join (letter (2) of (keys)) (letter (3) of (keys))))\n        else\n            set [keys v] to (join [0] (join (letter (2) of (keys)) (letter (3) of (keys))))\n        end\n    else\n        if <(costume [number v]) = [5]> then\n            if <<mouse down?> and <touching (mouse-pointer v)?>> then\n                set [keys v] to (join (join (letter (1) of (keys)) (letter (2) of (keys))) [1])\n            else\n                set [keys v] to (join (join (letter (1) of (keys)) (letter (2) of (keys))) [0])\n            end\n        end\n    end\nend\n\nwhen this sprite clicked\nif <(costume [number v]) = [3]> then\n    go to x: (160) y: (-100)\n    repeat until <not <mouse down?>>\n        go to x: (160) y: (-100)\n        set [touch distance v] to (distance to [mouse-pointer v])\n        if <(Touch Distance) < [60]> then\n            point towards (mouse-pointer v)\n            go to (mouse-pointer v)\n        else\n            point towards (mouse-pointer v)\n            move (60) steps\n        end\n        if <(y position) < [-101]> then\n            set y to (-100)\n        end\n        movement\n    end\n    go to x: (160) y: (-100)\n    set [keys v] to [000]\nend\n\ndefine movement\nset [keys v] to [000]\nif <(Touch Distance) > [10]> then\n    if <<(direction) > [-100]> and <(direction) < [-20]>> then\n        set [keys v] to (join [1] (join (letter (2) of (keys)) (letter (3) of (keys))))\n    end\n    if <<[100] > (direction)> and <[20] < (direction)>> then\n        set [keys v] to (join (letter (1) of (keys)) (join (letter (2) of (keys)) [1]))\n    end\n    if <<[40] > (direction)> and <[-40] < (direction)>> then\n        set [keys v] to (join (letter (1) of (keys)) (join [1] (letter (3) of (keys))))\n    end\nend\n\n