Secrets platformer (Mobile friendly)
@Stage\n\nwhen I receive [begin v]\nswitch costume to (lvl 1 v)\n\nwhen I receive [went right v]\nnext backdrop\nif <(costume [name v]) = [Secret 1 lvl 4]> then\n    next costume\nend\nif <(backdrop [name v]) = [Secret 4 lvl 5]> then\n    set [gravity v] to [1]\nend\nset [beginning costume v] to (backdrop [number v])\n\nwhen I receive [went left v]\nswitch backdrop to ((backdrop [number v]) - (1))\nif <(backdrop [name v]) = [Secret 4 lvl 4]> then\n    set [gravity v] to [-1]\nend\nset [beginning costume v] to (backdrop [number v])\n\nwhen I receive [reset v]\nswitch backdrop to (Beginning costume)\n\nwhen I receive [break v]\nswitch costume to (secret 1 lvl 4 broken v)\n\nwhen I receive [up? v]\nif <(backdrop [name v]) = [Secret 1 lvl 6]> then\n    broadcast (Went up v)\nend\n\nwhen I receive [went up v]\nswitch backdrop to (secret 1 ending v)\nset [beginning costume v] to (backdrop [number v])\n\nwhen I receive [went down v]\nif <(backdrop [name v]) = [Secret 1 ending]> then\n    switch backdrop to (secret 1 lvl 6 v)\nelse\n    if <(backdrop [name v]) = [Lvl 4]> then\n        switch backdrop to (secret 3 lvl 1 v)\n    else\n        if <(costume [name v]) = [Secret 3 bottomless pit]> then\n            switch costume to (secret 3 falling v)\n        else\n            if <(costume [name v]) = [Secret 3 falling]> then\n                if <(...) = [300]> then\n                    switch backdrop to (secret 4 lvl 1 v)\n                end\n            end\n        end\n    end\nend\nset [beginning costume v] to (backdrop [number v])\n\nif <(Gravity) = [-1]> then\n\nif <(Gravity) = [-1]> then\n\nwhen I receive [special right v]\nswitch costume to (secret 5 lvl 1 v)\nset [beginning costume v] to (costume [number v])\n\nwhen I receive [special left v]\nswitch costume to (lvl 6 v)\nset [beginning costume v] to (costume [number v])\n\nwhen I receive [second \(or back to first\) dimension v]\nif <(costume [name v]) = [Secret 5 lvl 5]> then\n    switch costume to (secret 5 lvl 5 d2 v)\nelse\n    if <(costume [name v]) = [Secret 5 lvl 6]> then\n        switch costume to (secret 5 lvl 6 d2 v)\n    else\n        if <(costume [name v]) = [Secret 5 lvl 6 D2]> then\n            switch costume to (secret 5 lvl 6 v)\n        else\n            if <(costume [name v]) = [Secret 5 lvl 7]> then\n                switch costume to (secret 5 lvl 7 d2 v)\n            else\n                if <(costume [name v]) = [Secret 5 lvl 7 D2]> then\n                    switch costume to (secret 5 lvl 7 v)\n                else\n                    if <(costume [name v]) = [Secret 5 lvl 8]> then\n                        switch costume to (secret 5 lvl 8 d2 v)\n                    else\n                        if <(costume [name v]) = [Secret 5 lvl 8 D2]> then\n                            switch costume to (secret 5 lvl 8 v)\n                        else\n                            if <(costume [name v]) = [Secret 5 lvl 9]> then\n                                switch costume to (secret 5 lvl 9 d2 v)\n                            else\n                                if <(costume [name v]) = [Secret 5 lvl 9 D2]> then\n                                    switch costume to (secret 5 lvl 9 v)\n                                else\n                                    if <(costume [name v]) = [Secret 5 ending]> then\n                                        switch costume to (secret 5 ending d2 v)\n                                    else\n                                        if <(costume [name v]) = [Secret 5 ending D2]> then\n                                            switch costume to (secret 5 ending v)\n                                        end\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    play sound [Dirtmouth v] until done\nend\n\n@Blank\n\n@Player\n\nwhen flag clicked\nset [gravity v] to [-1]\nset [came from v] to [Left]\nset [x velocity v] to [0]\nbroadcast (Begin v)\nset [go to y v] to (y position)\nrepeat (5)\n    go to x: (-200) y: (-74)\nend\nforever\n    switch costume to (idle v)\n    if <<key (left arrow v) pressed?> or <<key (a v) pressed?> or <<mouse down?> and <(mouse x) < (x position)>>>> then\n        switch costume to (left v)\n        change [x velocity v] by (-1.5)\n    end\n    if <<key (right arrow v) pressed?> or <<key (d v) pressed?> or <<mouse down?> and <(x position) < (mouse x)>>>> then\n        switch costume to (right v)\n        change [x velocity v] by (1.5)\n    end\n    set [x velocity v] to ((X velocity) * (0.85))\n    change x by (X velocity)\n    if <touching (ground v)?> then\n        change y by ((0) - (Gravity))\n    end\n    if <touching (ground v)?> then\n        change y by ((0) - (Gravity))\n    end\n    if <touching (ground v)?> then\n        change y by ((0) - (Gravity))\n    end\n    if <touching (ground v)?> then\n        change y by ((0) - (Gravity))\n    end\n    if <touching (ground v)?> then\n        if <(Gravity) = [-1]> then\n            change y by (-4)\n        else\n            change y by (4)\n        end\n        change x by ((X velocity) * (-1))\n        if <(Gravity) = [-1]> then\n            if <<key (up arrow v) pressed?> or <<key (w v) pressed?> or <<key (space v) pressed?> or <<mouse down?> and <(y position) < (mouse y)>>>>> then\n                if <(X velocity) > [0]> then\n                    set [x velocity v] to [-10]\n                else\n                    set [x velocity v] to [10]\n                end\n                set [y velocity v] to [15]\n            else\n                set [x velocity v] to [0]\n            end\n        else\n            if <<key (down arrow v) pressed?> or <<key (s v) pressed?> or <<key (space v) pressed?> or <<mouse down?> and <(mouse y) < (y position)>>>>> then\n                if <(X velocity) > [0]> then\n                    set [x velocity v] to [-10]\n                else\n                    set [x velocity v] to [10]\n                end\n                set [y velocity v] to [-15]\n            else\n                set [x velocity v] to [0]\n            end\n        end\n    end\n    change [y velocity v] by (Gravity)\n    change y by (Y velocity)\n    if <touching (ground v)?> then\n        change y by ((Y velocity) - ((Y velocity) * (2)))\n        set [y velocity v] to [0]\n    end\n    change y by (Gravity)\n    if <(Gravity) = [-1]> then\n        if <<touching (ground v)?> and <<key (up arrow v) pressed?> or <<key (w v) pressed?> or <<key (space v) pressed?> or <<mouse down?> and <(y position) < (mouse y)>>>>>> then\n            set [y velocity v] to [15]\n        end\n    else\n        if <<touching (ground v)?> and <<key (down arrow v) pressed?> or <<key (s v) pressed?> or <<key (space v) pressed?> or <<mouse down?> and <(mouse y) < (y position)>>>>>> then\n            set [y velocity v] to [-15]\n        end\n    end\n    change y by ((0) - (Gravity))\n    if <(x position) > [234]> then\n        if <<(backdrop [name v]) = [Lvl 6]> and <[149] < (y position)>> then\n            broadcast (Special right v)\n        else\n            broadcast (Went right v)\n        end\n        set x to (-230)\n        set [go to x v] to (x position)\n        set [go to y v] to (y position)\n    end\n    if <(x position) < [-234]> then\n        if <<(backdrop [name v]) = [Secret 5 lvl 1]> and <[149] < (y position)>> then\n            broadcast (Special left v)\n        else\n            broadcast (Went left v)\n        end\n        set x to (230)\n        set [go to x v] to (x position)\n        set [go to y v] to (y position)\n    end\n    if <[-175] > (y position)> then\n        if <<(Gravity) = [-1]> and <not <touching (death v)?>>> then\n            broadcast (Went down v)\n            set y to (170)\n            set [go to x v] to (x position)\n            set [go to y v] to (y position)\n        end\n    end\n    if <(y position) > [175]> then\n        broadcast (Up? v)\n    end\n    if <<touching (death v)?> or <touching (evil player v)?>> then\n        broadcast (Reset v)\n    end\nend\n\nwhen I receive [reset v]\ngo to x: (Go to X) y: (Go to Y)\n\nwhen I receive [went right v]\nwait (0.01) seconds\nif <touching (ground v)?> then\n    if <(Gravity) = [-1]> then\n        change y by (-5)\n    else\n        change y by (5)\n    end\n    if <touching (ground v)?> then\n        repeat until <not <touching (ground v)?>>\n            if <(Gravity) = [-1]> then\n                change y by (5)\n            else\n                change y by (-5)\n            end\n        end\n    end\n    set [go to x v] to (x position)\n    set [go to y v] to (y position)\nend\n\nwhen I receive [went left v]\nwait (0.01) seconds\nif <touching (ground v)?> then\n    if <(Gravity) = [-1]> then\n        change y by (-5)\n    else\n        change y by (5)\n    end\n    if <touching (ground v)?> then\n        repeat until <not <touching (ground v)?>>\n            if <(Gravity) = [-1]> then\n                change y by (5)\n            else\n                change y by (-5)\n            end\n        end\n    end\n    set [go to x v] to (x position)\n    set [go to y v] to (y position)\nend\n\nwhen flag clicked\nforever\n    if <[200] < (y position)> then\n        set y to (200)\n    end\nend\n\nwhen I receive [went up v]\nset y to (-170)\nset [go to x v] to [0]\nset [go to y v] to [-75]\nif <touching (ground v)?> then\n    if <(Gravity) = [-1]> then\n        change y by (-5)\n    else\n        change y by (5)\n    end\n    if <touching (ground v)?> then\n        repeat until <not <touching (ground v)?>>\n            if <(Gravity) = [-1]> then\n                change y by (5)\n            else\n                change y by (-5)\n            end\n        end\n    end\nend\n\nwhen I receive [went down v]\nwait (0.1) seconds\nif <(backdrop [name v]) = [Secret 1 lvl 6]> then\n    change y by (10)\nend\n\nwhen flag clicked\nforever\n    if <(y position) < [-200]> then\n        set y to (-200)\n    end\nend\n\nwhen flag clicked\nset [go to x v] to [-200]\nset [go to y v] to [-75]\nwait until <(Gravity) = [1]>\nset [go to x v] to (x position)\nset [go to y v] to (y position)\n\nwhen flag clicked\nforever\n    if <(Gravity) = [-1]> then\n        if <<key (up arrow v) pressed?> or <<key (w v) pressed?> or <<key (space v) pressed?> or <<mouse down?> and <(y position) < (mouse y)>>>>> then\n            if <(costume [name v]) = [Left]> then\n                switch costume to (left-up v)\n            else\n                if <(costume [name v]) = [Right]> then\n                    switch costume to (right-up v)\n                else\n                    if <(costume [name v]) = [Idle]> then\n                        switch costume to (jump v)\n                    end\n                end\n            end\n        end\n    else\n        if <<key (down arrow v) pressed?> or <<key (s v) pressed?> or <<key (space v) pressed?> or <<mouse down?> and <(mouse y) < (y position)>>>>> then\n            if <(costume [name v]) = [Left]> then\n                switch costume to (left—-up v)\n            else\n                if <(costume [name v]) = [Right]> then\n                    switch costume to (right—-up v)\n                else\n                    if <(costume [name v]) = [Idle]> then\n                        switch costume to (jump antigravity v)\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen flag clicked\nwait (0.1) seconds\nforever\n    if <touching color (#ff8800)?> then\n        broadcast (Second \(or back to first\) dimension v)\n    end\nend\n\nwhen [r v] key pressed\nbroadcast (Reset v)\n\n@Ground\n\nwhen I receive [begin v]\nswitch costume to (lvl 1 v)\nset [beginning costume ground v] to (costume [number v])\n\nwhen I receive [went right v]\nnext costume\nset [beginning costume ground v] to (costume [number v])\n\nwhen I receive [went left v]\nswitch costume to ((costume [number v]) - (1))\nset [beginning costume ground v] to (costume [number v])\n\nwhen I receive [went up v]\nswitch costume to (secret 1 ending v)\nset [beginning costume ground v] to (costume [number v])\n\nwhen I receive [went down v]\nif <(costume [name v]) = [Secret 1 ending]> then\n    switch costume to (secret 1 lvl 6 v)\nelse\n    if <(costume [name v]) = [Lvl 4]> then\n        switch costume to (secret 3 lvl 1 v)\n    else\n        if <(costume [name v]) = [Secret 3 bottomless pit]> then\n            switch costume to (secret 3 falling v)\n            change [... v] by (1)\n        else\n            if <(costume [name v]) = [Secret 3 falling]> then\n                if <(...) = [300]> then\n                    switch costume to (secret 4 lvl 1 v)\n                else\n                    change [... v] by (1)\n                end\n            end\n        end\n    end\nend\nset [beginning costume ground v] to (costume [number v])\n\nwhen flag clicked\nset [... v] to [0]\n\nwhen flag clicked\nforever\n    set [y v] to (mouse y)\nend\n\nwhen I receive [special right v]\nswitch costume to (secret 5 lvl 1 v)\nset [beginning costume ground v] to (costume [number v])\n\nwhen I receive [special left v]\nswitch costume to (lvl 6 v)\nset [beginning costume ground v] to (costume [number v])\n\nwhen I receive [second \(or back to first\) dimension v]\nif <(costume [name v]) = [Secret 5 lvl 5]> then\n    switch costume to (secret 5 lvl 5 d2 v)\nelse\n    if <(costume [name v]) = [Secret 5 lvl 6]> then\n        switch costume to (secret 5 lvl 6 d2 v)\n    else\n        if <(costume [name v]) = [Secret 5 lvl 6 D2]> then\n            switch costume to (secret 5 lvl 6 v)\n        else\n            if <(costume [name v]) = [Secret 5 lvl 7]> then\n                switch costume to (secret 5 lvl 7 d2 v)\n            else\n                if <(costume [name v]) = [Secret 5 lvl 7 D2]> then\n                    switch costume to (secret 5 lvl 7 v)\n                else\n                    if <(costume [name v]) = [Secret 5 lvl 8]> then\n                        switch costume to (secret 5 lvl 8 d2 v)\n                    else\n                        if <(costume [name v]) = [Secret 5 lvl 8 D2]> then\n                            switch costume to (secret 5 lvl 8 v)\n                        else\n                            if <(costume [name v]) = [Secret 5 lvl 9]> then\n                                switch costume to (secret 5 lvl 9 d2 v)\n                            else\n                                if <(costume [name v]) = [Secret 5 lvl 9 D2]> then\n                                    switch costume to (secret 5 lvl 9 v)\n                                else\n                                    if <(costume [name v]) = [Secret 5 ending]> then\n                                        switch costume to (secret 5 ending d2 v)\n                                    else\n                                        if <(costume [name v]) = [Secret 5 ending D2]> then\n                                            switch costume to (secret 5 ending v)\n                                        end\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen I receive [reset v]\nswitch costume to (Beginning costume ground)\n\n@Death\n\nwhen I receive [begin v]\nswitch costume to (lvl 1 v)\nset [beginning costume v] to (costume [number v])\n\nwhen I receive [went right v]\nnext costume\nif <(costume [name v]) = [Secret 1 lvl 4]> then\n    next costume\nend\nset [beginning costume v] to (costume [number v])\n\nwhen I receive [went left v]\nswitch costume to ((costume [number v]) - (1))\nset [beginning costume v] to (costume [number v])\n\nwhen I receive [reset v]\nswitch costume to (Beginning costume)\n\nwhen I receive [break v]\nswitch costume to (secret 1 lvl 4 broken v)\n\nwhen I receive [went up v]\nswitch costume to (secret 1 ending v)\nset [beginning costume v] to (costume [number v])\n\nwhen I receive [went down v]\nif <(costume [name v]) = [Secret 1 ending]> then\n    switch costume to (secret 1 lvl 6 v)\nelse\n    if <(costume [name v]) = [Lvl 4]> then\n        switch costume to (secret 3 lvl 1 v)\n    else\n        if <(costume [name v]) = [Secret 3 bottomless pit]> then\n            switch costume to (secret 3 falling v)\n        else\n            if <(costume [name v]) = [Secret 3 falling]> then\n                if <(...) = [300]> then\n                    switch costume to (secret 4 lvl 1 v)\n                end\n            end\n        end\n    end\nend\nset [beginning costume v] to (costume [number v])\n\nwhen I receive [special right v]\nswitch costume to (secret 5 lvl 1 v)\nset [beginning costume v] to (costume [number v])\n\nwhen I receive [special left v]\nswitch costume to (lvl 6 v)\nset [beginning costume v] to (costume [number v])\n\nwhen I receive [second \(or back to first\) dimension v]\nif <(costume [name v]) = [Secret 5 lvl 5]> then\n    switch costume to (secret 5 lvl 5 d2 v)\nelse\n    if <(costume [name v]) = [Secret 5 lvl 6]> then\n        switch costume to (secret 5 lvl 6 d2 v)\n    else\n        if <(costume [name v]) = [Secret 5 lvl 6 D2]> then\n            switch costume to (secret 5 lvl 6 v)\n        else\n            if <(costume [name v]) = [Secret 5 lvl 7]> then\n                switch costume to (secret 5 lvl 7 d2 v)\n            else\n                if <(costume [name v]) = [Secret 5 lvl 7 D2]> then\n                    switch costume to (secret 5 lvl 7 v)\n                else\n                    if <(costume [name v]) = [Secret 5 lvl 8]> then\n                        switch costume to (secret 5 lvl 8 d2 v)\n                    else\n                        if <(costume [name v]) = [Secret 5 lvl 8 D2]> then\n                            switch costume to (secret 5 lvl 8 v)\n                        else\n                            if <(costume [name v]) = [Secret 5 lvl 9]> then\n                                switch costume to (secret 5 lvl 9 d2 v)\n                            else\n                                if <(costume [name v]) = [Secret 5 lvl 9 D2]> then\n                                    switch costume to (secret 5 lvl 9 v)\n                                else\n                                    if <(costume [name v]) = [Secret 5 ending]> then\n                                        switch costume to (secret 5 ending d2 v)\n                                    else\n                                        if <(costume [name v]) = [Secret 5 ending D2]> then\n                                            switch costume to (secret 5 ending v)\n                                        end\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\n@Pick\n\nwhen flag clicked\nhide\nforever\n    wait until <(backdrop [name v]) = [Secret 1 lvl 4]>\n    show\n    wait until <not <(backdrop [name v]) = [Secret 1 lvl 4]>>\n    hide\nend\n\nwhen flag clicked\nforever\n    if <touching (player v)?> then\n        broadcast (Break v)\n    end\nend\n\n@Lava gem\n\nwhen flag clicked\ngo to x: (3) y: (-53)\nforever\n    if <(backdrop [name v]) = [Failed ending]> then\n        show\n    else\n        hide\n    end\nend\n\nwhen flag clicked\nset [lava gem movement v] to [0]\nforever\n    change [lava gem movement v] by (2.5)\n    set [lava gem actual movement v] to ([cos v] of (Lava gem movement) )\n    change y by ((Lava gem actual movement) / (1))\nend\n\n@Lava gem holder\n\nwhen flag clicked\nforever\n    if <(backdrop [name v]) = [Failed ending]> then\n        show\n    else\n        hide\n    end\nend\n\n@Lava gem connector 1\n\n@Lava gem connector 2\n\n@Lava gem connector 3\n\n@Lava gem connector 4\n\n@Sprite1\n\nwhen flag clicked\nset [ghost v] effect to (0)\nset [found? v] to [0]\nforever\n    hide\n    wait until <(backdrop [name v]) = [Secret 1 lvl 5]>\n    if <(Found?) = [0]> then\n        show\n    end\n    wait until <not <(backdrop [name v]) = [Secret 1 lvl 5]>>\nend\n\nwhen flag clicked\nwait until <touching (player v)?>\nwait (0.1) seconds\nif <touching (player v)?> then\n    set [found? v] to [1]\n    repeat (100)\n        change [ghost v] effect by (1)\n    end\n    hide\nend\n\n@Anti-gravity\n\nwhen flag clicked\nforever\n    if <(backdrop [name v]) = [Secret 2 lvl 2]> then\n        show\n    else\n        hide\n    end\nend\n\nwhen flag clicked\ngo to [front v] layer\nwait (0.2) seconds\nforever\n    if <touching (player v)?> then\n        set [gravity v] to [1]\n        set [y velocity v] to [15]\n    end\nend\n\n@Gravity orb\n\nwhen flag clicked\ngo to x: (-3) y: (52)\nforever\n    if <(backdrop [name v]) = [Secret 2 ending]> then\n        show\n    else\n        hide\n    end\nend\n\nwhen flag clicked\nset [gravity orb movement v] to [0]\nforever\n    change [gravity orb movement v] by (2.5)\n    set [gravity orb actual movement v] to ([cos v] of (Gravity orb movement) )\n    change y by ((Gravity orb actual movement) / (1))\nend\n\n@Watchful eye\n\nwhen flag clicked\nforever\n    hide\n    wait until <(backdrop [name v]) = [Secret 4 lvl 6]>\n    wait (0.02) seconds\n    go to [back v] layer\n    show\n    wait until <not <(backdrop [name v]) = [Secret 4 lvl 6]>>\nend\n\n@Lens\n\nwhen flag clicked\nforever\n    point towards (player v)\nend\n\nwhen flag clicked\nforever\n    hide\n    wait until <(backdrop [name v]) = [Secret 4 lvl 6]>\n    wait (0.01) seconds\n    go to [back v] layer\n    show\n    wait until <not <(backdrop [name v]) = [Secret 4 lvl 6]>>\nend\n\n@Sprite2\n\nwhen flag clicked\nbroadcast (Wait v)\n\nwhen I receive [wait v]\nhide\nwait until <(backdrop [name v]) = [Secret 4 lvl 6]>\ngo to x: (-83) y: (-35)\ngo to [back v] layer\nshow\nwait (1) seconds\nif <(backdrop [name v]) = [Secret 4 lvl 6]> then\n    repeat (10)\n        change y by (-4)\n    end\n    hide\nelse\n    broadcast (Wait v)\nend\n\n@Sprite3\n\nwhen flag clicked\nbroadcast (Wait2 v)\n\nwhen I receive [wait2 v]\nhide\nwait until <(backdrop [name v]) = [Secret 4 lvl 6]>\ngo to x: (-83) y: (84)\ngo to [back v] layer\nshow\nwait (1) seconds\nif <(backdrop [name v]) = [Secret 4 lvl 6]> then\n    repeat (10)\n        change y by (4)\n    end\n    hide\nelse\n    broadcast (Wait2 v)\nend\n\n@Lens 2\n\nwhen flag clicked\nforever\n    point towards (player v)\nend\n\nwhen flag clicked\nforever\n    hide\n    wait until <(backdrop [name v]) = [Secret 4 ending]>\n    wait (0.01) seconds\n    go to [back v] layer\n    show\n    wait until <not <(backdrop [name v]) = [Secret 4 ending]>>\nend\n\n@Lens 3\n\nwhen flag clicked\nforever\n    point towards (player v)\nend\n\nwhen flag clicked\nforever\n    hide\n    wait until <(backdrop [name v]) = [Secret 4 ending]>\n    wait (0.01) seconds\n    go to [back v] layer\n    show\n    wait until <not <(backdrop [name v]) = [Secret 4 ending]>>\nend\n\n@Lens 4\n\nwhen flag clicked\nforever\n    point towards (player v)\nend\n\nwhen flag clicked\nforever\n    hide\n    wait until <(backdrop [name v]) = [Secret 4 ending]>\n    wait (0.01) seconds\n    go to [back v] layer\n    show\n    wait until <not <(backdrop [name v]) = [Secret 4 ending]>>\nend\n\n@Lens 5\n\nwhen flag clicked\nforever\n    point towards (player v)\nend\n\nwhen flag clicked\nforever\n    hide\n    wait until <(backdrop [name v]) = [Secret 4 ending]>\n    wait (0.01) seconds\n    go to [back v] layer\n    show\n    wait until <not <(backdrop [name v]) = [Secret 4 ending]>>\nend\n\n@Lens 6\n\nwhen flag clicked\nforever\n    point towards (player v)\nend\n\nwhen flag clicked\nforever\n    hide\n    wait until <(backdrop [name v]) = [Secret 4 ending]>\n    wait (0.01) seconds\n    go to [back v] layer\n    show\n    wait until <not <(backdrop [name v]) = [Secret 4 ending]>>\nend\n\n@Lens 7\n\nwhen flag clicked\nforever\n    point towards (player v)\nend\n\nwhen flag clicked\nforever\n    hide\n    wait until <(backdrop [name v]) = [Secret 4 ending]>\n    wait (0.01) seconds\n    go to [back v] layer\n    show\n    wait until <not <(backdrop [name v]) = [Secret 4 ending]>>\nend\n\n@Communication globe\n\nwhen flag clicked\nforever\n    if <(backdrop [name v]) = [Secret 4 ending]> then\n        show\n    else\n        hide\n    end\nend\n\n@Evil player\n\nwhen flag clicked\nforever\n    switch costume to (idle v)\n    if <([x position v] of [player v]) < (x position)> then\n        switch costume to (left v)\n        change [ex velocity v] by (-1.5)\n    end\n    if <(x position) < ([x position v] of [player v])> then\n        switch costume to (right v)\n        change [ex velocity v] by (1.5)\n    end\n    set [ex velocity v] to ((Ex velocity) * (0.85))\n    change x by (Ex velocity)\n    if <touching (ground v)?> then\n        change y by ((0) - (Gravity))\n    end\n    if <touching (ground v)?> then\n        change y by ((0) - (Gravity))\n    end\n    if <touching (ground v)?> then\n        change y by ((0) - (Gravity))\n    end\n    if <touching (ground v)?> then\n        change y by ((0) - (Gravity))\n    end\n    if <touching (ground v)?> then\n        if <(Gravity) = [-1]> then\n            change y by (-4)\n        else\n            change y by (4)\n        end\n        change x by ((X velocity) * (-1))\n        if <(Gravity) = [-1]> then\n            if <(y position) < (([y position v] of [player v]) - (5))> then\n                if <(Ex velocity) > (y position)> then\n                    set [ex velocity v] to [-10]\n                else\n                    set [ex velocity v] to [10]\n                end\n                set [ey velocity v] to [15]\n            else\n                set [ex velocity v] to [0]\n            end\n        else\n            if <(([y position v] of [player v]) + (5)) < (y position)> then\n                if <(Ex velocity) > [0]> then\n                    set [ex velocity v] to [-10]\n                else\n                    set [ex velocity v] to [10]\n                end\n                set [ey velocity v] to [-15]\n            else\n                set [ex velocity v] to [0]\n            end\n        end\n    end\n    change [ey velocity v] by (Gravity)\n    change y by (Ey velocity)\n    if <touching (ground v)?> then\n        change y by ((Ey velocity) - ((Ey velocity) * (2)))\n        set [ey velocity v] to [0]\n    end\n    change y by (Gravity)\n    if <(Gravity) = [-1]> then\n        if <<touching (ground v)?> and <(([y position v] of [player v]) - (5)) > (y position)>> then\n            set [ey velocity v] to [15]\n        end\n    else\n        if <<touching (ground v)?> and <(([y position v] of [player v]) + (5)) < (y position)>> then\n            set [ey velocity v] to [-15]\n        end\n    end\n    change y by ((0) - (Gravity))\nend\n\nwhen flag clicked\nforever\n    if <[200] < (y position)> then\n        set y to (200)\n    end\nend\n\nwhen I receive [went up v]\nset y to (-170)\nset [go to x v] to [0]\nset [go to y v] to [-75]\nif <touching (ground v)?> then\n    if <(Gravity) = [-1]> then\n        change y by (-5)\n    else\n        change y by (5)\n    end\n    if <touching (ground v)?> then\n        repeat until <not <touching (ground v)?>>\n            if <(Gravity) = [-1]> then\n                change y by (5)\n            else\n                change y by (-5)\n            end\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    if <(y position) < [-200]> then\n        set y to (-200)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(backdrop [name v]) = [Secret 5 lvl 3]> then\n        show\n        go to x: (-95) y: (-57)\n        wait until <not <(backdrop [name v]) = [Secret 5 lvl 3]>>\n    else\n        hide\n    end\nend\n\nwhen I receive [reset v]\ngo to x: (-95) y: (-57)\n\n@Dimensional orb\n\nwhen flag clicked\nforever\n    if <touching (player v)?> then\n        set [ghost v] effect to (25)\n    else\n        set [ghost v] effect to (0)\n    end\nend\n\nwhen flag clicked\nforever\n    if <<(backdrop [name v]) = [Secret 5 ending]> or <(backdrop [name v]) = [Secret 5 ending D2]>> then\n        show\n    else\n        hide\n    end\nend\n\n@Mobile restart\n\nwhen flag clicked\nforever\n    wait until <not <mouse down?>>\n    if <touching (mouse-pointer v)?> then\n        broadcast (Reset v)\n    end\n    set [mouse y storage v] to (mouse y)\n    wait until <not <(Mouse y storage) = (mouse y)>>\nend\n\nforever\n    set [test var v] to <touching (mouse-pointer v)?>\nend\n\n
MOBILE FRIENDLY!\nIn this game, the goal is to find secrets and see where they lead. It's ok if you don’t find any. Avoid spikes and lava! You are the green square. There are 5 secrets!\nControls:\nPC controls:\nArrow keys/WASD to move. (also space to jump) R to restart!\nMobile controls:\nThe green square follows your finger/mouse. Click/tap to the left past the screen to restart!