MIRRФЯЯIM

Instructions: GAMEPLAY: Welcome to MIRRФЯЯIM... A mirror-based puzzle platformer. Navigate the levels by jumping around on the platforms. Use your reflection to find the secret key. Pass the key through the mirror at the grave. Unlock the door to get to the next level.\n\nCONTROLS:\n[A] & [D] / Left & Right Arrows = Move\n[W] / [Up Arrow] / [Space] = Jump\n[M] = Music On/Off\n[R] = Restart Level

@Stage\n\nwhen flag clicked\nset [mutemusic? v] to [0]\nset volume to (100) %\nforever\n    play sound [Disasterpeace - Forgotten v] until done\nend\n\nwhen I receive [fadeinmusic v]\nif <not <<(MuteMusic?) = [1]> and <(volume) = [0]>>> then\n    repeat (20)\n        change volume by (5)\n    end\nend\n\nwhen I receive [fadeoutmusic v]\nrepeat (20)\n    change volume by (-5)\nend\n\nwhen [m v] key pressed\nif <(volume) = [100]> then\n    broadcast (FadeOutMusic v)\n    set [mutemusic? v] to [1]\nelse\n    broadcast (FadeInMusic v)\n    set [mutemusic? v] to [0]\nend\n\n@Level\n\nwhen flag clicked\nset [level v] to [1]\nset [game end v] to [7]\ngo to [front v] layer\ngo [backward v] (100) layers\nforever\n    go to x: (0) y: (0)\n    switch costume to (Level)\nend\n\n@Sensor\n\nwhen I receive [gamebegins v]\nshow\ngo to [front v] layer\ngo [backward v] (100) layers\nset [ghost v] effect to (100)\npoint in direction (90)\nset [movement speed v] to [0.8]\nset [movement speed \(in air\) v] to [0.1]\nset [xvelocity v] to [0]\nset [yvelocity v] to [0]\nset [gravity v] to [-0.2]\nset [velocity multiplier v] to [0.96]\nset [velocity multiplier \(land\) v] to [0.6]\nset [jumped? v] to [0]\nset [jump height v] to [6]\nset [run-jump multiplier v] to [0.1]\nset [player dead? v] to [0]\nset [touching ghost? v] to [0]\nset [got key? v] to [0]\nset [pass key? v] to [0]\nif <(Level) = [1]> then\n    go to x: (-24) y: (-60)\nend\nif <(Level) = [2]> then\n    go to x: (-40) y: (-16)\nend\nif <(Level) = [3]> then\n    go to x: (-216) y: (76)\nend\nif <(Level) = [4]> then\n    point in direction (-90)\n    go to x: (-104) y: (132)\nend\nif <(Level) = [5]> then\n    go to x: (-104) y: (78)\nend\nif <(Level) = [6]> then\n    point in direction (-90)\n    go to x: (-8) y: (162)\nend\nif <(Level) = (Game End)> then\n    go to x: (-24) y: (-60)\nend\nforever\n    switch costume to (idle v)\n    set [moving? v] to [0]\n    set [x collision? v] to [0]\n    set [y collision? v] to [0]\n    change x by (Xvelocity)\n    if <touching (level v)?> then\n        set [x collision? v] to [1]\n    end\n    if <(X collision?) = [1]> then\n        change y by ([abs v] of ((Xvelocity) / (2)) )\n        if <touching (level v)?> then\n            change y by ([abs v] of ((Xvelocity) / (2)) )\n            if <touching (level v)?> then\n                change y by ([abs v] of ((Xvelocity) / (2)) )\n                if <touching (level v)?> then\n                    change y by ([abs v] of ((Xvelocity) / (2)) )\n                    if <touching (level v)?> then\n                        change y by (((0) - ([abs v] of ((Xvelocity) / (2)) )) * (4))\n                        change x by ((0) - (Xvelocity))\n                        set [xvelocity v] to [0]\n                    end\n                else\n                    change y by ((0) - ([abs v] of ((Xvelocity) / (2)) ))\n                end\n            else\n                change y by ((0) - ([abs v] of ((Xvelocity) / (2)) ))\n            end\n        else\n            change y by ((0) - ([abs v] of ((Xvelocity) / (2)) ))\n        end\n    end\n    change y by (Yvelocity)\n    if <touching (level v)?> then\n        set [y collision? v] to [1]\n    end\n    if <(Y collision?) = [1]> then\n        set [xvelocity v] to ((Xvelocity) * (Velocity Multiplier \(Land\)))\n        if <<<<key (up arrow v) pressed?> or <key (space v) pressed?>> or <key (w v) pressed?>> and <(Yvelocity) < [0]>> then\n            set [yvelocity v] to ((Jump Height) * ((1) + (([abs v] of (Xvelocity) ) * (Run-Jump Multiplier))))\n            set [jumped? v] to [1]\n            start sound [jump v]\n        else\n            if <(Yvelocity) < [0]> then\n                set [jumped? v] to [0]\n            end\n            change y by ((0) - (Yvelocity))\n            set [yvelocity v] to [0]\n        end\n    end\n    if <<<(Jumped?) = [1]> and <not <<<key (up arrow v) pressed?> or <key (space v) pressed?>> or <key (w v) pressed?>>>> and <(Yvelocity) > [0]>> then\n        set [yvelocity v] to ((Yvelocity) * (0.6))\n    end\n    if <<<touching (die v)?> or <(Touching Ghost?) = [1]>> or <touching (wall-left v)?>> then\n        broadcast (fadeoutmusic v)\n        switch costume to (dead v)\n        start sound [death v]\n        repeat (20)\n        if <(Level) = (Game End)> then\n            set [player dead? v] to [0]\n        else\n            set [player dead? v] to [1]\n        end\n        set [yvelocity v] to [5]\n        repeat (60)\n            change [yvelocity v] by (Gravity)\n            change y by (Yvelocity)\n            change [ghost v] effect by (2)\n        end\n        broadcast (fadetonewlevel v)\n        repeat (11)\n            change [yvelocity v] by (Gravity)\n            change y by (Yvelocity)\n        end\n        stop [this script v]\n    end\n    if <<touching (grave v)?> and <<(x position) > [-10]> and <(Got Key?) = [1]>>> then\n        set [pass key? v] to [1]\n    end\n    if <<touching (door v)?> and <(Pass Key?) = [1]>> then\n        broadcast (fadetonewlevel v)\n        stop [this script v]\n    end\n    if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n        set [moving? v] to [1]\n        point in direction (-90)\n        if <(Y collision?) = [1]> then\n            change [xvelocity v] by ((0) - (Movement Speed))\n        else\n            change [xvelocity v] by ((0) - (Movement Speed \(In air\)))\n        end\n    else\n        if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n            set [moving? v] to [1]\n            point in direction (90)\n            if <(Y collision?) = [1]> then\n                change [xvelocity v] by (Movement Speed)\n            else\n                change [xvelocity v] by (Movement Speed \(In air\))\n            end\n        else\n            set [playermovementanimation v] to [0]\n            if <(Jumped?) = [1]> then\n                switch costume to (jump v)\n            else\n                switch costume to (idle v)\n            end\n        end\n    end\n    if <(Moving?) = [1]> then\n        if <(Jumped?) = [1]> then\n            switch costume to (jump v)\n        else\n            if <(Y collision?) = [1]> then\n                change [playermovementanimation v] by (([abs v] of (Xvelocity) ) * (1))\n                if <(Playermovementanimation) < [10]> then\n                    switch costume to (run1 v)\n                else\n                    if <(Playermovementanimation) < [20]> then\n                        switch costume to (run2 v)\n                    else\n                        if <(Playermovementanimation) < [30]> then\n                            switch costume to (run3 v)\n                        else\n                            if <(Playermovementanimation) < [40]> then\n                                switch costume to (run2 v)\n                            else\n                                change [playermovementanimation v] by (-40)\n                                switch costume to (run1 v)\n                            end\n                        end\n                    end\n                end\n            else\n                switch costume to (idle v)\n            end\n        end\n    end\n    set [xvelocity v] to ((Xvelocity) * (Velocity Multiplier))\n    set [yvelocity v] to ((Yvelocity) * (Velocity Multiplier))\n    change [yvelocity v] by (Gravity)\nend\n\nwhen I receive [gamebegins v]\nforever\n    if <(Got Key?) = [1]> then\n        start sound [clong v]\n        stop [this script v]\n    end\nend\n\nwhen [r v] key pressed\nbroadcast (fadeoutmusic v)\nrepeat (20)\nif <(Level) = (Game End)> then\n    set [player dead? v] to [0]\nelse\n    set [player dead? v] to [1]\nend\nbroadcast (fadetonewlevel v)\nstop [this script v]\n\n@Main Man\n\nwhen I receive [gamebegins v]\ngo to [front v] layer\ngo [backward v] (1) layers\nset [ghost v] effect to (0)\nforever\n    set x to ([x position v] of [sensor v])\n    set y to ([y position v] of [sensor v])\n    if <([direction v] of [sensor v]) = [90]> then\n        point in direction (90)\n    else\n        point in direction (-90)\n    end\n    if <([costume # v] of [sensor v]) = [1]> then\n        switch costume to (idle v)\n    end\n    if <([costume # v] of [sensor v]) = [2]> then\n        switch costume to (run1 v)\n    end\n    if <([costume # v] of [sensor v]) = [3]> then\n        switch costume to (run2 v)\n    end\n    if <([costume # v] of [sensor v]) = [4]> then\n        switch costume to (run3 v)\n    end\n    if <([costume # v] of [sensor v]) = [5]> then\n        switch costume to (jump v)\n    end\n    if <([costume # v] of [sensor v]) = [6]> then\n        switch costume to (dead v)\n    end\n    if <(Player Dead?) = [1]> then\n        change [ghost v] effect by (2)\n    end\nend\n\n@Mirror Man\n\nwhen I receive [gamebegins v]\nshow\ngo to [front v] layer\nset size to (50) %\ngo [backward v] (1) layers\nset [ghost v] effect to (75)\nforever\n    set x to (([x position v] of [main man v]) * (-1))\n    set y to ([y position v] of [main man v])\n    if <([direction v] of [main man v]) = [90]> then\n        point in direction (90)\n    else\n        point in direction (-90)\n    end\n    if <([costume # v] of [main man v]) = [1]> then\n        switch costume to (idle v)\n    end\n    if <([costume # v] of [main man v]) = [2]> then\n        switch costume to (run1 v)\n    end\n    if <([costume # v] of [main man v]) = [3]> then\n        switch costume to (run2 v)\n    end\n    if <([costume # v] of [main man v]) = [4]> then\n        switch costume to (run3 v)\n    end\n    if <([costume # v] of [main man v]) = [5]> then\n        switch costume to (jump v)\n    end\n    if <([costume # v] of [main man v]) = [6]> then\n        switch costume to (dead v)\n    end\n    if <<touching (key v)?> and <not <(Player Dead?) = [1]>>> then\n        set [got key? v] to [1]\n    end\n    if <touching (ghost v)?> then\n        set [touching ghost? v] to [1]\n    end\n    if <(Player Dead?) = [1]> then\n        change [ghost v] effect by (0.5)\n    end\nend\n\n@Ghost\n\nwhen I receive [gamebegins v]\nhide\ngo to [front v] layer\nset size to (25) %\ngo [backward v] (1) layers\nset [ghost v] effect to (75)\nif <<(Level) = [4]> or <(Level) = [6]>> then\n    show\n    go to x: ((0) - ([x position v] of [grave v])) y: ([y position v] of [grave v])\nelse\n    hide\nend\nforever\n    point towards (mirror man v)\n    switch costume to (1 v)\n    if <(x position) > ([x position v] of [mirror man v])> then\n        if <([direction v] of [mirror man v]) = [90]> then\n            switch costume to (2 v)\n            set [ghost speed v] to [.5]\n            move (Ghost Speed) steps\n        else\n            switch costume to (1 v)\n            set [ghost speed v] to [0]\n        end\n    else\n        if <([direction v] of [mirror man v]) = [-90]> then\n            switch costume to (2 v)\n            set [ghost speed v] to [.5]\n            move (Ghost Speed) steps\n        else\n            switch costume to (1 v)\n            set [ghost speed v] to [0]\n        end\n    end\n    if <(Player Dead?) = [1]> then\n        change [ghost v] effect by (0.5)\n    end\nend\n\n@Key\n\nwhen I receive [gamebegins v]\nshow\ngo to [front v] layer\ngo [backward v] (2) layers\nset [ghost v] effect to (0)\nif <(Level) = [1]> then\n    go to x: (120) y: (-80)\nend\nif <(Level) = [2]> then\n    go to x: (104) y: (-20)\nend\nif <(Level) = [3]> then\n    go to x: (10) y: (172)\nend\nif <(Level) = [4]> then\n    go to x: (168) y: (-144)\nend\nif <(Level) = [5]> then\n    go to x: (104) y: (0)\nend\nif <(Level) = [6]> then\n    go to x: (92) y: (66)\nend\nif <(Level) = (Game End)> then\n    hide\nend\nforever\n    if <(Got Key?) = [1]> then\n        if <([direction v] of [mirror man v]) = [-90]> then\n            set x to (([x position v] of [mirror man v]) + (12))\n        else\n            set x to (([x position v] of [mirror man v]) - (12))\n        end\n        set y to (([y position v] of [mirror man v]) + (4))\n    end\n    if <(Pass Key?) = [1]> then\n        switch costume to (key v)\n        set size to (100) %\n        if <([direction v] of [main man v]) = [90]> then\n            set x to (([x position v] of [main man v]) + (12))\n        else\n            set x to (([x position v] of [main man v]) - (12))\n        end\n        set y to (([y position v] of [main man v]) + (4))\n    else\n        if <not <touching (door v)?>> then\n            switch costume to (key blurred v)\n            set size to (50) %\n        end\n    end\n    if <<(Player Dead?) = [1]> and <<(Got Key?) = [1]> or <(Pass Key?) = [1]>>> then\n        repeat (50)\n            change [ghost v] effect by (2)\n        end\n        hide\n        go to x: (0) y: (0)\n    end\nend\n\nwhen flag clicked\nwait until <<(Level) = [1]> and <<(Got Key?) = [0]> and <(Pass Key?) = [0]>>>\nwait (5) seconds\nthink [Use your reflection to find the secret key...]\nwait until <not <<(Level) = [1]> and <<(Got Key?) = [0]> and <(Pass Key?) = [0]>>>>\nthink []\n\nwhen I receive [gamebegins v]\nforever\n    if <<<touching (mirror man v)?> and <(Got Key?) = [1]>> and <(Pass Key?) = [0]>> then\n        start sound [clong v]\n        stop [this script v]\n    end\nend\n\n@Grave\n\nwhen I receive [gamebegins v]\nshow\ngo to [front v] layer\ngo [backward v] (100) layers\nif <(Level) = [1]> then\n    go to x: (-8) y: (-66)\nend\nif <(Level) = [2]> then\n    go to x: (-8) y: (62)\nend\nif <(Level) = [3]> then\n    go to x: (-8) y: (-162)\nend\nif <(Level) = [4]> then\n    go to x: (-8) y: (126)\nend\nif <(Level) = [5]> then\n    go to x: (-8) y: (-98)\nend\nif <(Level) = [6]> then\n    go to x: (-8) y: (62)\nend\nif <(Level) = (Game End)> then\n    go to x: (-8) y: (-66)\nend\n\nwhen flag clicked\nwait until <<(Level) = [1]> and <<(Got Key?) = [1]> and <(Pass Key?) = [0]>>>\nwait (5) seconds\nthink [Pass the key through the mirror at the grave...]\nwait until <not <<(Level) = [1]> and <<(Got Key?) = [1]> and <(Pass Key?) = [0]>>>>\nthink []\n\nwhen I receive [gamebegins v]\nforever\n    if <<touching (main man v)?> and <(Pass Key?) = [1]>> then\n        start sound [clink v]\n        stop [this script v]\n    end\nend\n\n@Door\n\nwhen I receive [gamebegins v]\nshow\nset size to (50) %\ngo to [front v] layer\ngo [backward v] (100) layers\nif <(Level) = [1]> then\n    go to x: (-216) y: (-44)\nend\nif <(Level) = [2]> then\n    go to x: (-56) y: (-12)\nend\nif <(Level) = [3]> then\n    go to x: (-232) y: (84)\nend\nif <(Level) = [4]> then\n    go to x: (-88) y: (132)\nend\nif <(Level) = [5]> then\n    go to x: (-152) y: (-92)\nend\nif <(Level) = [6]> then\n    go to x: (-120) y: (-156)\nend\nif <(Level) = (Game End)> then\n    hide\nend\n\nwhen flag clicked\nwait until <<(Level) = [1]> and <(Pass Key?) = [1]>>\nwait (5) seconds\nthink [Unlock the door...]\nwait until <not <<(Level) = [1]> and <(Pass Key?) = [1]>>>\nthink []\n\nwhen I receive [gamebegins v]\nforever\n    if <<<touching (key v)?> or <touching (main man v)?>> and <(Pass Key?) = [1]>> then\n        start sound [door open v]\n        stop [this script v]\n    end\nend\n\n@Die\n\nwhen flag clicked\ngo to [front v] layer\ngo [backward v] (60) layers\nforever\n    go to x: (0) y: (0)\n    set [ghost v] effect to (100)\n    go [backward v] (1) layers\nend\n\n@Fade\n\nwhen flag clicked\ngo to x: (0) y: (0)\nshow\nset size to (100) %\nrepeat (20)\nend\nbroadcast (GameBegins v)\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\nset [ghost v] effect to (0)\nset size to (0) %\nforever\n    go to [front v] layer\nend\n\nwhen I receive [fadetonewlevel v]\nset [got key? v] to [0]\nset [pass key? v] to [0]\ngo to x: (0) y: (0)\nset size to (100) %\ngo to [front v] layer\nset [ghost v] effect to (100)\nshow\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nrepeat (20)\nend\nif <(Player Dead?) = [0]> then\n    if <(Level) = (Game End)> then\n        set [level v] to [1]\n    else\n        change [level v] by (1)\n    end\nend\nbroadcast (GameBegins v)\nbroadcast (FadeInMusic v)\nrepeat (1)\nend\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\nset [ghost v] effect to (0)\nset size to (0) %\n\n@Spotlight\n\nwhen I receive [gamebegins v]\nhide\nset size to (200) %\nif <(Level) = [5]> then\n    forever\n        go to [front v] layer\n        show\n        go to x: ([x position v] of [sensor v]) y: ([y position v] of [sensor v])\n    end\nelse\n    hide\nend\n\n@Cover R\n\nwhen I receive [gamebegins v]\nhide\nset size to (200) %\nif <(Level) = [5]> then\n    forever\n        go to [front v] layer\n        if <(x position) > ((240) * (2))> then\n            hide\n        else\n            show\n        end\n        go to x: (([x position v] of [main man v]) + ((240) * (2))) y: (0)\n    end\nelse\n    hide\nend\n\n@Cover L\n\nwhen I receive [gamebegins v]\nhide\nset size to (200) %\nif <(Level) = [5]> then\n    forever\n        go to [front v] layer\n        if <(x position) < ((-240) * (2))> then\n            hide\n        else\n            show\n        end\n        go to x: (([x position v] of [main man v]) - ((240) * (2))) y: (0)\n    end\nelse\n    hide\nend\n\n@Cover T\n\nwhen I receive [gamebegins v]\nhide\nset size to (200) %\nif <(Level) = [5]> then\n    forever\n        go to [front v] layer\n        if <(y position) > ((180) * (2))> then\n            hide\n        else\n            show\n        end\n        go to x: (0) y: (([y position v] of [main man v]) + ((180) * (2)))\n    end\nelse\n    hide\nend\n\n@Cover B\n\nwhen I receive [gamebegins v]\nhide\nset size to (200) %\nif <(Level) = [5]> then\n    forever\n        go to [front v] layer\n        if <(y position) < ((-180) * (2))> then\n            hide\n        else\n            show\n        end\n        go to x: (0) y: (([y position v] of [main man v]) - ((180) * (2)))\n    end\nelse\n    hide\nend\n\n@wall-left\n\nwhen I receive [gamebegins v]\nhide\nif <(Level) = [6]> then\n    go to x: (-224) y: (0)\n    forever\n        go to [front v] layer\n        show\n        if <(x position) = [0]> then\n            stop [this script v]\n        else\n            wait (3.5) seconds\n            start sound [rumble v]\n            repeat (7)\n                wait (0.05) seconds\n                change x by (1)\n                wait (0.05) seconds\n                change x by (-1)\n            end\n            change x by (16)\n        end\n    end\nelse\n    hide\nend\n\n@wall-right\n\nwhen I receive [gamebegins v]\nhide\nif <(Level) = [6]> then\n    go to x: (224) y: (0)\n    forever\n        go to [front v] layer\n        show\n        if <(x position) = [0]> then\n            stop [this script v]\n        else\n            wait (3.5) seconds\n            repeat (7)\n                wait (0.05) seconds\n                change x by (-1)\n                wait (0.05) seconds\n                change x by (1)\n            end\n            change x by (-16)\n        end\n    end\nelse\n    hide\nend\n\n