The Emerald Cave | Platformer #Games


@Stage\n\nwhen flag clicked\nswitch backdrop to (download \(16\) \(1\) v)\n\nwhen I receive [next level! v]\nnext backdrop\n\n@Player\n\nwhen flag clicked\nhide\n\ndefine reset\nclear graphic effects\ngo to x: (-200) y: (-1)\n\nwhen flag clicked\ngo to x: (-200) y: (-1)\nset size to (80) %\nswitch costume to (alive v)\nshow\nset [level v] to [1]\nset [xv v] to [0]\nset [yv v] to [0]\nforever\n    if <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <(mouse x) > [10]>>> then\n        change [xv v] by (1)\n    end\n    if <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <(mouse x) < [-10]>>> then\n        change [xv v] by (-1)\n    end\n    set [xv v] to ((Xv) * (0.9))\n    change x by (Xv)\n    if <touching (platform v)?> then\n        change y by (1)\n        if <touching (platform v)?> then\n            change y by (1)\n            if <touching (platform v)?> then\n                change y by (1)\n                if <touching (platform v)?> then\n                    change y by (1)\n                    if <touching (platform v)?> then\n                        change y by (1)\n                        if <touching (platform v)?> then\n                            change x by ((Xv) * (-1))\n                            if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > (y position)>>> then\n                                if <(Xv) > [0]> then\n                                    set [xv v] to [5]\n                                else\n                                    set [xv v] to [-5]\n                                end\n                                set [yv v] to [12]\n                            else\n                                set [xv v] to [0]\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change [yv v] by (-1)\n    change y by (Yv)\n    if <touching (platform v)?> then\n        change y by ((Yv) * (-1))\n        set [yv v] to [0]\n    end\n    change y by (-1)\n    if <touching (platform v)?> then\n        if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > (y position)>>> then\n            set [yv v] to [15]\n        end\n    end\n    if <touching (water v)?> then\n        if <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <(mouse x) > (x position)>>> then\n            change [xv v] by (-00.9)\n        end\n        if <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <(mouse x) > (x position)>>> then\n            change [xv v] by (0.9)\n        end\n        if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > (y position)>>> then\n            set [yv v] to [2]\n        end\n    end\n    if <touching (marshmello v)?> then\n        set [yv v] to [20]\n    end\n    change y by (1)\n    if <key (r v) pressed?> then\n        reset\n    end\n    if <<<(y position) < [-177]> or <touching (danger v)?>> or <touching (lava variable v)?>> then\n        start sound [Death v]\n        reset\n    end\n    if <(x position) > [230]> then\n        change [level v] by (1)\n        broadcast (Next level! v)\n        reset\n    end\nend\n\nwhen flag clicked\nforever\n    play sound [Nebula v] until done\nend\n\nwhen I receive [y vel  v]\nset [yv v] to [20]\n\n@Platform\n\nwhen flag clicked\nshow\ngo to [front v] layer\nswitch costume to (costume1 v)\n\nwhen I receive [next level! v]\nnext costume\n\n@Danger\n\nwhen flag clicked\nhide\ngo to [back v] layer\n\nwhen flag clicked\nforever\n    if <(level) = [2]> then\n        show\n        go to [front v] layer\n        switch costume to (costume1 v)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(level) = [3]> then\n        show\n        go to [front v] layer\n        switch costume to (costume2 v)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(level) = [4]> then\n        hide\n        go to [back v] layer\n    end\nend\n\nwhen flag clicked\nforever\n    if <(level) = [7]> then\n        show\n        go to [front v] layer\n        switch costume to (costume3 v)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(level) = [8]> then\n        show\n        go to [front v] layer\n        switch costume to (costume4 v)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(level) = [9]> then\n        hide\n        go to [back v] layer\n    end\nend\n\nwhen flag clicked\nforever\n    if <(level) = [10]> then\n        show\n        go to [front v] layer\n        switch costume to (costume5 v)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(level) = [11]> then\n        show\n        go to [front v] layer\n        switch costume to (costume6 v)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(level) = [12]> then\n        show\n        go to [front v] layer\n        switch costume to (costume7 v)\n    end\nend\n\n@Water\n\nwhen flag clicked\nhide\ngo to [back v] layer\n\nwhen flag clicked\nforever\n    if <(level) = [6]> then\n        show\n        go to [front v] layer\n        switch costume to (costume1 v)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(level) = [7]> then\n        hide\n        go to [back v] layer\n        switch costume to (costume1 v)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(level) = [9]> then\n        show\n        go to [front v] layer\n        switch costume to (costume2 v)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(level) = [10]> then\n        hide\n        go to [back v] layer\n        switch costume to (costume1 v)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(level) = [11]> then\n        show\n        go to [back v] layer\n        switch costume to (costume3 v)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(level) = [12]> then\n        hide\n        go to [back v] layer\n        switch costume to (costume1 v)\n    end\nend\n\n@Toaster\n\nwhen flag clicked\nhide\ngo to [back v] layer\n\nwhen flag clicked\nforever\n    if <(level) = [7]> then\n        go to x: (36) y: (28)\n        show\n        go to [front v] layer\n    end\nend\n\nwhen flag clicked\nswitch costume to (costume1 v)\nforever\n    if <touching (player v)?> then\n        repeat (4)\n            next costume\n        end\n        start sound [Low Whoosh v]\n        broadcast (y vel  v)\n        repeat (4)\n            switch costume to ((costume [number v]) - (1))\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    if <(level) = [2]> then\n        go to x: (-63) y: (5)\n        show\n        go to [front v] layer\n    end\nend\n\nwhen flag clicked\nforever\n    if <(level) = [3]> then\n        hide\n        go to [back v] layer\n    end\nend\n\nwhen flag clicked\nforever\n    if <(level) = [8]> then\n        hide\n        go to [back v] layer\n    end\nend\n\nwhen flag clicked\nforever\n    if <(level) = [11]> then\n        go to x: (-49) y: (26)\n        show\n        go to [front v] layer\n    end\nend\n\nwhen flag clicked\nforever\n    if <(level) = [12]> then\n        go to x: (-5) y: (29)\n        show\n        go to [front v] layer\n    end\nend\n\n@Win\n\nwhen flag clicked\nhide\ngo to [back v] layer\nclear graphic effects\n\nwhen flag clicked\nforever\n    if <(level) = [13]> then\n        show\n        go to [front v] layer\n        switch costume to (costume1 v)\n        set [ghost v] effect to (100)\n        repeat (10)\n            change [ghost v] effect by (-10)\n        end\n        stop [this script v]\n    else\n        hide\n        go to [back v] layer\n    end\nend\n\n@Thumbnail\n\nwhen flag clicked\nhide\ngo to [back v] layer\n\n