Drive - A Platformer #Games #All

Instructions:  Among Us Flappy Game https://scratch.mit.edu/projects/434895986/\n————————————————————\nPac-Man Platformer\n\n➊ USE arrow keys, WASD, touchscreen or mouse.\n➋ Dodge GHOSTS and grab the cherries to ESCAPE!\n❸ Finish quickly to earn a TIME BONUS!\n➍ Press M to change the music.\n\nTip to say thanks for reading this- press p or click the clock to skip a level.\n\n---------- IPad, tablet, and mobile friendly ---------\n\n-----------------------Search Tags-----------------------\n#games #fruit #ninja #platformer #platform #music #animation #mobile   #atomicmagicnumber  #2020\n---------------------------------------------------------------\n

@Stage\n\nwhen I receive [main menu v]\nswitch backdrop to (ancient egypt v)\n\nwhen I receive [play v]\nswitch backdrop to (museum v)\n\nwhen I receive [settings v]\nswitch backdrop to (settings v)\n\nwhen flag clicked\nset volume to (100) %\nswitch backdrop to (ancient egypt v)\nforever\n    play sound [17 - Garden Of Hope - Day v] until done\nend\n\nwhen I receive [change scene v]\nset [able to restart? v] to [1]\nif <(SCENE #) = [1]> then\n    wait (1) seconds\n    set [popup mini do v] to [1]\n    broadcast (popup mini v)\nend\nif <(SCENE #) = [2]> then\n    wait (1) seconds\n    set [popup mini do v] to [3]\n    broadcast (popup mini v)\nend\nif <(SCENE #) = [5]> then\n    wait (1) seconds\n    set [popup mini do v] to [5]\n    broadcast (popup mini v)\nend\nif <(SCENE #) = [8]> then\n    switch backdrop to (dark v)\nend\nif <(SCENE #) = [7]> then\n    switch backdrop to (museum v)\nend\nif <(SCENE #) = [16]> then\n    switch backdrop to (dark v)\nend\nif <(SCENE #) = [17]> then\n    switch backdrop to (light v)\nend\nif <(SCENE #) = [18]> then\n    switch backdrop to (blue sky 2  v)\nend\nif <<<(SCENE #) = [4]> or <<(SCENE #) = [6]> or <<(SCENE #) = [8]> or <(SCENE #) = [18]>>>> or <<(SCENE #) = [19]> or <<<(SCENE #) = [20]> or <(SCENE #) = [36]>> or <<(SCENE #) = [37]> or <(SCENE #) = [38]>>>>> then\n    set [able to restart? v] to [0]\nend\n\n\n\n\n\nwhen flag clicked\n\nwhen I receive [music v]\nset volume to (music?) %\n\nwhen I receive [win v]\nset [timer v] to (timer)\n\nset [timer v] to [0]\nset [stop timer v] to [0]\nrepeat until <(stop timer) = [1]>\n    wait (1) seconds\n    change [timer v] by (1)\nend\n\nwhen I receive [win v]\nswitch backdrop to (museum v)\nstop [other scripts in sprite v]\nforever\n    play sound [17 - Garden Of Hope - Day v] until done\nend\n\nwhen I receive [boss music v]\nstop [other scripts in sprite v]\nforever\n    play sound [200 - Golden Arachnorb Battle v] until done\nend\n\nwhen flag clicked\n\nwhen I receive [play v]\nreset timer\n\nrepeat (10)\n    broadcast (layer v)\nend\n\nwhen flag clicked\nforever\n    wait () seconds\n    delete all of [z order v]\n    broadcast (Order Sprites v)\nend\n\nwait (1) seconds\n\nbroadcast (popup mini v)\n\n@Pyramid\n\nsay [Riley Foster is my friend's name]\nsay [But in order to get a follow]\nsay [you need to comment, "grat]\nsay [game" on my profile, otherwise]\nsay [people may cheat. This is how]\nsay [I will know you didn't cheat]\n\nwhen flag clicked\nhide\ngo to x: (111) y: (-59)\n\n@Settings\n\nwhen flag clicked\npoint in direction (90)\ngo to x: (205) y: (-150)\nshow\nbroadcast (Main Menu v)\n\nwhen I receive [play v]\nset [show? v] to [0]\nhide\n\nwhen I receive [how to play v]\nset [show? v] to [0]\nhide\n\nwhen I receive [main menu v]\nset [show? v] to [1]\nshow\nset size to (10) %\nforever\n    if <(distance to [mouse-pointer v]) < [15]> then\n        change size by ((0.2) * ((120) - (size)))\n    else\n        change size by ((0.2) * ((100) - (size)))\n    end\nend\n\nwhen flag clicked\nforever\n    turn right (1) degrees\n    if <<(distance to [mouse-pointer v]) < [12]> and <mouse down?>> then\n        if <(show?) = [1]> then\n            set volume to (Sound fx vol) %\n            start sound [A Elec Piano v]\n            set [show? v] to [0]\n            broadcast (Settings v)\n            hide\n        end\n    end\nend\n\nwhen I receive [learn v]\nset [show? v] to [0]\nhide\n\nwhen I receive [achievements v]\nset [show? v] to [0]\nhide\n\nset [show? v] to [0]\n\nwhen I receive [layer v]\nwait (((length of [back to front sprites v]) - (item # of [STG] in [back to front sprites v])) / (100)) seconds\ngo to [front v] layer\n\nwhen I receive [order sprites v]\nOrder sprites by (item # of [STG] in [back to front sprites v])\n\ndefine Order sprites by (z position)\nset [i v] to [1]\nrepeat until <not <(z position) < (item (i) of [z order v])>>\n    change [i v] by (1)\nend\ninsert (z position) at (i) of [z order v] \ngo [forward v] ((i) - (1)) layers\n\n@Play\n\nwhen flag clicked\n\nshow\n\nwhen this sprite clicked\nshow variable [artifacts v]\nset volume to (Sound fx vol) %\nstart sound [A Bass v]\nset [invulnerable v] to [0]\nbroadcast (Play v)\nhide\n\nswitch costume to (play again v)\n\nwhen I receive [settings v]\nhide\n\nwhen I receive [how to play v]\nhide\n\nwhen I receive [main menu/ play again button v]\nswitch costume to (play again v)\nshow\nset size to (10) %\nforever\n    if <touching (mouse-pointer v)?> then\n        change size by ((0.2) * ((110) - (size)))\n    else\n        change size by ((0.2) * ((100) - (size)))\n    end\nend\n\nwhen I receive [main menu/ play again button v]\nhide\n\nwhen I receive [main menu v]\nhide variable [artifacts v]\nhide variable [lives v]\nswitch costume to (play v)\nshow\nset size to (10) %\nforever\n    if <touching (mouse-pointer v)?> then\n        change size by ((0.2) * ((110) - (size)))\n    else\n        change size by ((0.2) * ((100) - (size)))\n    end\nend\n\nwhen I receive [learn v]\nhide\n\nshow variable [scene # v]\n\nwhen I receive [main menu v]\n\nshow variable [coins v]\nshow variable [lives v]\n\nwhen I receive [achievements v]\nhide\n\nwhen I receive [layer v]\nwait (((length of [activated/defeated enemies v]) - (item # of [PLY] in [activated/defeated enemies v])) / (100)) seconds\ngo to [front v] layer\n\ndefine Order sprites by (z position)\nset [i v] to [1]\nrepeat until <not <(z position) < (item (i) of [z order v])>>\n    change [i v] by (1)\nend\ninsert (z position) at (i) of [z order v] \ngo [forward v] ((i) - (1)) layers\n\nwhen I receive [order sprites v]\nOrder sprites by (item # of [PLY] in [activated/defeated enemies v])\n\n@How to Play\n\nwhen flag clicked\ngo to x: (0) y: (-31)\n\nshow\n\nwhen this sprite clicked\nset volume to (Sound fx vol) %\nstart sound [A Bass v]\nbroadcast (How To Play v)\nset [big screen v] to [How to play]\nset [x do v] to [Main Menu]\nbroadcast (Popup v)\nhide\n\nwhen I receive [play v]\nhide\n\nwhen I receive [settings v]\nhide\n\nwhen I receive [main menu v]\nshow\nset size to (10) %\nforever\n    if <touching (mouse-pointer v)?> then\n        change size by ((0.2) * ((110) - (size)))\n    else\n        change size by ((0.2) * ((100) - (size)))\n    end\nend\n\nwhen I receive [learn v]\nhide\n\nwhen I receive [achievements v]\nhide\n\n@Learn\n\nwhen flag clicked\ngo to x: (118) y: (-31)\n\nshow\n\nwhen this sprite clicked\nset volume to (Sound fx vol) %\nstart sound [A Bass v]\nbroadcast (Learn v)\nset [learn change to: v] to [Learn]\nbroadcast (learn change costume v)\nhide\n\nwhen I receive [settings v]\nhide\n\nwhen I receive [how to play v]\nhide\n\nwhen I receive [main menu/ play again button v]\nhide\n\nwhen I receive [main menu v]\nshow\nset size to (10) %\nforever\n    if <touching (mouse-pointer v)?> then\n        change size by ((0.2) * ((110) - (size)))\n    else\n        change size by ((0.2) * ((100) - (size)))\n    end\nend\n\nshow variable [coins v]\nshow variable [lives v]\n\nwhen I receive [play v]\nhide\n\nwhen I receive [achievements v]\nhide\n\n@Main Menu\n\nwhen flag clicked\ngo to x: (114) y: (-31)\nhide variable [artifacts2 v]\nhide variable [deaths v]\nhide variable [timer v]\nhide\n\nwhen this sprite clicked\nset volume to (Sound fx vol) %\nstart sound [A Bass v]\nif <(costume [number v]) = [2]> then\n    set [big screen v] to [Overview]\n    set [artifacts2 v] to (Artifacts)\n    set [x do v] to [Main Menu]\n    hide variable [artifacts v]\n    show variable [deaths v]\n    show variable [timer v]\n    show variable [artifacts2 v]\n    broadcast (Popup v)\n    switch backdrop to (ancient egypt v)\n    hide\nelse\n    broadcast (Main Menu v)\n    switch backdrop to (ancient egypt v)\n    hide\nend\n\nwhen I receive [settings v]\nhide\n\nwhen I receive [how to play v]\nhide\n\nwhen I receive [main menu/ play again button v]\nswitch costume to (anubis-egyptian-god-removebg-preview3 v)\ngo to x: (114) y: (-31)\nshow\nset size to (10) %\nforever\n    if <touching (mouse-pointer v)?> then\n        change size by ((0.2) * ((110) - (size)))\n    else\n        change size by ((0.2) * ((100) - (size)))\n    end\nend\n\nshow\n\nwhen I receive [play v]\nhide\n\nwhen I receive [after win mn menu v]\nswitch costume to (anubis-egyptian-god-removebg-preview2 v)\ngo to [front v] layer\ngo to x: (-200) y: (-100)\nshow\nset size to (10) %\nforever\n    if <touching (mouse-pointer v)?> then\n        change size by ((0.2) * ((110) - (size)))\n    else\n        change size by ((0.2) * ((100) - (size)))\n    end\nend\n\n@Switch1\n\nwhen this sprite clicked\nDo assignment\n\nwhen flag clicked\nset [voice gender v] to [1]\nset [txt to speech? v] to [0]\nset [sound fx vol v] to [100]\nset [music? v] to [1]\nhide\ngo to x: (-117) y: (85)\nswitch costume to (costume2 v)\ncreate clone of (_myself_ v)\nnext costume\nnext costume\ncreate clone of (_myself_ v)\nnext costume\ncreate clone of (_myself_ v)\nnext costume\nnext costume\nnext costume\ncreate clone of (_myself_ v)\nswitch costume to (costume9 v)\n\nwhen I receive [settings v]\nif <not <(costume [number v]) = [9]>> then\n    show\nend\n\nwhen I receive [main menu v]\nhide\n\nforever\n\nswitch costume to (costume1 v)\n\nswitch costume to (costume2 v)\nset [sound fx vol v] to [100]\n\nswitch costume to (costume2 v)\n\nswitch costume to (costume2 v)\nset [sound fx vol v] to [100]\n\nif <[] = [1]> then\n    switch costume to (costume2 v)\n    set [sound fx vol v] to [100]\nend\n\nswitch costume to ((costume [number v]) - (1))\n\nnext costume\n\ndefine Do assignment\nif <((costume [number v]) mod (2)) = [1]> then\n    next costume\nelse\n    switch costume to ((costume [number v]) - (1))\nend\nif <([ceiling v] of ((costume [number v]) / (2)) ) = [1]> then\n    if <((costume [number v]) mod (2)) = [1]> then\n        set [sound fx vol v] to [0]\n    else\n        set [sound fx vol v] to [100]\n    end\nelse\n    if <([ceiling v] of ((costume [number v]) / (2)) ) = [2]> then\n        if <((costume [number v]) mod (2)) = [1]> then\n            set [music? v] to [0]\n        else\n            set [music? v] to [100]\n        end\n        broadcast (music v)\n    else\n        if <([ceiling v] of ((costume [number v]) / (2)) ) = [3]> then\n            if <((costume [number v]) mod (2)) = [1]> then\n                set [txt to speech? v] to [0]\n            else\n                set [txt to speech? v] to [1]\n            end\n        else\n            if <((costume [number v]) mod (2)) = [1]> then\n                set [voice gender v] to [0]\n                set voice to (alto v)::tts\n            else\n                set [voice gender v] to [1]\n                set voice to (tenor v)::tts\n            end\n            speak [hello]::tts\n        end\n    end\nend\nset volume to (Sound fx vol) %\nif <not <([ceiling v] of ((costume [number v]) / (2)) ) = [4]>> then\n    start sound [pop v]\nend\n\nwhen I start as a clone\n\nrepeat (4)\nswitch costume to (costume9 v)\n\nset language to (en v)::tts\n\n@Level\n\nwhen flag clicked\nadd to list\nswitch costume to (scene1 v)\nerase all\nhide\n\nwhen I receive [play v]\ngo to x: (0) y: (0)\nshow\n\nwhen I receive [change scene v]\nswitch costume to (join [Scene] (SCENE #))\nerase all\nStamp Outline [4] ((costume [number v]) - (1))\n\nwhen I receive [main menu v]\nerase all\nhide\n\ndefine Stamp Shadow\nset [brightness v] effect to (-10)\nset [ghost v] effect to (90)\nchange y by (-20)\nstamp\nchange y by (20)\nclear graphic effects\n\ndefine Stamp Outline (thickness) (scene)\nif <[edited scenes v] contains (scene)?> then\n    switch costume to (join [Scene] ((scene) + (0.5)))\nend\nset rotation style [don't rotate v]\nset [brightness v] effect to (-30)\nrepeat ((thickness) * (3))\n    turn right ((360) / ((thickness) * (3))) degrees\n    move (thickness) steps\n    stamp\n    move ((0) - (thickness)) steps\nend\nclear graphic effects\nswitch costume to (join [Scene] (scene))\n\nwhen I receive [changescene2 v]\nswitch costume to (join [Scene] (SCENE #))\nerase all\nStamp Outline [4] (costume [name v])\n\nerase all\nStamp Outline [4] (costume [name v])\n\nif <(scene) = [Scene5]> then\n    switch costume to (scene5.5 v)\nend\nif <(scene) = [Scene32]> then\n    switch costume to (scene32.4 v)\nend\n\ndefine add to list\ndelete all of [edited scenes v]\nadd [1] to [edited scenes v]\nadd [2] to [edited scenes v]\nadd [3] to [edited scenes v]\nadd [5] to [edited scenes v]\nadd [32] to [edited scenes v]\nadd [25] to [edited scenes v]\nadd [37] to [edited scenes v]\nadd [38] to [edited scenes v]\n\nwhen I receive [layer v]\nwait (((length of [back to front sprites v]) - (item # of [LVL] in [back to front sprites v])) / (100)) seconds\ngo to [front v] layer\n\nwhen I receive [order sprites v]\nOrder sprites by (item # of [LVL] in [back to front sprites v])\n\ndefine Order sprites by (z position)\nset [i v] to [1]\nrepeat until <not <(z position) < (item (i) of [z order v])>>\n    change [i v] by (1)\nend\ninsert (z position) at (i) of [z order v] \ngo [forward v] ((i) - (1)) layers\n\n@Player\n\nwhen I receive [play v]\nset drag mode [not draggable v]\nset [slope speed v] to ((size) / (50))\nset [acceleration v] to ((size) / (30))\nset [friction v] to [0.8]\nset [jump force v] to (((size) / (5)) + (3))\nset [already done? v] to [0]\nset [jump duration v] to [4]\nset [deaths v] to [0]\nset [artifacts v] to [0]\nset [gravity v] to [-1]\nbroadcast (Reset Game v) and wait\nbroadcast (Setup v) and wait\nset [able to restart? v] to [1]\nset [lives v] to [3]\nset [spawn x v] to [-215]\nset [spawn y v] to [-50]\nset [spawn scene v] to [1]\nset [control? v] to [1]\npoint in direction (90)\nreset and begin level []\n\nbroadcast (Play v)\n\ndefine fix in steps (steps)\nchange [falling v] by (1)\nrepeat (steps)\n    set [last value v] to (x position)\n    change x by ((speed x) / (steps))\n    check touching solid\n    if <(touching) > [0]> then\n        Collide X - Slope or Wall?\n    end\n    set [last value v] to (y position)\n    change y by ((speed y) / (steps))\n    check touching solid\n    if <(touching) > [0]> then\n        Collide Y - Ceiling or Floor?\n    end\nend\n\ndefine check touching solid\nif <<touching (level v)?> or <<<touching (moving platform v)?> or <touching (invisible level v)?>> or <touching (back layer level v)?>>> then\n    set [touching v] to [1]\n    if <touching (moving platform v)?> then\n        set [touching moving platform v] to [1]\n    else\n        set [touching moving platform v] to [0]\n    end\n    stop [this script v]\nend\nset [touching v] to [0]\nset [hit costume v] to (costume [name v])\nif <(costume [name v]) = [Hitbox v2]> then\n    switch costume to (hitbox feet v)\nend\nif <touching (jump through v)?> then\n    if <(jump through) < [1]> then\n        change y by (-6)\n        if <(costume [name v]) = [Hitbox v2]> then\n            switch costume to (hitbox feet2 v)\n        end\n        if <touching (jump through v)?> then\n            set [touching v] to [1]\n        else\n            set [jump through v] to [1]\n        end\n        change y by (6)\n    end\nelse\n    set [jump through v] to [0]\nend\nswitch costume to (hit costume)\n\nwhen I receive [tick- player v]\nif <(touching moving platform) = [1]> then\n    Moved by moving platform\nend\nControls - up and down\ncontrols - left and right\nfix in steps (([abs v] of (speed y) ) + ([abs v] of (speed y) ))\nSet Costume\n\nswitch backdrop to (ancient egypt v)\n\ndefine Controls - up and down\nif <<key (up arrow v) pressed?> or <<key (w v) pressed?> or <[0.2] < (stick y)>>> then\n    if <(control?) = [1]> then\n        if <(crouch) = [0]> then\n            if <<(wall slide) > [0]> and <(jumping) = [0]>> then\n                set [jumping v] to [1]\n                set [falling v] to [2]\n                set [wall slide v] to [0]\n                turn right (180) degrees\n                set [dir v] to (direction)\n                set [speed x v] to (((direction) / (90)) * ((size) / (7)))\n                set [long jump v] to ((size) / (4))\n            end\n            if <<(falling) < [2]> and <(jumping) = [0]>> then\n                set [jumping v] to [1]\n                set [falling v] to [2]\n            end\n            if <<(jumping) < (JUMP DURATION)> and <(jumping) > [0]>> then\n                change [jumping v] by (1)\n                set [speed y v] to (JUMP FORCE)\n            end\n        end\n    end\nelse\n    set [jumping v] to [0]\nend\nchange [speed y v] by (GRAVITY)\nif <(wall slide) > [0]> then\n    Check Can Wall Slide\n    if <(speed y) < [0]> then\n        set [speed y v] to ((speed y) * ((size) / (60)))\n    end\nend\nif <<key (down arrow v) pressed?> or <<key (s v) pressed?> or <(stick y) < [-0.2]>>> then\n    if <(control?) = [1]> then\n        if <(falling) = [0]> then\n            set [crouch v] to [1]\n        end\n    end\nelse\n    if <(crouch) = [1]> then\n        Allow not crouch?\n    end\nend\n\ndefine controls - left and right\nif <(long jump) > [0]> then\n    change [long jump v] by (-1)\n    stop [this script v]\nend\nif <(control?) = [1]> then\n    set [key x v] to (<<key (right arrow v) pressed?> or <<key (d v) pressed?> or <(stick x) > [0]>>> - <<key (left arrow v) pressed?> or <<key (a v) pressed?> or <[0] > (stick x)>>>)\nelse\n    set [key x v] to [0]\nend\nif <(KEY X) = [0]> then\n    if <<(falling) > [2]> and <(wall slide) < [1]>> then\n        set [speed x v] to ((speed x) * (0.95))\n        stop [this script v]\n    end\n    if <([abs v] of (speed x) ) < [1]> then\n        set [frame v] to [0]\n        set [speed x v] to [0]\n    else\n        if <(crouch) = [1]> then\n            change [frame v] by (0.25)\n        else\n            change [frame v] by (1)\n        end\n    end\nelse\n    if <(crouch) = [1]> then\n        point in direction ((KEY X) * (90))\n        change [frame v] by (0.5)\n        set [speed x v] to ((KEY X) * (2))\n        stop [this script v]\n    else\n        change [speed x v] by ((KEY X) * (ACCELERATION))\n        if <not <(direction) = ((KEY X) * (90))>> then\n            set [wall slide v] to [0]\n        end\n        change [frame v] by (2)\n        point in direction ((KEY X) * (90))\n    end\nend\nset [speed x v] to ((speed x) * (FRICTION))\n\ndefine reset and begin level (died?)\nshow\nset [invulnerable v] to <(stick y) < [0]>\nset [front v] to [0]\nset [speed y v] to [0]\nset [speed x v] to [0]\nset [falling v] to [99]\nset [wall slide v] to [0]\nset [jumping v] to [0]\nset [long jump v] to [0]\nif <(SPAWN SCENE) = [36]> then\n    begin scene # [36] go to x, y: [-168] [-79] dir [90] []\nelse\n    begin scene # (SPAWN SCENE) go to x, y: (SPAWN X) (SPAWN Y) dir [90] (died?)\nend\n\nbroadcast (Game Loop v)\nbroadcast (Change Scene v)\n\nwhen I receive [game loop v]\nset [ghost v] effect to (0)\nforever\n    broadcast (Tick - First v)\n    broadcast (Tick - Platforms v)\n    broadcast (Tick- player v)\n    broadcast (Tick- Last v)\nend\n\nwhen I receive [tick- last v]\nif <(x position) > [235]> then\n    begin scene # ((SCENE #) + (1)) go to x, y: [-235] [] dir [90] []\nend\nif <(x position) < [-235]> then\n    begin scene # ((SCENE #) - (1)) go to x, y: [235] [] dir [-90] []\nend\nif <<<touching (lava v)?> or <touching (spikes v)?>> or <<(y position) < [-185]> or <<(x position) > [100]> and <(SCENE #) = [36]>>>> then\n    broadcast (Lose Life v)\nend\n\ndefine begin scene # (scene #) go to x, y: (x) (y) dir (dir) (died?)\nset [scene # v] to (scene #)\nset [spawn scene v] to (scene #)\nif <(dir) > []> then\n    set rotation style [left-right v]\n    point in direction (dir)\nend\nif <(x) > []> then\n    set x to (x)\nend\nif <(y) > []> then\n    set y to (y)\nend\nset [spawn y v] to (y position)\nbroadcast (Exit Scene v)\nbroadcast (Change Scene v)\nstop [other scripts in sprite v]\nwait (0) seconds\nswitch costume to (hitbox v2 v)\nset rotation style [don't rotate v]\nif <(x) > []> then\n    fix collision in direction [0]\nelse\n    fix collision in direction [90]\nend\nSet Costume\nif <(touching) = [1]> then\n    Allow not crouch?\n    if <(crouch) = [0]> then\n        broadcast (Lose Life v)\n    end\nend\nbroadcast (Game Loop v)\nif <(SCENE #) = [17]> then\n    set [brightness v] effect to (-40)\nelse\n    set [brightness v] effect to (0)\nend\nif <(died?) = []> then\n\ndefine fix collision in direction (dir)\nset [old x v] to (x position)\nset [old y v] to (y position)\nset [temp v] to (direction)\nset [distance v] to []\npoint in direction (dir)\nrepeat (64)\n    check touching solid\n    if <(touching) < [1]> then\n        point in direction (temp)\n        stop [this script v]\n    end\n    move (distance) steps\n    turn right (180) degrees\n    change [distance v] by (1)\nend\ngo to x: (old x) y: (old y)\npoint in direction (temp)\n\nwhen flag clicked\nset [artifacts v] to [0]\nclear graphic effects\nhide\n\nwhen I receive [tick - first v]\nif <(crouch) = [0]> then\n    switch costume to (hitbox v2 v)\nelse\n    switch costume to (crouch hitbox v)\nend\nset rotation style [don't rotate v]\nset [platform dx v] to []\nset [platform dy v] to []\n\ndefine Set Costume\nset rotation style [left-right v]\nif <(wall slide) > [0]> then\n    switch costume to (wallslide01 v)\n    stop [this script v]\nend\nif <(falling) > [1]> then\n    if <(speed y) > [0]> then\n        switch costume to (jump v)\n    else\n        switch costume to (jump2 v)\n    end\n    stop [this script v]\nend\nif <(frame) > [0]> then\n    if <(crouch) = [1]> then\n        switch costume to ((29) + ((frame) mod (7)))\n    else\n        switch costume to ((10) + ((frame) mod (18)))\n    end\nelse\n    if <(crouch) = [1]> then\n        switch costume to (crouch v)\n    else\n        switch costume to (stand v)\n    end\nend\n\n\n\ndefine Collide X - Slope or Wall?\nCheck Can Wall Slide\nchange y by (1)\ncheck touching solid\nif <(touching) > [0]> then\n    change y by (1)\n    check touching solid\n    if <(touching) > [0]> then\n        change y by (-2)\n        set x to (last value)\n        set [speed x v] to [0]\n        stop [this script v]\n    end\n    set [speed x v] to ((speed x) * ((SLOPE SPEED) * (SLOPE SPEED)))\nend\nset [speed x v] to ((speed x) * (SLOPE SPEED))\nSlip\n\ndefine Collide Y - Ceiling or Floor?\nset y to (last value)\nif <(speed y) > [0]> then\n    set [speed y v] to [0]\n    stop [this script v]\nelse\n    set [jumping v] to [0]\nend\nif <(falling) > [0]> then\n    set [falling v] to [0]\n    Slip\nend\nset [speed y v] to ((speed y) * (0.8))\n\ndefine Slip\nchange y by (-2)\nchange x by (1)\ncheck touching solid\nif <(touching) < [1]> then\n    set [falling v] to [9]\n    change [speed x v] by (1)\n    stop [this script v]\nend\nchange x by (-2)\ncheck touching solid\nif <(touching) < [1]> then\n    set [falling v] to [9]\n    change [speed x v] by (-1)\n    stop [this script v]\nend\nchange y by (2)\nchange x by (1)\n\nswitch costume to (hit angle 0 v)\nrepeat (5)\n    check touching solid\n    if <(touching) < [1]> then\n        switch costume to ((costume [number v]) + (5))\n        stop [this script v]\n    end\n    next costume\nend\nswitch costume to (stand v)\n\ndefine Check Can Wall Slide\nif <(falling) < [2]> then\n    set [wall slide v] to [0]\n    stop [this script v]\nend\nswitch costume to (hitbox wallslide v)\nset rotation style [left-right v]\ncheck touching solid\nset [wall slide v] to (touching)\nswitch costume to (hitbox v2 v)\nset rotation style [don't rotate v]\nif <[0] < (touching)> then\n    set [jumping v] to [0]\nend\n\nwhen I receive [lose life v]\nset [able to restart? v] to [0]\nset [invulnerable v] to [1]\nstop [other scripts in sprite v]\nset volume to (Sound fx vol) %\nstart sound [Oops v]\nset [speed y v] to [5]\npoint in direction (90)\nset rotation style [all around v]\nswitch costume to (stand2 v)\nrepeat until <(y position) < [-180]>\n    turn right (15) degrees\n    change y by (speed y)\n    change [speed y v] by (GRAVITY)\nend\nset [ghost v] effect to (100)\nwait (0.5) seconds\nchange [deaths v] by (1)\nreset and begin level [1]\nset [able to restart? v] to [1]\nchange [lives v] by (-1)\nif <[0] < (LIVES)> then\nelse\n    reset and begin level [1]\nend\n\nif <[0] < (wall slide)> then\n    if <(dir) = [90]> then\n        if <(KEY X) = [1]> then\n            set [wall slide v] to [0]\n        end\n    else\n        if <(KEY X) = [-1]> then\n            set [wall slide v] to [0]\n        end\n    end\nend\n\nset [wall slide v] to [0]\n\ndefine Moved by moving platform\nchange x by (PLATFORM DX)\nchange y by (PLATFORM DY)\ncheck touching solid\nif <(touching) > [0]> then\n    Find closest space to (x position) (y position) max [16]\n    if <(touching) > [0]> then\n        broadcast (Lose Life v)\n    end\nend\n\ndefine Find closest space to (x) (y) max (max)\nset [temp v] to (direction)\nset [distance v] to [1]\npoint in direction (0)\nrepeat (max)\n    repeat (16)\n        go to x: (x) y: (y)\n        move (distance) steps\n        check touching solid\n        if <(touching) < [1]> then\n            point in direction (temp)\n            stop [this script v]\n        end\n        turn right (22.5) degrees\n    end\n    change [distance v] by (1)\nend\ngo to x: (x) y: (y)\npoint in direction (temp)\n\nwhen I receive [start game v]\n\nwhen I receive [player - bounce v]\nif <(bounce height) = [9]> then\n    set [speed y v] to [9]\nelse\n    set [speed y v] to (([abs v] of (speed y) ) * (0.8))\nend\n\nstart sound [Jump v]\n\nstart sound [Jump v]\n\nforever\n\ndefine Stamp Shadow\nset [brightness v] effect to (-100)\nset [ghost v] effect to (90)\nchange y by (-5)\nstamp\nchange y by (5)\nclear graphic effects\n\nerase all\n\n\n\nswitch costume to ((9) + ((frame) mod (18)))\n\ndefine Allow not crouch?\nset [prev costume v] to (costume [name v])\nswitch costume to (hitbox v2 v)\ncheck touching solid\nset [crouch v] to (touching)\nswitch costume to (prev costume)\n\n\n\nset [invulnerable v] to [0]\n\nif <(y position) > [180]> then\n    begin scene # ((SCENE #) + (100)) go to x, y: [] [-160] dir [] []\nend\nif <(y position) < [-180]> then\n    begin scene # ((SCENE #) - (100)) go to x, y: [] [180] dir [] []\nend\n\ndefine Say: (text) (wait)\nset [letter # v] to [1]\nset [text so far v] to []\nif <(txt to speech?) = [1]> then\n    set [txt to speech say player v] to (text)\n    broadcast (txt2speech \(player\) v)\nend\nrepeat (length of (text))\n    set [text so far v] to (join (Text so far) (letter (Letter #) of (text)))\n    if <(wait) = [2]> then\n        think (Text so far)\n    else\n        say (Text so far)\n    end\n    if <<(letter (Letter #) of (text)) = [.]> or <<(letter (Letter #) of (text)) = [!]> or <(letter (Letter #) of (text)) = [?]>>> then\n        wait (0.2) seconds\n    end\n    change [letter # v] by (1)\nend\nwait ((length of (text)) / (50)) seconds\nif <not <(wait) = [-1]>> then\n    if <(wait) = [2]> then\n        wait (2) seconds\n        say []\n        stop [this script v]\n    end\n    wait until <<key (space v) pressed?> or <mouse down?>>\n    say []\nend\n\nwhen I receive [say name v]\nSay: (join [You can call me ] (join (name) [.])) []\nbroadcast (said name v)\n\nwhen I receive [main menu v]\nstop [other scripts in sprite v]\nclear graphic effects\nhide\n\nwhen I receive [game over v]\nset [control? v] to [0]\n\nwhen I receive [say answer v]\nif <(yes/no quest) = [2]> then\n    Say: [Yeah, sure.] []\n    set [yes/no quest v] to [1]\nelse\n    Say: [No, I don't have the time. You'll have to find someone else.] []\n    set [yes/no quest v] to [-1]\nend\n\nwhen I receive [changescene2 v]\nhide\n\ndefine HACK - Go to Scene: (scene)\nshow\nif <(scene) > [19]> then\n    switch backdrop to (jungle v)\nend\nbegin scene # (scene) go to x, y: [0] (SPAWN Y) dir [90] []\n\nHACK - Go to Scene: [7]\n\nwhen I receive [lights out v]\nset [brightness v] effect to (-100)\nset [front v] to [1]\nwait (1) seconds\nSay: [Hmm. Looks like the lights went out. Better use the flashlight.] [2]\nclear graphic effects\nset [front v] to [0]\nbroadcast (on flash v)\nset [control? v] to [1]\n\nHACK - Go to Scene: [35]\n\nadd [Map 1] to [collected v]\n\nwhen I receive [changescene2 v]\nif <(SCENE #) = [19]> then\n    hide\n    stop [other scripts in sprite v]\nend\n\nHACK - Go to Scene: [25]\n\nwhen backdrop switches to [jungle v]\nif <(SCENE #) = [20]> then\n    show\n    set [speed x v] to [0]\n    set [speed y v] to [0]\n    begin scene # [20] go to x, y: [-180] [-50] dir [90] []\nend\n\nswitch backdrop to (jungle v)\n\nset [acceleration v] to [0]\n\nHACK - Go to Scene: [35]\n\nFind closest space to [-95] [-47] max [100]\n\nsay []\n\nHACK - Go to Scene: ((SCENE #) + (-1))\n\ndefine temporary pen for (seconds) seconds\npen down\nwait (seconds) seconds\npen up\n\ntemporary pen for [4] seconds\n\nchange pen (color v) by (10)\n\nSet Costume\nbroadcast (Game Loop v)\nif <(SCENE #) = [17]> then\n    set [brightness v] effect to (-40)\nelse\n    set [brightness v] effect to (0)\nend\n\nHACK - Go to Scene: [36]\n\nwhen I receive [txt2speech \(player\) v]\nif <(voice gender) = [1]> then\n    set voice to (tenor v)::tts\nelse\n    set voice to (alto v)::tts\nend\nspeak (txt to speech say player)::tts\n\nSay: [Hello!] []\n\nwhen I receive [layer v]\nwait (((length of [back to front sprites v]) - (item # of [PLAYER] in [back to front sprites v])) / (100)) seconds\ngo to [front v] layer\n\ndelete all of [back to front sprites v]\nadd [Joy1] to [back to front sprites v]\nadd [Joy2] to [back to front sprites v]\nadd [STG] to [back to front sprites v]\nadd [GMO] to [back to front sprites v]\nadd [PLY] to [back to front sprites v]\nadd [X] to [back to front sprites v]\nadd [LNB] to [back to front sprites v]\nadd [BGS] to [back to front sprites v]\nadd [DRK] to [back to front sprites v]\nadd [NLF] to [back to front sprites v]\nadd [YNQ] to [back to front sprites v]\nadd [PUM] to [back to front sprites v]\nadd [PLAYER] to [back to front sprites v]\nadd [ENM] to [back to front sprites v]\nadd [NPC] to [back to front sprites v]\nadd [LVL] to [back to front sprites v]\nadd [MVP] to [back to front sprites v]\nadd [SPK] to [back to front sprites v]\nadd [LVA] to [back to front sprites v]\nadd [JUMP] to [back to front sprites v]\nadd [BLL] to [back to front sprites v]\nadd [NLB] to [back to front sprites v]\nadd [INV] to [back to front sprites v]\n\nStamp Shadow\nclear graphic effects\n\nbroadcast (layer v)\n\nwhen I receive [achievements v]\n\nwhen I receive [win v]\nbegin scene # [38] go to x, y: [-88] [-47] dir [90] []\n\nwhen I receive [order sprites v]\nif <(front) = [1]> then\n    Order sprites by [-100]\nelse\n    Order sprites by (item # of [PLAYER] in [back to front sprites v])\nend\n\ndefine Order sprites by (z position)\nset [i v] to [1]\nrepeat until <not <(z position) < (item (i) of [z order v])>>\n    change [i v] by (1)\nend\ninsert (z position) at (i) of [z order v] \ngo [forward v] ((i) - (1)) layers\n\ndelete all of [back to front sprites v]\nadd [INV] to [back to front sprites v]\nadd [NLB] to [back to front sprites v]\nadd [BLL] to [back to front sprites v]\nadd [JUMP] to [back to front sprites v]\nadd [LVA] to [back to front sprites v]\nadd [SPK] to [back to front sprites v]\nadd [MVP] to [back to front sprites v]\nadd [LVL] to [back to front sprites v]\nadd [NPC] to [back to front sprites v]\nadd [ENM] to [back to front sprites v]\nadd [PLAYER] to [back to front sprites v]\nadd [PUM] to [back to front sprites v]\nadd [YNQ] to [back to front sprites v]\nadd [NLF] to [back to front sprites v]\nadd [DRK] to [back to front sprites v]\nadd [BGS] to [back to front sprites v]\nadd [LNB] to [back to front sprites v]\nadd [X] to [back to front sprites v]\nadd [PLY] to [back to front sprites v]\nadd [GMO] to [back to front sprites v]\nadd [STG] to [back to front sprites v]\n\nsay (i)\n\nif <<key (r v) pressed?> and <(able to restart?) = [1]>> then\n    point in direction (90)\n    reset and begin level []\nend\n\nwhen this sprite clicked\nbroadcast (map v)\n\n@Back layer level\n\nwhen flag clicked\nswitch costume to (scene1 v)\ngo to [back v] layer\nerase all\nhide\n\nwhen I receive [play v]\ngo to x: (0) y: (0)\nshow\n\nwhen I receive [change scene v]\nswitch costume to (blank v)\nswitch costume to (join [Scene] (SCENE #))\nif <not <(costume [name v]) = [Blank]>> then\n    Stamp Outline [4] (costume [name v])\nend\n\nwhen I receive [main menu v]\nerase all\nhide\n\ndefine Stamp Outline (thickness) (scene)\nif <<(scene) = [Scene1]> or <<(scene) = [Scene3]> or >> then\n    switch costume to (scene0.5 v)\nend\nif <(scene) = [Scene5]> then\n    switch costume to (scene5.5 v)\nend\nset rotation style [don't rotate v]\nset [brightness v] effect to (-30)\nrepeat ((thickness) * (3))\n    turn right ((360) / ((thickness) * (3))) degrees\n    move (thickness) steps\n    stamp\n    move ((0) - (thickness)) steps\nend\nclear graphic effects\nswitch costume to (scene)\n\nwhen I receive [layer v]\nwait (((length of [back to front sprites v]) - (item # of [BLL] in [back to front sprites v])) / (100)) seconds\ngo to [front v] layer\n\nstart sound [pop v]\n\ndefine Order sprites by (z position)\nset [i v] to [1]\nrepeat until <not <(z position) < (item (i) of [z order v])>>\n    change [i v] by (1)\nend\ninsert (z position) at (i) of [z order v] \ngo [forward v] ((i) - (1)) layers\n\nwhen I receive [order sprites v]\nOrder sprites by (item # of [BLL] in [back to front sprites v])\n\n@Sprite1\n\nwhen backdrop switches to [blue sky 2 2 v]\nset size to (600) %\ngo to x: (585) y: (0)\nhide\nrepeat (10)\n    wait (1) seconds\n    set size to (pick random (90) to (150)) %\n    create clone of (_myself_ v)\nend\nbroadcast (Screen fade v)\nwait (0.1) seconds\nwait until <([ghost effect v] of [big screens v]) = [0]>\nbroadcast (hide helicopter v)\nbroadcast (Destroy Clones v)\n\nwhen flag clicked\nset size to (524) %\ngo to x: (585) y: (0)\nhide\n\nwhen I start as a clone\nshow\ngo to [back v] layer\nset y to (pick random (-180) to (180))\nglide (5) secs to x: ((x position) * (-1)) y: (y position)\ndelete this clone\n\nwhen I receive [destroy clones v]\ndelete this clone\n\n@Learn buttons\n\nwhen flag clicked\nset [my scene v] to []\nhide\nAdd to list\nClone\n\nwhen I receive [learn change costume v]\nhide\nwait (0) seconds\nif <([costume name v] of [big screens v]) = (my scene)> then\n    show\n    go to [front v] layer\nend\n\ndefine Clone\nswitch costume to (b v)\nset [index v] to [1]\nrepeat until <(costume [number v]) = [1]>\n    set [my scene v] to (item (index) of [my scene v])\n    create clone of (_myself_ v)\n    next costume\n    change [index v] by (1)\nend\n\nwhen I receive [main menu v]\nhide\n\nwhen this sprite clicked\nstart sound [pop v]\nhide\nset [learn change to: v] to (letter (1) of (costume [name v]))\nbroadcast (learn change costume v)\n\ndefine Add to list\ndelete all of [my scene v]\nadd [I] to [my scene v]\nadd [B] to [my scene v]\nadd [B] to [my scene v]\nadd [B] to [my scene v]\nadd [B] to [my scene v]\nadd [A] to [my scene v]\nadd [A] to [my scene v]\nadd [B] to [my scene v]\nadd [G] to [my scene v]\nadd [E] to [my scene v]\nadd [C] to [my scene v]\nadd [E] to [my scene v]\nadd [F] to [my scene v]\nadd [I] to [my scene v]\nadd [A] to [my scene v]\nadd [H] to [my scene v]\nadd [I] to [my scene v]\nadd [D] to [my scene v]\nadd [J] to [my scene v]\nadd [G] to [my scene v]\nadd [K] to [my scene v]\nadd [F] to [my scene v]\nadd [L] to [my scene v]\nadd [K] to [my scene v]\nadd [M] to [my scene v]\nadd [1] to [my scene v]\nadd [G] to [my scene v]\nadd [2] to [my scene v]\nadd [G] to [my scene v]\nadd [3] to [my scene v]\nadd [G] to [my scene v]\nadd [C] to [my scene v]\nadd [N] to [my scene v]\nadd [C] to [my scene v]\nadd [O] to [my scene v]\nadd [C] to [my scene v]\nadd [P] to [my scene v]\nadd [D] to [my scene v]\nadd [Q] to [my scene v]\nadd [D] to [my scene v]\nadd [R] to [my scene v]\nadd [E] to [my scene v]\nadd [S] to [my scene v]\nadd [E] to [my scene v]\nadd [T] to [my scene v]\nadd [E] to [my scene v]\nadd [U] to [my scene v]\nadd [E] to [my scene v]\nadd [V] to [my scene v]\nadd [H] to [my scene v]\nadd [W] to [my scene v]\nadd [H] to [my scene v]\nadd [X] to [my scene v]\nadd [F] to [my scene v]\nadd [4] to [my scene v]\nadd [F] to [my scene v]\nadd [5] to [my scene v]\nadd [L] to [my scene v]\nadd [6] to [my scene v]\nadd [L] to [my scene v]\nadd [7] to [my scene v]\nadd [K] to [my scene v]\nadd [Y] to [my scene v]\nadd [K] to [my scene v]\nadd [Z] to [my scene v]\nadd [9] to [my scene v]\nadd [!] to [my scene v]\nadd [@] to [my scene v]\nadd [#] to [my scene v]\nadd [$] to [my scene v]\nadd [%] to [my scene v]\nadd [^] to [my scene v]\nadd [&] to [my scene v]\nadd [J] to [my scene v]\nadd [8] to [my scene v]\nadd [8] to [my scene v]\nadd [8] to [my scene v]\nadd [8] to [my scene v]\nadd [8] to [my scene v]\nadd [8] to [my scene v]\nadd [8] to [my scene v]\nadd [8] to [my scene v]\nadd [8] to [my scene v]\nadd [*] to [my scene v]\nadd [J] to [my scene v]\nadd [\(] to [my scene v]\nadd [J] to [my scene v]\nadd [I] to [my scene v]\nadd [\)] to [my scene v]\n\nbroadcast (learn change costume v)\n\nwhen I start as a clone\n\nshow\n\nshow\ngo to [front v] layer\n\nif < (costume [name v]) contains [Learn]?> then\n    set [learn change to: v] to [Learn]\nelse\n    if < (costume [name v]) contains [Pharaohs]?> then\n        set [learn change to: v] to [Pharaohs]\n    else\n        if < (costume [name v]) contains [History]?> then\n            set [learn change to: v] to [History]\n        end\n    end\nend\n\nadd [I] to [my scene v]\nadd [B] to [my scene v]\nadd [B] to [my scene v]\nadd [B] to [my scene v]\nadd [B] to [my scene v]\nadd [A] to [my scene v]\nadd [A] to [my scene v]\nadd [B] to [my scene v]\nadd [G] to [my scene v]\nadd [E] to [my scene v]\nadd [C] to [my scene v]\nadd [E] to [my scene v]\n\nset [learn change to: v] to (letter (1) of [X])\nbroadcast (learn change costume v)\n\nwhen I receive [layer v]\nwait (((length of [back to front sprites v]) - (item # of [LNB] in [back to front sprites v])) / (100)) seconds\ngo to [front v] layer\n\nwhen I receive [order sprites v]\nOrder sprites by (item # of [LNB] in [back to front sprites v])\n\ndefine Order sprites by (z position)\nset [i v] to [1]\nrepeat until <not <(z position) < (item (i) of [z order v])>>\n    change [i v] by (1)\nend\ninsert (z position) at (i) of [z order v] \ngo [forward v] ((i) - (1)) layers\n\n@Spikes\n\nwhen flag clicked\nhide\n\nwhen I receive [play v]\ngo to x: (0) y: (0)\nshow\n\nwhen I receive [change scene v]\nswitch costume to (blank v)\nswitch costume to (join [Scene] (SCENE #))\n\nwhen flag clicked\nerase all\nhide\n\nwhen I receive [layer v]\nwait (((length of [back to front sprites v]) - (item # of [SPK] in [back to front sprites v])) / (100)) seconds\ngo to [front v] layer\n\ndefine Order sprites by (z position)\nset [i v] to [1]\nrepeat until <not <(z position) < (item (i) of [z order v])>>\n    change [i v] by (1)\nend\ninsert (z position) at (i) of [z order v] \ngo [forward v] ((i) - (1)) layers\n\nwhen I receive [order sprites v]\nOrder sprites by (item # of [SPK] in [back to front sprites v])\n\n@Lava\n\nwhen flag clicked\nhide\n\nwhen I receive [play v]\ngo to x: (0) y: (0)\nshow\n\nwhen I receive [change scene v]\nswitch costume to (blank v)\nswitch costume to (join [Scene] (SCENE #))\nset [up/down v] to [0]\nforever\n    wait (1) seconds\n    repeat until <(y position) = (lava swell height)>\n        set y to ((lava swell height) * ([sin v] of ((up/down) * (5)) ))\n        change [up/down v] by (1)\n    end\n    wait (1) seconds\n    repeat until <(y position) = ((-1) * (lava swell height))>\n        set y to ((lava swell height) * ([sin v] of ((up/down) * (5)) ))\n        change [up/down v] by (-1)\n    end\nend\n\nswitch costume to (blank v)\nswitch costume to (join [Scene] (SCENE #))\nforever\n    set y to ((3) * ([sin v] of ((timer) * (180)) ))\nend\n\nset [lava swell height v] to [10]\n\ngo [backward v] (1) layers\n\nwhen I receive [layer v]\nwait (((length of [back to front sprites v]) - (item # of [LVA] in [back to front sprites v])) / (100)) seconds\ngo to [front v] layer\n\ndefine Order sprites by (z position)\nset [i v] to [1]\nrepeat until <not <(z position) < (item (i) of [z order v])>>\n    change [i v] by (1)\nend\ninsert (z position) at (i) of [z order v] \ngo [forward v] ((i) - (1)) layers\n\nwhen I receive [order sprites v]\nOrder sprites by (item # of [LVA] in [back to front sprites v])\n\n@Moving Platform\n\nwhen I receive [change scene v]\nhide\nif <(SCENE #) = [5]> then\n    Spawn [Key 1] turn []\nend\nif <(SCENE #) = [x]> then\n    Spawn [xx] turn [5]\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [tick - platforms v]\nTick (x position) (y position)\nset [last x v] to (x position)\nset [last y v] to (y position)\n\ndefine Tick (new x) (new y)\nif <(turn) > []> then\n    change y by (4)\n    if <touching (player v)?> then\n        Rotation Maths CCW ((0) - (turn))\n    end\nelse\n    if <(new y) > (last y)> then\n        change y by (1)\n    else\n        set y to ((last y) + (1))\n    end\n    if <touching (player v)?> then\n        set [platform dx v] to ((x position) - (last x))\n        set [platform dy v] to ((y position) - (last y))\n    end\nend\ngo to x: (new x) y: (new y)\n\ndefine Animate Platform - xy1 (x1) (y1) time1 (time1) xy2 (x2) (y2) time2 (time2) costume (costume) wait1 (wait1) wait2 (wait2) Turn (degrees) dir (dir)\nswitch costume to (costume)\nif <(turn) = []> then\n    go to x: (x2) y: (y2)\nelse\n    go to x: (x1) y: (y1)\nend\npoint in direction (90)\nshow\nif <not <(turn) = []>> then\n    set rotation style [all around v]\n    forever\n        turn right (turn) degrees\n    end\nelse\n    forever\n        glide (time1) secs to x: (x1) y: (y1)\n        wait (wait1) seconds\n        glide (time2) secs to x: (x2) y: (y2)\n        wait (wait2) seconds\n    end\nend\n\ndefine Door at (x) (y) key name (key name) move x y (move x) (move y) dir (dir) ghost? (0/1)\nshow\nswitch costume to (key name)\ngo to x: (x) y: (y)\npoint in direction (dir)\nforever\n    wait until <touching (player v)?>\n    if <[collected v] contains (key name)?> then\n        if <(0/1) = [0]> then\n            repeat (24)\n                change x by (move x)\n                change y by (move y)\n            end\n            wait (1) seconds\n            repeat (24)\n                change x by (() - (move x))\n                change y by (() - (move y))\n            end\n        else\n            add (key name) to [opened doors v]\n            repeat (20)\n                change [ghost v] effect by (5)\n            end\n            delete this clone\n        end\n    else\n        wait until <not <touching (player v)?>>\n    end\nend\n\nwhen I receive [setup v]\ngo to [back v] layer\n\nwhen I receive [game over v]\nstop [other scripts in sprite v]\n\nwhen flag clicked\ndelete all of [opened doors v]\nset rotation style [left-right v]\nhide\n\nwhen I receive [exit scene v]\ndelete this clone\n\ndefine Spawn (type) turn (degrees)\nswitch costume to (type)\nset [costume v] to (costume [name v])\nset [turn v] to (degrees)\nif <not <[opened doors v] contains (type)?>> then\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nshow\nif <(SCENE #) = [5]> then\n    Door at [-119] [-39] key name [Key 1] move x y [] [] dir [] ghost? [1]\nend\n\nif <(SCENE #) = [x]> then\n    Animate Platform - xy1 [0] [0] time1 [] xy2 [] [] time2 [] costume [Line] wait1 [] wait2 [] Turn [] dir [90]\nend\n\ngo to x: (x) y: (y)\npoint in direction (dir)\n\n\n\nDoor at [-74] [-78] key name [Key 1] move x y [0] [4] dir [] ghost? []\n\nshow\nswitch costume to (key 1 v)\ngo to x: (-74) y: (-78)\npoint in direction (90)\nforever\n    wait until <touching (player v)?>\n    if <[collected v] contains [Key 1]?> then\n        repeat (24)\n            change x by ()\n            change y by (4)\n        end\n        wait (1) seconds\n        repeat (24)\n            change x by (() - ())\n            change y by (() - (4))\n        end\n        start sound [Crunch v]\n    else\n        start sound [Low Squeak v]\n        wait until <not <touching (player v)?>>\n    end\nend\n\ndefine Rotation Maths CCW (ccw)\nset [dx v] to (([x position v] of [player v]) - (x position))\nset [dy v] to (([y position v] of [player v]) - (y position))\nset [sin v] to ([sin v] of (ccw) )\nset [cos v] to ([cos v] of (ccw) )\nset [platform dx v] to ((((dx) * (cos)) - ((dy) * (sin))) - (dx))\nset [platform dy v] to ((((dx) * (sin)) + ((dy) * (cos))) - (dy))\n\nset [platform # v] to [2]\nSpawn [Square] turn [3]\n\nset [platform # v] to [1]\n\ngo to x: (20) y: (-204)\n\nif <(SCENE #) = [3]> then\n    Spawn [Key 1] turn []\nend\nif <(SCENE #) = [0]> then\n    set [platform # v] to [1]\n    Spawn [costume1] turn []\n    set [platform # v] to [2]\n    Spawn [Square] turn [1]\nend\nif <(SCENE #) = [4]> then\n    Spawn [Cross] turn [-3]\nend\nif <(SCENE #) = [-1]> then\n    Spawn [Circle] turn [1]\nend\n\nerase all\n\ndefine Stamp Shadow\nset [brightness v] effect to (-100)\nset [ghost v] effect to (90)\nchange y by (-20)\nstamp\nchange y by (20)\nclear graphic effects\n\ndefine Stamp Outline (thickness)\nset rotation style [don't rotate v]\nset [brightness v] effect to (-20)\nrepeat ((thickness) * (3))\n    turn right ((360) / ((thickness) * (3))) degrees\n    move (thickness) steps\n    stamp\n    move ((0) - (thickness)) steps\nend\nclear graphic effects\n\nif <(costume) = [Key 1]> then\n    Door at [-74] [-78] key name [Key 1] move x y [0] [4] dir [90] ghost? []\nend\nif <(SCENE #) = [0]> then\n    if <(platform #) = [1]> then\n    else\n    end\nend\nif <(SCENE #) = [4]> then\nend\nif <(SCENE #) = [-1]> then\n    Animate Platform - xy1 [0] [-411] time1 [] xy2 [] [] time2 [] costume [Circle] wait1 [] wait2 [] Turn [3] dir [90]\nend\n\nAnimate Platform - xy1 [104] [10] time1 [2] xy2 [104] [-90] time2 [2] costume [costume1] wait1 [1] wait2 [1] Turn [] dir [90]\n\nAnimate Platform - xy1 [0] [-90] time1 [2] xy2 [0] [10] time2 [2] costume [Square] wait1 [1] wait2 [1] Turn [2] dir [90]\n\nAnimate Platform - xy1 [88] [-3] time1 [] xy2 [] [] time2 [] costume [Square2] wait1 [] wait2 [] Turn [-3] dir [90]\n\nif <(SCENE #) = [3]> then\n\nset [ghost v] effect to (0)\n\nwhen I receive [layer v]\nwait (((length of [back to front sprites v]) - (item # of [MVP] in [back to front sprites v])) / (100)) seconds\ngo to [front v] layer\n\nwhen I receive [order sprites v]\nOrder sprites by (item # of [MVP] in [back to front sprites v])\n\ndefine Order sprites by (z position)\nset [i v] to [1]\nrepeat until <not <(z position) < (item (i) of [z order v])>>\n    change [i v] by (1)\nend\ninsert (z position) at (i) of [z order v] \ngo [forward v] ((i) - (1)) layers\n\n@Collectible\n\nwhen flag clicked\nhide\n\nwhen I receive [main menu v]\ndelete this clone\n\nwhen I receive [change scene v]\nif <(SCENE #) = (my scene)> then\n    show\nelse\n    hide\nend\n\nswitch costume to (apple v)\n\nwhen I start as a clone\nset [frame v] to (pick random (1) to (10000))\ngo to [back v] layer\nrepeat until <(touching player) = [1]>\n    repeat (10)\n        change y by ((0.5) * ([sin v] of (frame) ))\n        change [frame v] by (5)\n        if <touching (player v)?> then\n            set [touching player v] to [1]\n        end\n        if <<(INVULNERABLE) = [1]> and <(LIVES) = [0]>> then\n            stop [this script v]\n        end\n    end\nend\nset [my scene v] to []\nif <<(costume [name v]) = [1]> or <(costume [name v]) = [10]>> then\n    change [artifacts v] by (costume [name v])\nelse\n    if <(costume [name v]) = [Green Flag]> then\n        set [spawn scene v] to (SCENE #)\n        set [spawn x v] to (x position)\n        set [spawn y v] to (y position)\n    else\n        add (costume [name v]) to [collected v]\n    end\nend\nif <(costume [name v]) = [1]> then\n    start sound [Collect v]\nelse\n    repeat (20)\n        change y by (2)\n        change [ghost v] effect by (5)\n    end\nend\nhide\nif <(costume [name v]) = [Map 1]> then\n    wait (1) seconds\n    set [popup mini do v] to [Map 1]\n    broadcast (popup mini v)\nend\n\nwhen I receive [setup v]\ndelete all of [collected v]\nset [frame v] to [0]\nset [coins v] to [0]\nPlace [Key 1] scene [0] xy [33] [-46]\nPlace [10] scene [23] xy [-98] [40]\nPlace [1] scene [25] xy [-63] [-8]\nPlace [1] scene [25] xy [60] [26]\nPlace [10] scene [25] xy [124] [-65]\nPlace [Map 1] scene [6] xy [166] [72]\nPlace [1] scene [1] xy [-41] [35]\nPlace [1] scene [1] xy [45] [45]\nPlace [1] scene [1] xy [5] [63]\nPlace [1] scene [2] xy [-39] [25]\nPlace [1] scene [2] xy [25] [45]\nPlace [1] scene [3] xy [85] [-34]\nPlace [1] scene [3] xy [130] [-34]\nPlace [1] scene [3] xy [175] [-34]\nPlace [1] scene [5] xy [-29] [25]\nPlace [1] scene [5] xy [-78] [100]\nPlace [10] scene [5] xy [223] [52]\nPlace [1] scene [20] xy [223] [-43]\nPlace [1] scene [21] xy [-83] [-47]\nPlace [1] scene [21] xy [11] [-47]\nPlace [1] scene [21] xy [116] [-47]\nPlace [1] scene [21] xy [72] [126]\nPlace [1] scene [22] xy [72] [-31]\nPlace [1] scene [22] xy [53] [53]\nPlace [1] scene [22] xy [9] [117]\nPlace [1] scene [22] xy [-95] [4]\nPlace [1] scene [23] xy [-155] [-7]\nPlace [1] scene [23] xy [-44] [-7]\nPlace [1] scene [23] xy [-10] [132]\nPlace [1] scene [23] xy [135] [132]\nPlace [1] scene [23] xy [-189] [132]\nPlace [1] scene [23] xy [-100] [132]\nPlace [1] scene [24] xy [14] [-71]\nPlace [1] scene [24] xy [-103] [-44]\nPlace [1] scene [26] xy [37] [-11]\nPlace [1] scene [26] xy [112] [63]\nPlace [1] scene [26] xy [194] [63]\nPlace [1] scene [27] xy [-7] [26]\nPlace [10] scene [27] xy [16] [129]\nPlace [1] scene [28] xy [19] [-5]\nPlace [1] scene [28] xy [-134] [89]\nPlace [1] scene [28] xy [-49] [140]\nPlace [1] scene [28] xy [76] [140]\nPlace [1] scene [28] xy [186] [140]\nPlace [1] scene [28] xy [215] [51]\nPlace [1] scene [28] xy [219] [-48]\nPlace [1] scene [29] xy [-29] [56]\nPlace [1] scene [29] xy [-192] [140]\nPlace [1] scene [29] xy [-83] [140]\nPlace [1] scene [29] xy [35] [140]\nPlace [1] scene [30] xy [-152] [134]\nPlace [10] scene [30] xy [179] [-32]\nPlace [1] scene [31] xy [41] [-47]\nPlace [1] scene [32] xy [-160] [-61]\nPlace [1] scene [32] xy [-110] [-61]\nPlace [1] scene [32] xy [-60] [-61]\nPlace [1] scene [32] xy [-10] [-61]\nPlace [1] scene [32] xy [72] [-55]\nPlace [1] scene [33] xy [-42] [-36]\nPlace [10] scene [33] xy [56] [-36]\nPlace [1] scene [34] xy [26] [5]\nPlace [1] scene [34] xy [26] [77]\nPlace [1] scene [34] xy [199] [9]\nPlace [1] scene [35] xy [-81] [12]\nPlace [1] scene [35] xy [23] [12]\nPlace [1] scene [35] xy [112] [12]\nPlace [1] scene [35] xy [64] [134]\nPlace [1] scene [35] xy [215] [83]\nPlace [10] scene [36] xy [-107] [-71]\n\ndefine Place (costume name) scene (scene) xy (x) (y)\nset [touching player v] to [0]\nset [my scene v] to (scene)\nswitch costume to (costume name)\ngo to x: (x) y: (y)\ncreate clone of (_myself_ v)\nset [my scene v] to []\n\ndefine check touching player (costume)\nif <touching (player v)?> then\n    set [touching player v] to [1]\nend\n\nswitch costume to (costume)\nswitch costume to (join [h-] (costume))\n\nwhen I receive [reset game v]\ndelete this clone\n\nPlace [Key 2] scene [1] xy [-180] [95]\nPlace [apple] scene [1] xy [94] [6]\nPlace [apple] scene [1] xy [40] [45]\nPlace [apple] scene [1] xy [-54] [38]\nPlace [Green Flag] scene [2] xy [12] [-20]\nPlace [Key 1] scene [2] xy [175] [-136]\n\ncheck touching player (costume [name v])\n\nhide\n\ngo to [front v] layer\n\nwhen I receive [main menu v]\nhide variable [artifacts2 v]\nhide variable [deaths v]\nhide variable [timer v]\n\n@Big Screens\n\nwhen I receive [popup v]\nset [ghost v] effect to (0)\nswitch costume to (big screen)\nset [show v] to [1]\nshow\n\nif <(dark) = [1]> then\n\nwhen flag clicked\nset [show v] to [0]\nset [ghost v] effect to (0)\ngo to x: (0) y: (0)\nset [big screen v] to []\nhide\n\nwhen I receive [main menu v]\nset [ghost v] effect to (0)\nhide\nset [show v] to [0]\n\nwhen I receive [screen fade v]\nhide variable [artifacts v]\ngo to [front v] layer\nset [ghost v] effect to (100)\nset [ghost effect v] to [100]\nswitch costume to (screen fade v)\nshow\nset [control? v] to [0]\nrepeat (50)\n    change [ghost v] effect by (-2)\n    change [ghost effect v] by (-2)\nend\nwait (1) seconds\nrepeat (50)\n    change [ghost v] effect by (2)\n    change [ghost effect v] by (2)\nend\nshow variable [artifacts v]\nhide\nset [control? v] to [1]\n\nset [ghost v] effect to (0)\n\nwhen [e v] key pressed\nbroadcast (map v)\n\nwhen I receive [hide popup v]\nhide\nset [show v] to [0]\n\nwhen I receive [change scene v]\nhide\nset [show v] to [0]\n\nwhen I receive [learn v]\nset [x do v] to [Main Menu]\nset [big screen v] to [A]\nbroadcast (Popup v)\n\nwhen I receive [learn change costume v]\nswitch costume to (learn change to:)\n\nsay [Hello!]\n\n\n\nwhen I receive [layer v]\nwait (((length of [back to front sprites v]) - (item # of [BGS] in [back to front sprites v])) / (100)) seconds\ngo to [front v] layer\n\nwhen I receive [order sprites v]\nOrder sprites by (item # of [BGS] in [back to front sprites v])\n\ndefine Order sprites by (z position)\nset [i v] to [1]\nrepeat until <not <(z position) < (item (i) of [z order v])>>\n    change [i v] by (1)\nend\ninsert (z position) at (i) of [z order v] \ngo [forward v] ((i) - (1)) layers\n\nwhen I receive [map v]\nif <[collected v] contains [Map 1]?> then\n    if <(SCENE #) < [8]> then\n        set [big screen v] to [Map 1]\n    else\n        if <[17] < (SCENE #)> then\n            set [big screen v] to [Map 11]\n        else\n            set [big screen v] to (join [Map ] ((SCENE #) - (7)))\n        end\n    end\n    set [x do v] to [Hide Popup]\n    broadcast (Popup v)\nend\n\n@X\n\nwhen flag clicked\nset [x do v] to []\nhide\n\nwhen I receive [settings v]\ngo to [front v] layer\nset [x do v] to [Main Menu]\ngo to x: (194) y: (135)\nshow\n\nwhen this sprite clicked\nset volume to (Sound fx vol) %\nstart sound [pop v]\nbroadcast (x do)\n\nwhen I receive [main menu v]\nhide\n\nwhen I receive [popup v]\ngo to [front v] layer\nshow\n\nwhen I receive [hide popup v]\nhide\n\nwhen I receive [change scene v]\nhide\n\nwhen I receive [achievements v]\ngo to [front v] layer\nset [x do v] to [Main Menu]\ngo to x: (194) y: (135)\nshow\n\nwhen I receive [lights out v]\nbroadcast (Hide Popup v)\n\nwhen I receive [layer v]\nwait (((length of [back to front sprites v]) - (item # of [X] in [back to front sprites v])) / (100)) seconds\ngo to [front v] layer\n\nwhen I receive [order sprites v]\nOrder sprites by (item # of [X] in [back to front sprites v])\n\ndefine Order sprites by (z position)\nset [i v] to [1]\nrepeat until <not <(z position) < (item (i) of [z order v])>>\n    change [i v] by (1)\nend\ninsert (z position) at (i) of [z order v] \ngo [forward v] ((i) - (1)) layers\n\ndefine Order sprites by (z position)\nset [i v] to [1]\nrepeat until <not <(z position) < (item (i) of [z order v])>>\n    change [i v] by (1)\nend\ninsert (z position) at (i) of [z order v] \ngo [forward v] ((i) - (1)) layers\n\n@Game Over\n\nwhen flag clicked\nhide\n\nwhen I receive [game over v]\ngo to x: (0) y: (100)\nswitch costume to (game over v)\nshow\nbroadcast (Main menu/ Play again button v)\n\nwhen I receive [play v]\nhide\n\nwhen I receive [main menu v]\nhide\n\nwhen I receive [layer v]\nwait (((length of [back to front sprites v]) - (item # of [GMO] in [back to front sprites v])) / (100)) seconds\ngo to [front v] layer\n\nwhen I receive [gameovershow v]\ngo to x: (0) y: (100)\nswitch costume to (game over v)\nshow\n\nwhen I receive [order sprites v]\nOrder sprites by (item # of [GMO] in [back to front sprites v])\n\ndefine Order sprites by (z position)\nset [i v] to [1]\nrepeat until <not <(z position) < (item (i) of [z order v])>>\n    change [i v] by (1)\nend\ninsert (z position) at (i) of [z order v] \ngo [forward v] ((i) - (1)) layers\n\n@Enemy\n\nwhen flag clicked\nclear graphic effects\nset rotation style [left-right v]\nhide\n\nwhen I receive [change scene v]\nif <(SCENE #) = [22]> then\n    Spawn [Bounce] at [71] [-62] dir [90] speed [] id [Bounce1]\nend\nif <(SCENE #) = [23]> then\n    Spawn [Frog] at [41] [-64] dir [90] speed [2] id [Frog1]\nend\nif <(SCENE #) = [27]> then\n    Spawn [Frog] at [175] [-63] dir [-90] speed [] id [Frog2]\nend\nif <(SCENE #) = [36]> then\n    set [hitboss v] to [0]\n    Spawn [BOSS] at [156] [-15] dir [90] speed [] id [BOSS]\nend\n\nwhen I start as a clone\nshow\nset [speed y v] to [0]\nset [frame v] to [0]\nif <(costume [name v]) = [Frog]> then\n    set size to (50) %\n    forever\n        Jump [5] Times\n    end\nelse\n    if <(costume [name v]) = [Bounce]> then\n        set size to (100) %\n        if <[activated/defeated enemies v] contains (id)?> then\n            switch costume to (bounce5 v)\n        else\n            switch costume to (bounce v)\n        end\n        forever\n            if <<(INVULNERABLE) = [0]> and <<touching (player v)?> and <([speed y v] of [player v]) < [-3]>>> then\n                if <(costume [name v]) = [Bounce]> then\n                    add (id) to [activated/defeated enemies v]\n                    set [bounce height v] to [9]\n                    broadcast (Player - Bounce v)\n                    wait (0.3) seconds\n                    repeat (4)\n                        next costume\n                    end\n                else\n                    if <(costume [name v]) = [Bounce5]> then\n                        set [bounce height v] to [20]\n                        broadcast (Player - Bounce v)\n                    end\n                end\n            end\n            if <<(INVULNERABLE) = [1]> and <(LIVES) = [0]>> then\n                stop [this script v]\n            end\n        end\n    else\n        if <(costume [name v]) = [BOSS]> then\n            set [hitboss v] to [0]\n            set size to (100) %\n            if <(already done?) = [0]> then\n                wait until <([y position v] of [player v]) < [-70]>\n                set [control? v] to [0]\n                broadcast (Boss Music v)\n                wait (1) seconds\n                Say: [HAHAHA!] []\n                Say: [I finally have you within my grasp!] []\n                Say: [I am Set, the god of Evil, and you were so easy to lure here.] []\n                Say: [Oh? Why you? Because you were the only one who could possibly stop me! AND NOW I WILL RULE THE WORLD!] []\n            end\n            set [control? v] to [0]\n            Say: [Prepare for battle! HAHAHA!] []\n            wait (0.5) seconds\n            set [mummy repeat v] to [300]\n            set [control? v] to [1]\n            set [already done? v] to [1]\n            wait (3) seconds\n            set [my costume v] to (costume [name v])\n            switch costume to (d v)\n            broadcast (be boss v)\n            forever\n                if <(hitboss) = [1]> then\n                    set [hitboss v] to [0]\n                    stop [other scripts in sprite v]\n                    next costume\n                    say []\n                    wait (1) seconds\n                    Say: (item (letter (5) of (costume [name v])) of [responses v]) [-3]\n                    wait (3) seconds\n                    set [my costume v] to (costume [name v])\n                    switch costume to (d v)\n                    broadcast (be boss v)\n                end\n            end\n        else\n            if <(costume [name v]) = [Mummy]> then\n                forever\n                    switch costume to (mummy v)\n                    repeat (mummy repeat)\n                        Locate player (direction)\n                        move (2) steps\n                    end\n                    wait (1) seconds\n                    repeat (4)\n                        next costume\n                        wait (0.1) seconds\n                    end\n                    repeat (13)\n                        next costume\n                    end\n                    repeat (3)\n                        wait (1) seconds\n                        next costume\n                    end\n                    wait (1) seconds\n                end\n            else\n                if <(costume [name v]) = [Lightning]> then\n                    repeat (3)\n                        repeat (5)\n                            change [ghost v] effect by (20)\n                        end\n                        repeat (5)\n                            change [ghost v] effect by (-20)\n                        end\n                    end\n                    repeat (3)\n                        change [ghost v] effect by (100)\n                        wait (0.1) seconds\n                        change [ghost v] effect by (-100)\n                        wait (0.1) seconds\n                    end\n                    go to [front v] layer\n                    start sound [Thunder Storm v]\n                    switch costume to (lightning2 v)\n                    if <<touching (player v)?> and <(INVULNERABLE) = [0]>> then\n                        broadcast (Lose Life v)\n                    end\n                    wait (0.4) seconds\n                    if <<touching (player v)?> and <(INVULNERABLE) = [0]>> then\n                    end\n                    delete this clone\n                else\n                    broadcast (Lose Life v)\n                end\n            end\n        end\n    end\nend\n\nwhen I receive [exit scene v]\ndelete this clone\n\ndefine Move-Down\nchange [speed y v] by (-1)\nchange y by (speed y)\nrepeat until <not <<<touching (level v)?> or <touching (jump through v)?>> or <touching (moving platform v)?>>>\n    change y by (1)\n    set [speed y v] to [0]\nend\n\ndefine Move - Left / Right\nmove (speed) steps\nrepeat (4)\n    if <not <<touching (level v)?> or <touching (_edge_ v)?>>> then\n        if <not <<touching (safe zones v)?> or <touching (moving platform v)?>>> then\n            if <not <touching (jump through v)?>> then\n                set [turn v] to [0]\n                stop [this script v]\n            end\n        end\n    end\n    change y by (1)\nend\nset [turn v] to [1]\nchange y by (-4)\nmove (-2) steps\n\ndefine Touching Player\nif <<([speed y v] of [player v]) < [-3]> and <[0] < (([y position v] of [player v]) - (y position))>> then\n    add (join [defeat] (id)) to [activated/defeated enemies v]\n    set [bounce height v] to [9]\n    broadcast (Player - Bounce v)\n    switch costume to (frog squish2 v)\n    wait (0.3) seconds\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\n    delete this clone\nend\nbroadcast (Lose Life v)\n\ndefine Spawn (type) at (x) (y) dir (dir) speed (speed) id (id)\nif <not <[activated/defeated enemies v] contains (join [defeat] (id))?>> then\n    go to x: (x) y: (y)\n    point in direction (dir)\n    set [id v] to (id)\n    set [speed v] to (speed)\n    switch costume to (type)\n    create clone of (_myself_ v)\n    set [id v] to []\nend\n\nswitch costume to (red squish v)\n\nwhen I receive [main menu v]\ndelete all of [activated/defeated enemies v]\ndelete this clone\n\n\n    if <([x position v] of [player v]) < [0]> then\n        Spawn [Red] at [134] [-143] dir [-90] speed [] id []\n    else\n        Spawn [Red] at [136] [-139] dir [90] speed [] id []\n    end\n    Spawn [Red] at [-2] [107] dir [-90] speed [] id []\n    Spawn [Red] at [-9] [28] dir [-90] speed [] id []\nend\n\n\n\nTouching Player\n\ndelete this clone\n\n\n\nwait (1) seconds\n\nchange [frame v] by (0.33)\nset size to (50) %\nswitch costume to ([floor v] of ((1) + ((frame) mod (4))) )\nset rotation style [don't rotate v]\nMove - Left / Right\nMove-Down\nset rotation style [left-right v]\nif <<(INVULNERABLE) = [0]> and <touching (player v)?>> then\n    Touching Player\nend\nif <<(INVULNERABLE) = [1]> and <(LIVES) = [0]>> then\n    stop [this script v]\nend\nif <(turn) = [1]> then\n    repeat (50)\n        if <<(INVULNERABLE) = [0]> and <touching (player v)?>> then\n            Touching Player\n        end\n    end\n    set [frame v] to [0]\n    repeat (19)\n        change [frame v] by (0.33)\n        switch costume to ([floor v] of ((5) + ((frame) mod (6))) )\n    end\n    set [frame v] to [0]\n    turn right (180) degrees\n    repeat (50)\n        if <<(INVULNERABLE) = [0]> and <touching (player v)?>> then\n            Touching Player\n        end\n    end\nend\n\ndefine Jump (jumps) Times\nset rotation style [left-right v]\nrepeat (jumps)\n    See if jump possible (x position) (y position) (direction)\n    if <(possible) = [1]> then\n        wait (1) seconds\n        switch costume to (frog jump2 v)\n        set [speed y v] to [12]\n        repeat until <<(costume [name v]) = [Frog Jump3]> and <(speed y) = [0]>>\n            Move-Down\n            if <(speed y) < [0]> then\n                switch costume to (frog jump3 v)\n            end\n            change x by (((direction) / (90)) * (5))\n        end\n        Move-Down\n        switch costume to (frog v)\n    end\nend\nwait (1) seconds\nturn right (180) degrees\nwait (1) seconds\n\ndefine See if jump possible (x) (y) (dir)\npoint in direction (dir)\nswitch costume to (frog jump2 v)\nset [speed y v] to [12]\nrepeat until <<(costume [name v]) = [Frog Jump3]> and <(speed y) = [0]>>\n    Move-down2\n    if <(possible) = [3]> then\n        set [possible v] to [0]\n        go to x: (x) y: (y)\n        switch costume to (frog v)\n        stop [this script v]\n    end\n    if <(speed y) < [0]> then\n        switch costume to (frog jump3 v)\n    end\n    change x by (((direction) / (90)) * (5))\nend\nswitch costume to (frog v)\nMove-down2\nif <<<touching (level v)?> or <touching (jump through v)?>> or <<touching (moving platform v)?> or <touching (_edge_ v)?>>> then\n    set [possible v] to [0]\nelse\n    set [possible v] to [1]\nend\ngo to x: (x) y: (y)\nswitch costume to (frog v)\n\ndefine Move-down2\nchange [speed y v] by (-1)\nchange y by (speed y)\nrepeat (([abs v] of (speed y) ) + (5))\n    if <<<touching (level v)?> or <touching (jump through v)?>> or <touching (moving platform v)?>> then\n        change y by (1)\n        set [speed y v] to [0]\n    end\nend\nif <<<touching (level v)?> or <touching (jump through v)?>> or <touching (moving platform v)?>> then\n    set [possible v] to [3]\n    change y by (-5)\nend\n\nturn right (180) degrees\n\nSpawn [Frog] at [182] [-63] dir [-90] speed [] id [test]\n\nwhen I receive [play v]\ndelete all of [activated/defeated enemies v]\ndelete this clone\n\nif <(SCENE #) = [27]> then\n    Spawn [Frog] at [175] [-63] dir [-90] speed [] id [Frog2]\nend\n\ndefine Say: (text) (wait)\nset [letter # v] to [1]\nset [text so far v] to []\nif <(txt to speech?) = [1]> then\n    set [txt to speech say \(enemy\) v] to (text)\n    broadcast (txt2speech \(enemy\) v)\nend\nrepeat (length of (text))\n    set [text so far v] to (join (Text so far) (letter (Letter #) of (text)))\n    say (Text so far)\n    if <<(letter (Letter #) of (text)) = [.]> or <<(letter (Letter #) of (text)) = [!]> or <(letter (Letter #) of (text)) = [?]>>> then\n        wait (0.2) seconds\n    end\n    change [letter # v] by (1)\n    if <(hitboss) = [1]> then\n        say []\n        stop [this script v]\n    end\nend\nif <(wait) = [-2]> then\n    wait (0.5) seconds\n    say []\nelse\n    if <(wait) = [-3]> then\n        wait (2) seconds\n        say []\n    else\n        if <not <(wait) = [-1]>> then\n            wait until <<key (space v) pressed?> or <mouse down?>>\n            say []\n        end\n    end\nend\n\nwhen I receive [txt2speech \(enemy\) v]\nif <(costume [name v]) = [BOSS]> then\n    set voice to (giant v)::tts\n    speak (txt to speech say \(enemy\))::tts\nend\n\nwhen I receive [layer v]\nwait (((length of [back to front sprites v]) - (item # of [ENM] in [back to front sprites v])) / (100)) seconds\ngo to [front v] layer\n\ndefine Spawn a mummy\nswitch costume to (mummy v)\ngo to x: (108) y: (-84)\nset size to (40) %\ncreate clone of (_myself_ v)\nswitch costume to (my costume)\ngo to x: (156) y: (-15)\nset size to (100) %\n\nSpawn [Mummy] at [98] [-79] dir [90] speed [2] id [xxx]\n\ndefine Locate player (dir)\npoint towards (player v)\nif <([abs v] of (([x position v] of [player v]) - (x position)) ) < [30]> then\n    point in direction (dir)\nelse\n    point in direction (((direction) / ([abs v] of (direction) )) * (90))\nend\n\nrepeat (500)\n\n\n\ndefine mummy touching player?\nif <<touching (player v)?> and <(INVULNERABLE) = [0]>> then\n    if <<([speed y v] of [player v]) < [-3]> and <<(([y position v] of [player v]) - (y position)) > [10]> and < (costume [name v]) contains [MummyFall]?>>> then\n        stop [other scripts in sprite v]\n        set [bounce height v] to [9]\n        broadcast (Player - Bounce v)\n        point in direction (90)\n        switch costume to (mummygood v)\n        repeat until <(x position) > [100]>\n            change x by (2)\n        end\n        set [hitboss v] to [1]\n        wait (1) seconds\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n        delete this clone\n    else\n        broadcast (Lose Life v)\n    end\nend\n\nforever\n\ndefine Spawn lightning\nswitch costume to (lightning v)\ngo to x: ([x position v] of [player v]) y: (0)\ncreate clone of (_myself_ v)\nswitch costume to (my costume)\ngo to x: (156) y: (-15)\n\nwhen I start as a clone\nif <(costume [name v]) = [Mummy]> then\n    forever\n        mummy touching player?\n    end\nend\n\nmummy touching player?\n\nSpawn lightning\n\nSpawn a mummy\n\n\n\nwhen I receive [next boss v]\n\nadd [AARGH!] to [responses v]\n\ndelete all of [responses v]\nadd [OW! My toe!] to [responses v]\nadd [Using my henchmen against me? That's not fair!] to [responses v]\nadd [I will destroy you!] to [responses v]\nadd [AARGH! Time to amp it up a notch.] to [responses v]\nadd [You pest! I will smash you like a bug! ] to [responses v]\nadd [STOP IT!] to [responses v]\nadd [uggghh...] to [responses v]\n\nwhen I receive [only 1 boss v]\n\ngo to (random position v)\n\n\n\nwhen I start as a clone\n\nadd [] to [responses v]\nadd [I will destroy you!] to [responses v]\n\nstop [other scripts in sprite v]\n\n\n\nwait (1) seconds\n\nif < (costume [name v]) contains [BOSS]?> then\n    forever\n        if <(hitboss) = [1]> then\n            set [hitboss v] to [0]\n            stop [other scripts in sprite v]\n            next costume\n            say []\n            Say: (item (letter (5) of (costume [name v])) of [responses v]) [-3]\n            set [my costume v] to (costume [name v])\n            switch costume to (d v)\n            broadcast (next boss v)\n        end\n    end\nend\n\nif < (costume [name v]) contains [Kill]?> then\n    switch costume to (my costume)\n    forever\n        if <(hitboss) = [1]> then\n            set [hitboss v] to [0]\n            stop [other scripts in sprite v]\n            next costume\n            say []\n        end\n    end\nend\n\nsay ([abs v] of (([x position v] of [player v]) - (x position)) )\n\nSpawn lightning\nwait (3) seconds\n\ndefine Be boss (wait1) (repeat1) (wait2)\nSay: [By the power of evil...] [-2]\nSay: [I summon MUMMY!] [-2]\nSpawn a mummy\nwait (wait1) seconds\nrepeat (repeat1)\n    Say: [By the power of evil...] [-2]\n    Spawn lightning\n    Say: [I summon LIGHTNING!] [-2]\n    wait (wait2) seconds\nend\n\nwhen I receive [be boss v]\nif <(costume [name v]) = [d]> then\n    switch costume to (my costume)\n    forever\n        if <(costume [name v]) = [BOSS7]> then\n            Say: [Nooooo! After all my efforts, a puny human is the one who banishes me to the underworld?] []\n            Say: [GAAAAH! I will have my revenge! Mark my word!] []\n            Say: [I... will... come back...] []\n            repeat (50)\n                change [ghost v] effect by (2)\n                change [pixelate v] effect by (2)\n            end\n            broadcast (Screen fade v)\n            wait (0.5) seconds\n            wait until <([ghost effect v] of [big screens v]) = [0]>\n            set [able to restart? v] to [0]\n            broadcast (WIN v)\n            delete this clone\n        else\n            if <<<(costume [name v]) = [BOSS4]> or <(costume [name v]) = [BOSS5]>> or <(costume [name v]) = [BOSS6]>> then\n                Be boss [1] [6] [1]\n            else\n                Be boss [3] [3] [3]\n            end\n        end\n    end\nend\n\nforever\n    Say: [By the power of evil...] [-2]\n    Say: [I summon MUMMY!] [-2]\n    Spawn a mummy\n    wait (1) seconds\n    repeat (6)\n        Say: [By the power of evil...] [-2]\n        Spawn lightning\n        Say: [I summon LIGHTNING!] [-2]\n        wait (1) seconds\n    end\nend\n\nforever\n    Say: [By the power of evil...] [-2]\n    Say: [I summon MUMMY!] [-2]\n    Spawn a mummy\n    wait (3) seconds\n    repeat (3)\n        Say: [By the power of evil...] [-2]\n        Spawn lightning\n        Say: [I summon LIGHTNING!] [-2]\n        wait (3) seconds\n    end\nend\n\nswitch costume to (d v)\nbroadcast (next boss v)\n\nforever\n    if <(hitboss) = [1]> then\nend\n\nset [mummy repeat v] to [600]\n\nbroadcast (Normal Music v)\n\nwhen I start as a clone\nif <(costume [name v]) = [Frog]> then\n    forever\n        if <<(INVULNERABLE) = [0]> and <touching (player v)?>> then\n            Touching Player\n        end\n    end\nend\n\nBe boss [1] [6] [1]\n\nwhen I receive [order sprites v]\nOrder sprites by (item # of [ENM] in [back to front sprites v])\n\ndefine Order sprites by (z position)\nset [i v] to [1]\nrepeat until <not <(z position) < (item (i) of [z order v])>>\n    change [i v] by (1)\nend\ninsert (z position) at (i) of [z order v] \ngo [forward v] ((i) - (1)) layers\n\n@Safe Zones\n\nwhen flag clicked\nset [ghost v] effect to (100)\nhide\n\nwhen I receive [play v]\ngo to x: (0) y: (0)\nshow\n\nwhen I receive [change scene v]\nswitch costume to (blank v)\nswitch costume to (join [Scene] (SCENE #))\n\n@Jump through\n\nwhen flag clicked\nhide\n\nwhen I receive [play v]\ngo to x: (0) y: (0)\nshow\n\nbroadcast (Change Scene v)\n\nwhen I receive [change scene v]\nswitch costume to (join [Scene] (SCENE #))\n\nwhen I receive [main menu v]\nhide\n\nwhen I receive [change scene v]\nswitch costume to (blank v)\nswitch costume to (join [Scene] (SCENE #))\nif <not <(costume [name v]) = [Blank]>> then\n    Stamp Outline [3] (SCENE #)\nend\n\ndefine Stamp Outline (thickness) (scene)\nset rotation style [don't rotate v]\nset [brightness v] effect to (-30)\nrepeat ((thickness) * (3))\n    turn right ((360) / ((thickness) * (3))) degrees\n    move (thickness) steps\n    stamp\n    move ((0) - (thickness)) steps\nend\nclear graphic effects\nswitch costume to (join [Scene] (scene))\n\nwhen I receive [layer v]\nwait (((length of [back to front sprites v]) - (item # of [JUMP] in [back to front sprites v])) / (100)) seconds\ngo to [front v] layer\n\ndefine Order sprites by (z position)\nset [i v] to [1]\nrepeat until <not <(z position) < (item (i) of [z order v])>>\n    change [i v] by (1)\nend\ninsert (z position) at (i) of [z order v] \ngo [forward v] ((i) - (1)) layers\n\nwhen I receive [order sprites v]\nOrder sprites by (item # of [JUMP] in [back to front sprites v])\n\n@NPC\n\nwhen flag clicked\nset [clone id v] to [0]\ngo to x: (33) y: (-46)\ndelete all of [shown scenes v]\nset [yes/no quest v] to [0]\nset [name v] to []\nhide\n\nwhen I receive [change scene v]\nif <not <(clone id) = [0]>> then\n    hide\nelse\n    if <(SCENE #) = [4]> then\n        if <not <[shown scenes v] contains [4]?>> then\n            Become: [1]\n            set [ghost v] effect to (0)\n            go to x: (33) y: (-46)\n            show\n            wait until <(distance to [player v]) < [150]>\n            set [control? v] to [0]\n            add [4] to [shown scenes v]\n            wait (1) seconds\n            point in direction (-90)\n            wait (1) seconds\n            Say: [ Hello. I'm Matt. I'll tell you why I summoned you here shortly.                               <space or click to continue>] []\n            Say: [What was your name again?] [-1]\n            ask [What was your name again?] and wait\n            set [name v] to (answer)\n            broadcast (say name v)\n            wait (1) seconds\n        end\n    else\n        if <(SCENE #) = [6]> then\n            if <not <[shown scenes v] contains [6]?>> then\n                Become: [1]\n                go to [front v] layer\n                set [ghost v] effect to (0)\n                go to x: (25) y: (-46)\n                show\n                wait until <(distance to [player v]) < [180]>\n                set [control? v] to [0]\n                add [6] to [shown scenes v]\n                wait (3) seconds\n                Say: [Three days ago, a servant of the evil god, Set, broke in to this museum and stole the amulet of Ra.] []\n                wait (1) seconds\n                point in direction (-90)\n                wait (0.5) seconds\n                Say: [If he delivers it to Set, The evil god will have enough power to control the world.] []\n                Say: [This information is highly confidential. That's why I didn't tell you until now.] []\n                Say: [I'm hoping you will go on a quest to retrieve the amulet. Will you?] [-1]\n                broadcast (yes/no quest v)\n                wait until <<(yes/no quest) = [2]> or <(yes/no quest) = [-2]>>\n                say []\n                wait until <<(yes/no quest) = [1]> or <(yes/no quest) = [-1]>>\n                if <(yes/no quest) = [-1]> then\n                    wait (0.5) seconds\n                    Say: [Ok, well, thanks for coming, at least.] []\n                    broadcast (gameovershow v)\n                    wait (5) seconds\n                    broadcast (Main Menu v)\n                    stop [this script v]\n                else\n                    wait (1) seconds\n                    Say: [Good. As I said earlier, we have no time to waste! Meet me on the helipad in 15 minutes.] []\n                    Say: [Here's a map to help you get there.] []\n                    wait (1) seconds\n                    broadcast (Screen fade v)\n                    wait (0.1) seconds\n                    wait until <([ghost effect v] of [big screens v]) = [0]>\n                    hide\n                end\n            end\n        else\n            if <(SCENE #) = [18]> then\n                hide\n                if <not <[shown scenes v] contains [18]?>> then\n                    wait until <[-200] < ([x position v] of [player v])>\n                    set [control? v] to [0]\n                    add [18] to [shown scenes v]\n                    set [clone id v] to [1]\n                    create clone of (_myself_ v)\n                    set [clone id v] to [0]\n                end\n            else\n                if <(SCENE #) = [20]> then\n                    if <not <[shown scenes v] contains [20]?>> then\n                        add [20] to [shown scenes v]\n                        set [control? v] to [0]\n                        show\n                        go to x: (-100) y: (-48)\n                        Become: [1]\n                        point in direction (-90)\n                        wait (0.1) seconds\n                        wait until <([ghost effect v] of [big screens v]) = [100]>\n                        set [dontmove v] to [0]\n                        broadcast (don't move v)\n                        Say: [It's time for us to part ways. Good luck!] []\n                        broadcast (Screen fade v)\n                        wait (0.1) seconds\n                        wait until <([ghost effect v] of [big screens v]) = [0]>\n                        hide\n                        wait (0.1) seconds\n                        wait until <([ghost effect v] of [big screens v]) = [100]>\n                        set [dontmove v] to [1]\n                        set [control? v] to [1]\n                    end\n                else\n                    if <(SCENE #) = [38]> then\n                        show\n                        set size to (40) %\n                        go to x: (33) y: (-46)\n                        point in direction (-90)\n                        if <not <[shown scenes v] contains [38]?>> then\n                            add [38] to [shown scenes v]\n                            set [control? v] to [0]\n                            wait until <([ghost effect v] of [big screens v]) = [100]>\n                            wait (1) seconds\n                            set [control? v] to [0]\n                            Say: (join [Congratulations, ] (join (name) [!])) []\n                            Say: [You saved the world from Set's rule!] []\n                            Say: [And as a reward, the Egyptian Archeological Society and I have decided to give you...] []\n                            Say: [The Amulet of Ra!] []\n                            Say: [You have proven through your mission that you are more than capable of handling this big of a responsibility.] []\n                            Say: [And I especially trust that you will keep it safe.] []\n                            Say: [Thanks to you, Set is banished to the underworld! You saved us all.] []\n                            wait (1) seconds\n                            set [control? v] to [1]\n                            broadcast (after win mn menu v)\n                            broadcast (Stop Timer v)\n                        end\n                    else\n                        hide\n                    end\n                end\n            end\n        end\n    end\nend\n\nwait (3) seconds\nSay: [Three days ago, a servant of the evil god, Set, broke in to this museum and stole the amulet of Ra.] []\nwait (1) seconds\npoint in direction (-90)\nwait (0.5) seconds\nSay: [If he delivers it to Set, The evil god will have enough power to control the world.] []\nSay: [This information is highly confidential. That's why I didn't tell you until now.] []\nSay: [I'm hoping you will go on a quest to retrieve the amulet. Will you?] [-1]\nbroadcast (yes/no quest v)\nwait until <<(yes/no quest) = [2]> or <(yes/no quest) = [-2]>>\nsay []\nwait until <<(yes/no quest) = [1]> or <(yes/no quest) = [-1]>>\nif <(yes/no quest) = [-1]> then\n    wait (0.5) seconds\n    Say: [Ok, well, thanks for coming, at least.] []\n    broadcast (Game over v)\n    stop [this script v]\nelse\n    wait (1) seconds\n    Say: [Good. As I said earlier, we have no time to waste! Meet me on the helipad in 15 minutes.] []\n    Say: [Here's a map to help you get there.] []\n    wait (1) seconds\n    broadcast (Screen fade v)\n    wait (0.1) seconds\n    wait until <([ghost effect v] of [big screens v]) = [0]>\n    broadcast (Map v)\n    hide\nend\n\ndefine Say: (text) (wait)\nset [letter # v] to [1]\nset [text so far v] to []\nif <(txt to speech?) = [1]> then\n    set [txt to speech say: v] to (text)\n    broadcast (Text to speech v)\nend\nrepeat (length of (text))\n    set [text so far v] to (join (Text so far) (letter (Letter #) of (text)))\n    say (Text so far)\n    if <<(letter (Letter #) of (text)) = [.]> or <<(letter (Letter #) of (text)) = [!]> or <(letter (Letter #) of (text)) = [?]>>> then\n        wait (0.2) seconds\n    end\n    change [letter # v] by (1)\nend\nif <not <(wait) = [-1]>> then\n    wait until <<key (space v) pressed?> or <mouse down?>>\n    say []\nend\n\nwhen I receive [said name v]\nSay: (join (join [Okay, ] (answer)) [. I'm happy to finally meet you.]) []\nSay: [It must've been a long journey, but there's no time to waste!] []\nSay: [Meet me in the Egyptian Artifacts section when you're ready. It's right behind me.] []\npoint in direction (90)\nwait (2) seconds\npoint in direction (-90)\nwait (1) seconds\nSay: [Uh oh- I lost my key somewhere! You'll have to find it, because the Egyptian artifacts section is for employees only.] []\nSay: [I think I left it somewhere around the dinosaurs...] []\nSay: [It'll be around here somewhere. Good luck!] []\nbroadcast (Screen fade v)\nwait (0.1) seconds\nwait until <([ghost effect v] of [big screens v]) = [0]>\nhide\n\nwhen I receive [main menu v]\ndelete all of [shown scenes v]\ndelete all of [opened doors v]\nhide\n\nwhen I receive [play v]\ndelete all of [shown scenes v]\ndelete all of [opened doors v]\nhide\n\nwhen I receive [give key v]\n\nset [ghost v] effect to (0)\ngo to x: (25) y: (-46)\npoint in direction (90)\nshow\n\nwhen I start as a clone\nif <(clone id) = [1]> then\n    set size to (100) %\n    point in direction (90)\n    hide\n    wait (3) seconds\n    go to x: (144) y: (246)\n    switch costume to (helicopter v)\n    show\n    glide (5) secs to x: (28) y: (83)\n    wait (1) seconds\n    glide (3) secs to x: (28) y: (-15)\n    broadcast (out of helicopter v)\nend\n\nwhen I receive [out of helicopter v]\nif <(clone id) = [0]> then\n    Become: [1]\n    wait (2) seconds\n    point in direction (-90)\n    go to x: (1) y: (-83)\n    show\n    wait (1) seconds\n    Say: [Good! You found your way here.] []\n    Say: [Our thief has fled to the Egyptian Rainforest, a place filled with water, wildlife, and lots of danger.] []\n    Say: [Are you ready? Then let's go!] []\n    wait (1) seconds\n    broadcast (Screen fade v)\n    wait (0.1) seconds\n    wait until <([ghost effect v] of [big screens v]) = [0]>\n    change [scene # v] by (1)\n    broadcast (changescene2 v)\n    broadcast (Destroy Clones v)\n    set rotation style [all around v]\n    switch backdrop to (blue sky 2 2 v)\n    go to x: (0) y: (-38)\n    set size to (100) %\n    switch costume to (helicopter2 v)\n    point in direction (95)\n    show\n    set [up down v] to [0]\n    repeat until <([ghost effect v] of [big screens v]) = [50]>\n        change y by (([sin v] of ((up down) * (3)) ) * (2))\n        turn left (([sin v] of (((up down) + (20)) * (3)) ) * (0.5)) degrees\n        change [up down v] by (1)\n    end\n    forever\n        change y by (([sin v] of ((up down) * (3)) ) * (2))\n        turn left (([sin v] of (((up down) + (20)) * (3)) ) * (0.5)) degrees\n        change [up down v] by (1)\n    end\nend\n\nwhen I receive [destroy clones v]\ndelete this clone\n\nset rotation style [left-right v]\n\nwait (0.1) seconds\n\ndefine Become: (what)\nif <(what) = [1]> then\n    switch costume to (costume1 v)\n    set size to (40) %\n    point in direction (90)\n    set rotation style [left-right v]\nend\n\nforever\n    say ([ghost effect v] of [big screens v])\nend\n\nwhen I receive [hide helicopter v]\nswitch backdrop to (jungle v)\nstop [other scripts in sprite v]\nset [scene # v] to [20]\nbroadcast (Change Scene v)\n\nset [clone id v] to [1]\ncreate clone of (_myself_ v)\nset [clone id v] to [0]\n\nrepeat (10)\n\nrepeat until <[] = [50]>\n\nwhen I receive [don't move v]\nrepeat until <(dontmove) = [1]>\n    set [control? v] to [0]\nend\n\nwhen I receive [text to speech v]\nset voice to (tenor v)::tts\nspeak (txt to speech say:)::tts\n\nSay: [Hello. I'm Matt.] []\n\nset voice to (tenor v)::tts\nspeak [Hello. I'm Matt.]::tts\n\nwhen I receive [layer v]\nwait (((length of [back to front sprites v]) - (item # of [NPC] in [back to front sprites v])) / (100)) seconds\ngo to [front v] layer\n\nSay: (join (join [You beat the game with ] (Artifacts)) [ artifacts.]) []\n\nbroadcast (Stop Timer v)\n\nwhen I receive [order sprites v]\nOrder sprites by (item # of [NPC] in [back to front sprites v])\n\ndefine Order sprites by (z position)\nset [i v] to [1]\nrepeat until <not <(z position) < (item (i) of [z order v])>>\n    change [i v] by (1)\nend\ninsert (z position) at (i) of [z order v] \ngo [forward v] ((i) - (1)) layers\n\n@Non-level fg\n\nwhen flag clicked\nswitch costume to (blank v)\n\nwhen I receive [change scene v]\nset [ghost v] effect to (0)\nswitch costume to (blank v)\nswitch costume to (join [Scene] (SCENE #))\nif <not <(costume [name v]) = [Blank]>> then\n    forever\n        if <touching (player v)?> then\n            repeat (10)\n                change [ghost v] effect by (10)\n            end\n            wait until <not <touching (player v)?>>\n            repeat (10)\n                change [ghost v] effect by (-10)\n            end\n        end\n    end\nend\n\nif <(SCENE #) = [5]> then\n    wait until <[opened doors v] contains [Key 1]?>\nend\n\n\n    switch costume to (scene.1 v)\nend\n\nwhen I receive [layer v]\nwait (((length of [back to front sprites v]) - (item # of [NLF] in [back to front sprites v])) / (100)) seconds\ngo to [front v] layer\n\ndefine Order sprites by (z position)\nset [i v] to [1]\nrepeat until <not <(z position) < (item (i) of [z order v])>>\n    change [i v] by (1)\nend\ninsert (z position) at (i) of [z order v] \ngo [forward v] ((i) - (1)) layers\n\nwhen I receive [order sprites v]\nOrder sprites by (item # of [NLF] in [back to front sprites v])\n\n@Non-level bg\n\nwhen flag clicked\nswitch costume to (blank v)\n\nwhen I receive [change scene v]\nset [ghost v] effect to (0)\nswitch costume to (blank v)\nswitch costume to (join [Scene] (SCENE #))\n\nif <(SCENE #) = [5]> then\n    wait until <[opened doors v] contains [Key 1]?>\nend\n\n\n    switch costume to (scene.1 v)\nend\n\nwhen I receive [layer v]\nwait (((length of [back to front sprites v]) - (item # of [NLB] in [back to front sprites v])) / (100)) seconds\ngo to [front v] layer\n\ndefine Order sprites by (z position)\nset [i v] to [1]\nrepeat until <not <(z position) < (item (i) of [z order v])>>\n    change [i v] by (1)\nend\ninsert (z position) at (i) of [z order v] \ngo [forward v] ((i) - (1)) layers\n\nwhen I receive [order sprites v]\nOrder sprites by (item # of [NLB] in [back to front sprites v])\n\n@Yes/no quest\n\nwhen flag clicked\ngo to x: (0) y: (-129)\nhide\n\nwhen I receive [yes/no quest v]\nshow\nset size to (100) %\nforever\n    repeat (100)\n        change size by (0.1)\n    end\n    repeat (100)\n        change size by (-0.1)\n    end\nend\n\nwhen this sprite clicked\nset volume to (Sound fx vol) %\nstart sound [pop v]\nif <(mouse x) < [0]> then\n    set [yes/no quest v] to [2]\n    broadcast (say answer v)\n    hide\nelse\n    set [yes/no quest v] to [-2]\n    broadcast (say answer v)\n    hide\nend\n\nwhen I receive [main menu v]\nhide\n\nwhen I receive [layer v]\nwait (((length of [back to front sprites v]) - (item # of [YNQ] in [back to front sprites v])) / (100)) seconds\ngo to [front v] layer\n\nwhen I receive [order sprites v]\nOrder sprites by (item # of [YNQ] in [back to front sprites v])\n\ndefine Order sprites by (z position)\nset [i v] to [1]\nrepeat until <not <(z position) < (item (i) of [z order v])>>\n    change [i v] by (1)\nend\ninsert (z position) at (i) of [z order v] \ngo [forward v] ((i) - (1)) layers\n\n@Dark\n\nwhen flag clicked\nset [dark v] to [0]\nhide\n\nwhen I receive [on flash v]\nwait (1) seconds\nswitch costume to (costume1 v)\nshow\nforever\n    go to (player v)\nend\n\nwhen I receive [change scene v]\nif <<(SCENE #) = [8]> and <(dark) = [0]>> then\n    wait until <([y position v] of [player v]) < [-40]>\n    wait (1) seconds\n    set [control? v] to [0]\n    switch costume to (costume2 v)\n    set [ghost v] effect to (0)\n    show\n    wait (0.5) seconds\n    hide\n    wait (0.2) seconds\n    show\n    wait (0.2) seconds\n    hide\n    wait (0.2) seconds\n    show\n    wait (0.5) seconds\n    hide\n    wait (1) seconds\n    set [ghost v] effect to (100)\n    show\n    repeat (10)\n        change [ghost v] effect by (-10)\n    end\n    broadcast (lights out v)\n    set [dark v] to [1]\nend\nif <(SCENE #) = [16]> then\n    show\n    set [dark v] to [1]\nend\nif <(SCENE #) = [17]> then\n    hide\n    set [dark v] to [0]\nend\n\nhide\n\nwhen [e v] key pressed\nif <[collected v] contains [Map 1]?> then\n    if <([show v] of [big screens v]) = [1]> then\n    end\nend\n\ngo [backward v] (2) layers\n\nwhen I receive [hide popup v]\nif <(dark) = [1]> then\nend\n\ngo to [front v] layer\n\nset [acceleration v] to [0]\n\nset [control? v] to [1]\n\ngo [forward v] (6) layers\n\nwhen I receive [layer v]\nwait (((length of [back to front sprites v]) - (item # of [DRK] in [back to front sprites v])) / (100)) seconds\ngo to [front v] layer\n\nwhen I receive [order sprites v]\nOrder sprites by (item # of [DRK] in [back to front sprites v])\n\ndefine Order sprites by (z position)\nset [i v] to [1]\nrepeat until <not <(z position) < (item (i) of [z order v])>>\n    change [i v] by (1)\nend\ninsert (z position) at (i) of [z order v] \ngo [forward v] ((i) - (1)) layers\n\n@Popup mini\n\nwhen flag clicked\nset [popup mini do v] to []\ngo to x: (0) y: (0)\nhide\n\nwhen I receive [game over v]\nhide\nset [id v] to [1]\ndelete this clone\n\nwhen I receive [main menu v]\nhide\n\nwhen this sprite clicked\nset volume to (Sound fx vol) %\nstart sound [pop v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\nset [popup mini do v] to []\n\nwhen I receive [popup mini v]\nif <(id) = [1]> then\n    set [id v] to [0]\n    set [ghost v] effect to (100)\n    switch costume to (popup mini do)\n    create clone of (_myself_ v)\n    if <(SCENE #) = [1]> then\n        switch costume to (2 v)\n        create clone of (_myself_ v)\n    end\n    set [id v] to [1]\nend\n\nwhen I receive [change scene v]\nhide\n\nforever\n\nwhen I receive [start game v]\nset [id v] to [1]\ndelete this clone\n\nwait (3) seconds\n\nwhen I start as a clone\nshow\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\n\nwhen [space v] key pressed\n\ngo to (random position v)\n\nwhen I receive [layer v]\nwait (((length of [back to front sprites v]) - (item # of [PUM] in [back to front sprites v])) / (100)) seconds\ngo to [front v] layer\n\nwhen I receive [order sprites v]\nOrder sprites by (item # of [PUM] in [back to front sprites v])\n\ndefine Order sprites by (z position)\nset [i v] to [1]\nrepeat until <not <(z position) < (item (i) of [z order v])>>\n    change [i v] by (1)\nend\ninsert (z position) at (i) of [z order v] \ngo [forward v] ((i) - (1)) layers\n\nswitch costume to (6 v)\ncreate clone of (_myself_ v)\n\n@Invisible level\n\nwhen flag clicked\nswitch costume to (scene1 v)\nerase all\nhide\n\nwhen I receive [play v]\ngo to x: (0) y: (0)\nset [ghost v] effect to (100)\n\nwhen I receive [change scene v]\nshow\nswitch costume to (blank v)\nswitch costume to (join [Scene] (SCENE #))\n\nwhen I receive [main menu v]\nerase all\nhide\n\ndefine Stamp Shadow\nset [brightness v] effect to (-10)\nset [ghost v] effect to (90)\nchange y by (-20)\nstamp\nchange y by (20)\nclear graphic effects\n\ndefine Stamp Outline (thickness) (scene)\nif <<(scene) = [Scene1]> or <<(scene) = [Scene3]> or >> then\n    switch costume to (scene0.5 v)\nend\nif <(scene) = [Scene5]> then\n    switch costume to (scene5.5 v)\nend\nset rotation style [don't rotate v]\nset [brightness v] effect to (-30)\nrepeat ((thickness) * (3))\n    turn right ((360) / ((thickness) * (3))) degrees\n    move (thickness) steps\n    stamp\n    move ((0) - (thickness)) steps\nend\nclear graphic effects\nswitch costume to (scene)\n\nwhen I receive [changescene2 v]\nswitch costume to (join [Scene] (SCENE #))\nerase all\n\nStamp Outline [4] (costume [name v])\n\nwhen I receive [layer v]\nwait (((length of [back to front sprites v]) - (item # of [INV] in [back to front sprites v])) / (100)) seconds\ngo to [front v] layer\n\ndefine Order sprites by (z position)\nset [i v] to [1]\nrepeat until <not <(z position) < (item (i) of [z order v])>>\n    change [i v] by (1)\nend\ninsert (z position) at (i) of [z order v] \ngo [forward v] ((i) - (1)) layers\n\nwhen I receive [order sprites v]\nOrder sprites by (item # of [INV] in [back to front sprites v])\n\n@Achievements\n\nwhen flag clicked\ngo to x: (-204) y: (-140)\nhide\n\nwhen this sprite clicked\nbroadcast (Achievements v)\nswitch costume to (costume1 v)\nswitch backdrop to (achievements v)\nhide\n\nwhen I receive [settings v]\nhide\n\nwhen I receive [how to play v]\nhide\n\nwhen I receive [main menu v]\n\nshow\nset size to (10) %\nforever\n    if <touching (mouse-pointer v)?> then\n        change size by ((0.2) * ((90) - (size)))\n    else\n        change size by ((0.2) * ((80) - (size)))\n    end\nend\n\nshow\n\nwhen I receive [play v]\nhide\n\n@Achievements2\n\nwhen flag clicked\nclone\n\nwhen I receive [achievements v]\nif <not <(costume [name v]) = [Blank]>> then\n    show\nend\n\nwhen I receive [main menu v]\nhide\n\nforever\n\nswitch costume to (costume1 v)\n\nswitch costume to (costume2 v)\nset [sound fx vol v] to [100]\n\nswitch costume to (costume2 v)\n\nswitch costume to (costume2 v)\nset [sound fx vol v] to [100]\n\nif <[] = [1]> then\n    switch costume to (costume2 v)\n    set [sound fx vol v] to [100]\nend\n\nswitch costume to ((costume [number v]) - (1))\n\nnext costume\n\nwhen I start as a clone\n\nnext costume\n\ndefine Do assignment\nif <((costume [number v]) mod (2)) = [0]> then\n\nwhen this sprite clicked\nDo assignment\n\ndefine clone\nhide\ngo to x: (0) y: (0)\nswitch costume to (costume2 v)\nrepeat (5)\n    create clone of (_myself_ v)\n    next costume\n    next costume\nend\nswitch costume to (blank v)\n\n@THUMB\n\nwhen flag clicked\nhide\n\n@Sprite2\n\nwhen I receive [order sprites v]\nOrder sprites by []\n\ndefine Order sprites by (z position)\nset [i v] to [1]\nrepeat until <not <(z position) < (item (i) of [z order v])>>\n    change [i v] by (1)\nend\ninsert (z position) at (i) of [z order v] \ngo [forward v] ((i) - (1)) layers\n\ndelete all of [z order v]\nbroadcast (Order Sprites v)\n\n@control stick\n\nwhen flag clicked\nhide\ngo to [front v] layer\nset [base sprite v] to [control stick]\nset size to (100) %\nset [max stick v] to ((size) / (5))\nswitch costume to (base v)\nset [ghost v] effect to (50)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nswitch costume to (stick v)\ngo [forward v] (1) layers\nset [ghost v] effect to (25)\nforever\n    set [stick power v] to []\n    set [stick x v] to [0]\n    set [stick y v] to [0]\n    repeat until <mouse down?>\n        go to (base sprite)\n    end\n    if <(distance to [mouse-pointer v]) < ((size) * (0.4))> then\n        stick drag\n    else\n        wait until <not <mouse down?>>\n    end\nend\n\ndefine stick drag\nrepeat until <not <mouse down?>>\n    go to (mouse-pointer v)\n    point towards (base sprite)\n    turn right (180) degrees\n    set [stick direction v] to (direction)\n    set [stick power v] to (distance to [(base sprite) v])\n    if <(max stick) < (stick power)> then\n        move ((max stick) - (stick power)) steps\n        set [stick power v] to (max stick)\n    end\n    set [stick power v] to ((stick power) / (max stick))\n    set [stick x v] to ((stick power) * ([sin v] of (stick direction) ))\n    set [stick y v] to ((stick power) * ([cos v] of (stick direction) ))\nend\n\nadd [Joy1] to [activated/defeated enemies v]\nadd [Joy2] to [activated/defeated enemies v]\n\nwhen I receive [order sprites v]\nif <(costume [number v]) = [1]> then\n    Order sprites by [8]\nelse\n    Order sprites by [7]\nend\n\ndefine Order sprites by (z position)\nset [i v] to [1]\nrepeat until <not <(z position) < (item (i) of [z order v])>>\n    change [i v] by (1)\nend\ninsert (z position) at (i) of [z order v] \ngo [forward v] ((i) - (1)) layers\n\nwhen I receive [play v]\nshow\n\nwhen I receive [after win mn menu v]\nhide\n\n