Light Knight

Instructions: Instructions are in the game.\n\nArrow keys to move, SPACE to speak. Talk to characters to trigger events.\n\nWhat do you guys think of the character and concept? If you like it, I can probably make Light Knight 2...

@Stage\n\nwhen flag clicked\nset volume to (100) %\nswitch backdrop to (start v)\nwait (3) seconds\nforever\n    play sound [Fight v] until done\nend\n\nwhen I receive [win2 v]\nstop [other scripts in stage v]\nset volume to (90) %\nforever\n    play sound [The Future Retro v] until done\nend\n\nwhen I receive [start v]\nswitch backdrop to (wall v)\nstop [other scripts in stage v]\nforever\n    play sound [Adventure2 v] until done\nend\n\nwhen I receive [win1 v]\nset volume to (10) %\n\nwhen I receive [win2 v]\n\n@Player\n\nwhen flag clicked\nhide\n\nwhen flag clicked\ngo to [front v] layer\ngo [backward v] (1) layers\npoint in direction (90)\nforever\n    go to (sense v)\nend\n\nwhen I receive [start v]\nswitch costume to (1 v)\nshow\nforever\n    if <(Move?) = [yes]> then\n        if <key (left arrow v) pressed?> then\n            point in direction (-90)\n        end\n        if <key (right arrow v) pressed?> then\n            point in direction (90)\n        end\n    end\nend\n\nwhen I start as a clone\npoint in direction (90)\ngo to [front v] layer\nswitch costume to (space v)\nshow\nforever\n    if <(clone) = [1]> then\n        go to (sense v)\n        show\n    else\n        set [clone v] to [0]\n        delete this clone\n    end\nend\n\nwhen flag clicked\nset [clone v] to [0]\nforever\n    if <(Level:) = [28]> then\n        if <<(x position) < [108]> and <(x position) > [-38]>> then\n            if <[items: v] contains [bean]?> then\n                set [clone v] to [1]\n                create clone of (_myself_ v)\n                wait until <not <<(Level:) = [28]> and <<[items: v] contains [bean]?> and <<(x position) < [108]> and <(x position) > [-38]>>>>>\n                set [clone v] to [0]\n            end\n        end\n    end\n    if <touching (character v)?> then\n        if <(Move?) = [yes]> then\n            set [clone v] to [1]\n            create clone of (_myself_ v)\n            wait until <not <<(Move?) = [yes]> and <touching (character v)?>>>\n            set [clone v] to [0]\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Level:) = [28]> then\n        if <(clone) = [1]> then\n            if <key (space v) pressed?> then\n                broadcast (plant bean v)\n                stop [this script v]\n            end\n        end\n    end\nend\n\n@Sense\n\nchange y by (1)\n\nwhen flag clicked\nhide\ngo to x: (-160) y: (-113)\n\nwait (0.2) seconds\n\nchange y by (5)\n\nset [move? v] to [yes]\n\nset [xv v] to ((Xv) * (-1))\n\nif <(Level:) = ([costume # v] of [land v])> then\nend\n\nwhen [up arrow v] key pressed\n\nwhen flag clicked\nforever\n    if <touching (obstacles v)?> then\n        go to (player spawn v)\n        set [yv v] to [0]\n    end\n    if <touching (obstacles2 v)?> then\n        go to (player spawn v)\n        set [yv v] to [0]\n    end\nend\n\nset [move? v] to [no]\n\nwhen I receive [start v]\nset [move? v] to [yes]\ngo to x: (-160) y: (-112)\nshow\nset [ghost v] effect to (100)\nset [xv v] to [0]\nset [yv v] to [0]\nforever\n    if <not <touching (ladder v)?>> then\n        change [yv v] by (-1)\n    end\n    if <(Move?) = [yes]> then\n        if <key (right arrow v) pressed?> then\n            change [xv v] by (4)\n        end\n        if <key (left arrow v) pressed?> then\n            change [xv v] by (-4)\n        end\n        change x by (Xv)\n        if <touching (land v)?> then\n            change y by (1)\n            if <touching (land v)?> then\n                change y by (1)\n                if <touching (land v)?> then\n                    change y by (1)\n                    if <touching (land v)?> then\n                        change y by (1)\n                        if <touching (land v)?> then\n                            change y by (1)\n                            if <touching (land v)?> then\n                                change y by (1)\n                                if <touching (land v)?> then\n                                    change x by ((Xv) * (-1))\n                                    change x by (1)\n                                    change y by (-6)\n                                    change x by (-1)\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n        if <touching (key/door v)?> then\n            change x by ((Xv) * (-1))\n        end\n        set [xv v] to ((Xv) * (0.4))\n    end\n    change y by (Yv)\n    if <touching (land v)?> then\n        if <([costume # v] of [land v]) = (Level:)> then\n            change y by ((Yv) * (-1))\n            set [yv v] to [0]\n        end\n    end\n    change y by (-1)\n    if <(Move?) = [yes]> then\n        if <key (up arrow v) pressed?> then\n            if <not <touching (ladder v)?>> then\n                if <touching (land v)?> then\n                    change y by (1)\n                    if <not <touching (land v)?>> then\n                        set [yv v] to [15]\n                    end\n                end\n            end\n        end\n    end\n    if <touching (ladder v)?> then\n        if <key (up arrow v) pressed?> then\n            change y by (5)\n            if <touching (land v)?> then\n                change y by (-5)\n            end\n            set [yv v] to [15]\n        end\n    end\n    if <key (down arrow v) pressed?> then\n        if <touching (ladder v)?> then\n            change y by (-5)\n            if <touching (land v)?> then\n                change y by (5)\n            end\n        end\n    end\n    if <touching (ladder v)?> then\n        set [yv v] to [0]\n    end\n    change y by (1)\nend\n\nwhen flag clicked\nforever\n    if <(Level:) = [33]> then\n        set [move? v] to [no]\n        stop [other scripts in sprite v]\n        go to x: (-160) y: (-114)\n        glide (1) secs to x: (0) y: (-114)\n        wait (1) seconds\n        broadcast (win1 v)\n        stop [this script v]\n    end\nend\n\nwhen flag clicked\nforever\n    if <(x position) > [235]> then\n        broadcast (next v)\n        change [level: v] by (1)\n        go to x: (-210) y: (y position)\n        wait until <([costume # v] of [land v]) = (Level:)>\n    end\nend\n\nwhen flag clicked\nforever\n    if <(x position) < [-241]> then\n        if <(Level:) > [1]> then\n            broadcast (back v)\n            change [level: v] by (-1)\n            go to x: (210) y: (y position)\n            wait until <([costume # v] of [land v]) = (Level:)>\n        end\n    end\nend\n\nrepeat (5)\nend\n\nbroadcast (next v)\nchange [level: v] by (1)\ngo to x: (-210) y: (y position)\nwait until <([costume # v] of [land v]) = (Level:)>\n\nbroadcast (back v)\nchange [level: v] by (-1)\ngo to x: (210) y: (y position)\nwait until <([costume # v] of [land v]) = (Level:)>\n\n@Player Spawn\n\nwhen I receive [start v]\nshow\n\nwhen I receive [next v]\ngo to (player v)\nset x to (-245)\nset x to (-190)\nwait until <touching (land v)?>\n\nwhen I receive [back v]\ngo to (player v)\nwait (0.1) seconds\nset x to (245)\nset x to (190)\nwait until <touching (land v)?>\n\nwhen flag clicked\nforever\n    repeat until <touching (land v)?>\n        change y by (-1)\n    end\nend\n\nwhen flag clicked\nset [ghost v] effect to (100)\nhide\n\n@Land\n\nwhen flag clicked\nset [level: v] to [0]\nhide\ngo to x: (0) y: (0)\n\nwhen I receive [start v]\nset [elevation: v] to [1]\nset [level: v] to [1]\nshow\nforever\n    switch costume to (Level:)\n    if <not <(Level:) = (costume [number v])>> then\n        switch costume to (Level:)\n    end\nend\n\n@Dark\n\nwhen flag clicked\nhide\n\nwhen flag clicked\nforever\n    go to (player v)\n    switch costume to (2 v)\n    if <<(costume [number v]) = [1]> and <(size) < [200]>> then\n        set size to (200) %\n        switch costume to (4 v)\n    end\nend\n\nwhen I receive [win2 v]\nstop [other scripts in sprite v]\nforever\n    switch costume to (3 v)\n    set [ghost v] effect to (99)\n    go to x: (0) y: (0)\nend\n\nwhen I receive [next v]\ngo to x: (-210) y: (y position)\ngo to (player v)\n\nwhen I receive [back v]\ngo to (player v)\n\nwhen flag clicked\nforever\nend\n\nwhen I receive [start v]\nshow\n\ngo to x: (210) y: (y position)\n\nwait until \n\nif <not <([costume # v] of [land v]) = (Level:)>> then\nend\n\nwhen flag clicked\n\nbroadcast (next v)\nchange [level: v] by (1)\n\nset [brightness v] effect to (0)\n\nwait until <([costume # v] of [land v]) = (Level:)>\ngo to x: (-210) y: (y position)\nset [brightness v] effect to (0)\n\nwhen flag clicked\n\nswitch costume to (3 v)\ngo to [front v] layer\ngo to x: (0) y: (0)\n\nswitch costume to (3 v)\ngo to [front v] layer\ngo to x: (0) y: (0)\n\nforever\n    if <(x position) > [240]> then\n    end\nend\n\nforever\n    if <(x position) < [-241]> then\n    end\nend\n\ngo to (player v)\n\n@Play\n\nwhen flag clicked\ngo to x: (38) y: (-76)\nshow\nset [ghost v] effect to (100)\nrepeat until <key (space v) pressed?>\n    repeat (20)\n        change [ghost v] effect by (-5)\n    end\n    repeat (20)\n        change [ghost v] effect by (5)\n    end\nend\n\nwhen I receive [start v]\nhide\n\nwhen flag clicked\nforever\n    if <key (space v) pressed?> then\n        broadcast (Start v)\n        stop [this script v]\n    end\nend\n\n@Key/Door\n\nwhen flag clicked\nforever\n    hide\n    if <(Level:) = [6]> then\n        if <[errands: v] contains [key1]?> then\n            if <not <[items: v] contains [key1]?>> then\n                switch costume to (key v)\n                go to x: (-185) y: (73)\n                show\n                if <touching (player v)?> then\n                    hide\n                    add [key1] to [items: v]\n                end\n            end\n        end\n    end\n    if <(Level:) = [15]> then\n        if <[errands: v] contains [key2]?> then\n            if <not <[items: v] contains [key2]?>> then\n                switch costume to (key v)\n                go to x: (-126) y: (136)\n                show\n                if <touching (player v)?> then\n                    hide\n                    add [key2] to [items: v]\n                end\n            end\n        end\n    end\n    if <(Level:) = [29]> then\n        if <[errands: v] contains [key3]?> then\n            if <not <[items: v] contains [key3]?>> then\n                switch costume to (big key v)\n                go to x: (-126) y: (-60)\n                show\n                if <touching (player v)?> then\n                    hide\n                    add [key3] to [items: v]\n                end\n            end\n        end\n    end\n    if <(Level:) = [9]> then\n        show\n        switch costume to (gate v)\n        if <[items: v] contains [gate1]?> then\n            wait (1) seconds\n            go to x: (150) y: (200)\n        end\n    end\n    if <(Level:) = [20]> then\n        show\n        switch costume to (gate v)\n        if <[items: v] contains [gate2]?> then\n            wait (1) seconds\n            go to x: (150) y: (200)\n        end\n    end\n    if <(Level:) = [32]> then\n        show\n        switch costume to (big gate v)\n        if <[items: v] contains [gate3]?> then\n            wait (1) seconds\n            go to x: (150) y: (200)\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Level:) = [9]> then\n        if <not <[items: v] contains [gate1]?>> then\n            go to x: (150) y: (15)\n        end\n        if <[items: v] contains [gate1]?> then\n            glide (0.5) secs to x: (150) y: (200)\n            stop [this script v]\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Level:) = [20]> then\n        if <not <[items: v] contains [gate2]?>> then\n            go to x: (150) y: (15)\n        end\n        if <[items: v] contains [gate2]?> then\n            glide (0.5) secs to x: (150) y: (200)\n            stop [this script v]\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Level:) = [32]> then\n        if <not <[items: v] contains [gate3]?>> then\n            go to x: (150) y: (15)\n        end\n        if <[items: v] contains [gate3]?> then\n            glide (0.5) secs to x: (150) y: (200)\n            stop [this script v]\n        end\n    end\nend\n\nwait until <([costume # v] of [land v]) = (Level:)>\n\n@Obstacles\n\nwhen flag clicked\nhide\ngo to x: (0) y: (0)\ndelete (all) of [levels with obstacles v]\n\nwhen I receive [start v]\nswitch costume to ((1) - (1))\n\nwhen I receive [back v]\nif <[levels with obstacles v] contains ((Level:) - (-1))?> then\n    switch costume to ((costume [number v]) - (1))\nend\nforever\n    hide\n    if <[levels with obstacles v] contains (Level:)?> then\n        go to x: (0) y: (0)\n        show\n        stop [this script v]\n    end\nend\n\nwhen I receive [back v]\nif <not <[levels with obstacles v] contains (Level:)?>> then\n    repeat (10)\n        hide\n    end\nend\n\nwhen I receive [start v]\nadd [3] to [levels with obstacles v]\nadd [4] to [levels with obstacles v]\nadd [7] to [levels with obstacles v]\nadd [8] to [levels with obstacles v]\nadd [11] to [levels with obstacles v]\nadd [14] to [levels with obstacles v]\nadd [15] to [levels with obstacles v]\nadd [18] to [levels with obstacles v]\nadd [21] to [levels with obstacles v]\nadd [22] to [levels with obstacles v]\nadd [24] to [levels with obstacles v]\nadd [27] to [levels with obstacles v]\nadd [29] to [levels with obstacles v]\nadd [30] to [levels with obstacles v]\n\nwhen I receive [next v]\nif <not <[levels with obstacles v] contains (Level:)?>> then\n    repeat (10)\n        hide\n    end\nend\n\nwhen I receive [next v]\nif <[levels with obstacles v] contains (Level:)?> then\n    next costume\nend\nforever\n    hide\n    if <[levels with obstacles v] contains (Level:)?> then\n        go to x: (0) y: (0)\n        show\n        stop [this script v]\n    end\nend\n\n@Obstacles2\n\nwhen flag clicked\nhide\n\nwhen I receive [start v]\nforever\n    hide\n    if <(Level:) = [13]> then\n        set size to (80) %\n        show\n        set y to (-100)\n    end\n    if <(Level:) = [17]> then\n        set size to (100) %\n        show\n        set y to (10)\n    end\n    if <(Level:) = [23]> then\n        set size to (100) %\n        show\n        set y to (150)\n    end\n    if <(Level:) = [25]> then\n        set size to (100) %\n        set y to (37)\n        show\n    end\n    if <(Level:) = [30]> then\n        set size to (100) %\n        switch costume to (spiky boi2 v)\n        set y to (85)\n        clear graphic effects\n        show\n    end\nend\n\ndefine spike ball\nif <not <(Level:) = [30]>> then\n    switch costume to (spiky boi v)\nend\ngo to x: (120) y: (y position)\nrepeat (52)\n    turn right (-5) degrees\n    change x by (-5)\nend\nrepeat (52)\n    turn right (5) degrees\n    change x by (5)\nend\n\nwhen I receive [start v]\nspike ball\nforever\n    if <(Level:) = [13]> then\n        spike ball\n    end\n    if <(Level:) = [17]> then\n        spike ball\n        go to x: (120) y: (y position)\n    end\n    if <(Level:) = [23]> then\n        swing thing\n    end\n    if <(Level:) = [25]> then\n        throw\n    end\n    if <(Level:) = [30]> then\n        spike ball\n        go to x: (120) y: (y position)\n    end\n    clear graphic effects\nend\n\ndefine throw\nset [ghost v] effect to (0)\nswitch costume to (throwy boi v)\ngo to x: (-85) y: (y position)\nshow\nrepeat (15)\n    turn right (15) degrees\n    change x by (10)\nend\nhide\ngo to x: (-85) y: (y position)\nset [ghost v] effect to (100)\nwait (0.5) seconds\n\nwhen I receive [next v]\nforever\n    if <(Level:) = [30]> then\n        go to x: (x position) y: (y position)\n    end\nend\n\ndefine swing thing\nswitch costume to (swingyboi v)\npoint in direction (90)\nset x to (0)\nrepeat (30)\n    turn right (3) degrees\nend\nrepeat (60)\n    turn left (3) degrees\nend\nrepeat (30)\n    turn right (3) degrees\nend\n\nif <(Level:) = [30]> then\n    repeat (52)\n        turn right (-5) degrees\n        change x by (-5)\n    end\n    repeat (52)\n        turn right (5) degrees\n        change x by (5)\n    end\n    go to x: (120) y: (y position)\nend\n\n@Ladder\n\nwhen flag clicked\nrepeat (10)\n    hide\nend\nforever\n    if <(Level:) = [3]> then\n        switch costume to (ladder-long v)\n        show\n        go to x: (-132) y: (18)\n    end\n    if <(Level:) = [6]> then\n        switch costume to (ladder-long v)\n        show\n        go to x: (0) y: (18)\n    end\n    if <(Level:) = [14]> then\n        switch costume to (ladder-jumpy v)\n        show\n        go to x: (0) y: (18)\n    end\n    if <(Level:) = [16]> then\n        switch costume to (ladder-small v)\n        go to x: (-120) y: (114)\n        show\n    end\n    if <(Level:) = [26]> then\n        switch costume to (ladder-long v)\n        go to x: (-51) y: (17)\n        show\n    end\n    if <(Level:) = [28]> then\n        if <[items: v] contains [beanstalk1]?> then\n            go to x: (37) y: (10)\n            show\n        end\n    end\nend\n\nwhen I receive [back v]\nhide\n\nwhen I receive [next v]\nhide\n\nwhen I receive [plant bean v]\ndelete (last) of [items: v]\nswitch costume to (magic bean v)\nshow\ngo to x: (32) y: (-108)\nwait (1) seconds\nswitch costume to (beanstalk v)\ngo to x: (37) y: (-282)\nglide (1) secs to x: (37) y: (10)\nadd [beanstalk1] to [items: v]\n\n@Springboard\n\nwhen I receive [back v]\nhide\n\nwhen I start as a clone\nchange [springboards v] by (1)\nshow\nif <(Level:) = [5]> then\n    go to x: (83) y: (-103)\nend\nif <(Level:) = [24]> then\n    go to x: (180) y: (-103)\nend\nforever\n    if <(Yv) < [0]> then\n        if <touching (sense v)?> then\n            Bounce Costumes\n        end\n    end\n    if <not <[levels v] contains (Level:)?>> then\n        change [springboards v] by (-1)\n        delete this clone\n    end\nend\n\nwhen I receive [next v]\nhide\n\nwhen flag clicked\nset [springboards v] to [0]\nhide\nforever\n    if <(Level:) = [5]> then\n        go to x: (-83) y: (-103)\n        show\n        if <(Springboards) = [0]> then\n            create clone of (_myself_ v)\n            wait until <(Springboards) = [0]>\n        end\n    end\n    if <(Level:) = [10]> then\n        go to x: (-70) y: (-103)\n        show\n    end\n    if <(Level:) = [12]> then\n        go to x: (60) y: (-103)\n        show\n    end\n    if <(Level:) = [22]> then\n        go to x: (200) y: (-103)\n        show\n    end\n    if <(Level:) = [24]> then\n        go to x: (-180) y: (-103)\n        show\n        if <(Springboards) = [0]> then\n            create clone of (_myself_ v)\n            wait until <(Springboards) = [0]>\n        end\n    end\n    if <(Level:) = [25]> then\n        go to x: (0) y: (-103)\n        show\n    end\n    if <(Level:) = [31]> then\n        go to x: (0) y: (-103)\n        show\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Yv) < [0]> then\n        if <touching (sense v)?> then\n            Bounce Costumes\n        end\n    end\nend\n\ndefine Bounce Costumes\nset [yv v] to [20]\nswitch costume to (3 v)\nwait (0.1) seconds\nswitch costume to (2 v)\nwait (0.05) seconds\nswitch costume to (1 v)\nwait (0.1) seconds\n\nwhen flag clicked\ndelete (all) of [levels v]\nadd [5] to [levels v]\nadd [24] to [levels v]\n\n@Quest Items\n\nwhen flag clicked\nhide\n\nwhen I receive [start v]\nforever\n    hide\n    if <(Level:) = [10]> then\n        if <not <[items: v] contains [orb1]?>> then\n            go to x: (126) y: (-91)\n            switch costume to (luxium orb v)\n            show\n            if <touching (player v)?> then\n                add [orb1] to [items: v]\n            end\n        end\n    end\n    if <(Level:) = [21]> then\n        if <not <[items: v] contains [orb2]?>> then\n            go to x: (0) y: (-91)\n            switch costume to (luxium orb v)\n            show\n            if <touching (player v)?> then\n                add [orb2] to [items: v]\n            end\n        end\n    end\n    if <(Level:) = [25]> then\n        if <not <[items: v] contains [bean]?>> then\n            switch costume to (magic bean v)\n            go to x: (198) y: (-18)\n            show\n            if <touching (player v)?> then\n                add [bean] to [items: v]\n            end\n        end\n    end\n    if <(Level:) = [31]> then\n        if <not <[items: v] contains [orb3]?>> then\n            go to x: (135) y: (100)\n            switch costume to (luxium orb v)\n            show\n            if <touching (player v)?> then\n                add [orb3] to [items: v]\n            end\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    if <[items: v] contains [bean]?> then\n        if <not <(item (last) of [items: v]) = [bean]>> then\n            delete ((length of [errands: v]) - (2)) of [items: v]\n            add [bean] to [items: v]\n        end\n    end\nend\n\nwhen I receive [win1 v]\nstop [other scripts in sprite v]\nset [clone id v] to [0]\nrepeat (3)\n    change [clone id v] by (1)\n    create clone of (_myself_ v)\n    wait (1) seconds\nend\nbroadcast (win2 v)\n\nwhen I start as a clone\nswitch costume to (luxium orb v)\nclear graphic effects\nshow\ngo to x: (0) y: (-98)\nglide (0.5) secs to x: (-83) y: (-39)\nif <(clone ID) = [3]> then\n    stop [this script v]\nend\nglide (0.5) secs to x: (0) y: (18)\nif <(clone ID) = [2]> then\n    stop [this script v]\nend\nglide (0.5) secs to x: (83) y: (-39)\nif <(clone ID) = [1]> then\n    stop [this script v]\nend\n\nadd [orb1] to [items: v]\nadd [orb2] to [items: v]\nadd [orb3] to [items: v]\n\n@Effect\n\nwhen flag clicked\nhide\ngo to [front v] layer\n\nwhen I receive [start v]\nforever\n    if <[items: v] contains [orb1]?> then\n        wait (0.5) seconds\n        switch costume to (orb 1/3 v)\n        show\n        go to x: (0) y: (209)\n        glide (0.5) secs to x: (0) y: (0)\n        wait (1) seconds\n        glide (0.5) secs to x: (0) y: (209)\n        hide\n        stop [this script v]\n    end\nend\n\nwhen I receive [start v]\nforever\n    if <[items: v] contains [key1]?> then\n        wait (0.5) seconds\n        switch costume to (key v)\n        show\n        go to x: (0) y: (209)\n        glide (0.5) secs to x: (0) y: (0)\n        wait (1) seconds\n        glide (0.5) secs to x: (0) y: (209)\n        hide\n        stop [this script v]\n    end\nend\n\nwhen I receive [start v]\nforever\n    if <[items: v] contains [key2]?> then\n        wait (0.5) seconds\n        switch costume to (key v)\n        show\n        go to x: (0) y: (209)\n        glide (0.5) secs to x: (0) y: (0)\n        wait (1) seconds\n        glide (0.5) secs to x: (0) y: (209)\n        hide\n        stop [this script v]\n    end\nend\n\nwhen I receive [start v]\nforever\n    if <[items: v] contains [bean]?> then\n        wait (0.5) seconds\n        switch costume to (bean v)\n        show\n        go to x: (0) y: (209)\n        glide (0.5) secs to x: (0) y: (0)\n        wait (1) seconds\n        glide (0.5) secs to x: (0) y: (209)\n        hide\n        stop [this script v]\n    end\nend\n\nwhen I receive [start v]\nforever\n    if <[items: v] contains [orb2]?> then\n        wait (0.5) seconds\n        switch costume to (orb 2/3 v)\n        show\n        go to x: (0) y: (209)\n        glide (0.5) secs to x: (0) y: (0)\n        wait (1) seconds\n        glide (0.5) secs to x: (0) y: (209)\n        hide\n        stop [this script v]\n    end\nend\n\nwhen I receive [start v]\nforever\n    if <[items: v] contains [orb3]?> then\n        wait (0.5) seconds\n        switch costume to (orb 3/3 v)\n        show\n        go to x: (0) y: (209)\n        glide (0.5) secs to x: (0) y: (0)\n        wait (1) seconds\n        glide (0.5) secs to x: (0) y: (209)\n        hide\n        stop [this script v]\n    end\nend\n\nwhen I receive [start v]\nforever\n    if <[items: v] contains [key3]?> then\n        wait (0.5) seconds\n        switch costume to (big key v)\n        show\n        go to x: (0) y: (209)\n        glide (0.5) secs to x: (0) y: (0)\n        wait (1) seconds\n        glide (0.5) secs to x: (0) y: (209)\n        hide\n        stop [this script v]\n    end\nend\n\n@Character\n\nwhen flag clicked\nset [clone? v] to [0]\nhide\ndelete (all) of [items: v]\ndelete (all) of [errands: v]\n\ngo [backward v] (20) layers\n\nwhen I receive [start v]\nswitch costume to (knight-captain v)\npoint in direction (-90)\nshow\nset [move? v] to [no]\ngo to x: (150) y: (-111)\nwait (0.4) seconds\nglide (1) secs to x: (-35) y: (-111)\nsay [Welcome to the Castle!] for (2) seconds\nsay [Dark forces have covered this place in shadow.] for (3) seconds\nsay [To bring back the light, you must find the three orbs of Luxium.] for (3) seconds\nsay [Use \[<\], \[>\], \[^\] to move and \[SPACE\] to talk or interact.] for (3) seconds\nsay [Best of luck to you, Light Knight!] for (2) seconds\npoint in direction (90)\nglide (1) secs to x: (150) y: (-111)\nset [move? v] to [yes]\nforever\n    hide\n    if <(Level:) = [9]> then\n        switch costume to (knight-guard v)\n        point in direction (-90)\n        go to x: (34) y: (-111)\n        show\n        if <touching (player v)?> then\n            if <key (space v) pressed?> then\n                set [move? v] to [no]\n                if <not <[items: v] contains [key1]?>> then\n                    say [You must find the key.] for (2) seconds\n                    say [Perhaps it lies in an earlier level...] for (3) seconds\n                    if <not <[errands: v] contains [key1]?>> then\n                        add [key1] to [errands: v]\n                    end\n                end\n                if <[items: v] contains [key1]?> then\n                    if <not <[items: v] contains [gate1]?>> then\n                        say [I shall open the gate now.] for (2) seconds\n                        add [gate1] to [items: v]\n                    end\n                    if <[items: v] contains [gate1]?> then\n                        say [Good luck.] for (2) seconds\n                    end\n                end\n                set [move? v] to [yes]\n            end\n        end\n    end\n    if <(Level:) = [20]> then\n        switch costume to (knight-guard v)\n        point in direction (-90)\n        go to x: (34) y: (-111)\n        show\n        if <touching (player v)?> then\n            if <key (space v) pressed?> then\n                set [move? v] to [no]\n                if <not <[items: v] contains [key2]?>> then\n                    say [You must find the key.] for (2) seconds\n                    if <not <[errands: v] contains [key2]?>> then\n                        add [key2] to [errands: v]\n                    end\n                end\n                if <[items: v] contains [key2]?> then\n                    if <not <[items: v] contains [gate2]?>> then\n                        say [I shall open the gate now.] for (2) seconds\n                        add [gate2] to [items: v]\n                    end\n                    if <[items: v] contains [gate2]?> then\n                        say [Good luck.] for (2) seconds\n                    end\n                end\n                set [move? v] to [yes]\n            end\n        end\n    end\n    if <(Level:) = [32]> then\n        switch costume to (knight-guard2 v)\n        point in direction (-90)\n        go to x: (34) y: (-111)\n        show\n        if <touching (player v)?> then\n            if <key (space v) pressed?> then\n                set [move? v] to [no]\n                if <not <[items: v] contains [key3]?>> then\n                    say [You must find the master key.] for (2) seconds\n                    if <<<not <[items: v] contains [orb3]?>> and <not <[items: v] contains [orb2]?>>> and <not <[items: v] contains [orb1]?>>> then\n                        say [Also, it appears you still have orbs to collect.] for (2) seconds\n                    end\n                    if <not <[errands: v] contains [key3]?>> then\n                        add [key3] to [errands: v]\n                    end\n                end\n                if <[items: v] contains [key3]?> then\n                    if <not <[items: v] contains [gate3]?>> then\n                        if <<<not <[items: v] contains [orb3]?>> and <not <[items: v] contains [orb2]?>>> and <not <[items: v] contains [orb1]?>>> then\n                            say [It appears you still have orbs to collect.] for (2) seconds\n                        end\n                        if <<<[items: v] contains [orb2]?> and <[items: v] contains [orb3]?>> and <[items: v] contains [orb1]?>> then\n                            say [I shall open the master gate now.] for (2) seconds\n                            add [gate3] to [items: v]\n                        end\n                    end\n                    if <[items: v] contains [gate3]?> then\n                        say [Well done.] for (2) seconds\n                    end\n                end\n                set [move? v] to [yes]\n            end\n        end\n    end\nend\n\n@Logo\n\nwhen flag clicked\nbroadcast (logo v)\n\nwhen I receive [logo v]\ngo to [front v] layer\ngo to x: (0) y: (0)\nshow\nswitch costume to (backdrop3 v)\nwait (1) seconds\ncreate clone of (_myself_ v)\nwait (2) seconds\nhide\n\nwhen I receive [win2 v]\nset size to (100) %\nswitch costume to (u win v)\nshow\ngo to x: (0) y: (200)\nglide (1) secs to x: (0) y: (0)\n\nwhen I start as a clone\nswitch costume to (backdrop4 v)\ngo to [front v] layer\nshow\nset size to (10) %\nrepeat (10)\n    change size by (10)\nend\nrepeat (5)\n    change size by (-5)\nend\nrepeat (5)\n    change size by (7)\nend\nrepeat (2)\n    change size by (-4)\nend\nwait (1) seconds\ndelete this clone\n\n