Green || a mobile friendly Platformer
@Stage\n\nwhen flag clicked\nswitch backdrop to (bühnenbild3 v)\n\nwhen flag clicked\nset [level v] to [0]\n\nwhen flag clicked\nstart sound [hush v]\n\nwhen I receive [start v]\nstop all sounds\nplay sound [Tap Conga v] until done\nforever\n    repeat until <([costume name v] of [ground v]) = [end]>\n        play sound [Nebula v] until done\n    end\nend\n\nwhen flag clicked\nforever\n    if <([costume name v] of [sound v]) = [2]> then\n        repeat until <not <([costume name v] of [sound v]) = [2]>>\n            set volume to (0) %\n        end\n    end\n    if <([costume name v] of [sound v]) = [1]> then\n        set volume to (100) %\n    end\nend\n\nwhen flag clicked\nforever\n    if <([costume name v] of [ground v]) = [end]> then\n        stop all sounds\n        play sound [Bad Pitch v] until done\n    end\nend\n\nwhen I receive [main menü v]\nforever\n    if <(level) = [10]> then\n        switch backdrop to (backdrop1 v)\n    end\n    if <(level) = [14]> then\n        switch backdrop to (bühnenbild2 v)\n    end\nend\n\nswitch backdrop to (bühnenbild2 v)\n\nwhen I receive [main menü v]\nstop all sounds\nplay sound [Plugged \(post mastering\) v] until done\n\n@blank\n\n@Game\n\n@player\n\nwhen I receive [change level v]\nset [death v] to [0]\ngo to x: (-180) y: (15)\n\nwhen flag clicked\nforever\n    if <<<touching (spikes v)?> or <touching (enemies v)?>> or <touching (shredder v)?>> then\n        change [death v] by (1)\n        start sound [pop v]\n        go to x: (-180) y: (15)\n    end\n    if  then\n        change [death v] by (1)\n        start sound [pop v]\n        go to x: (-180) y: (15)\n    end\nend\n\nwhen flag clicked\nforever\n    if <touching (trampoline v)?> then\n        start sound [smw_spring_jump @ToadfanSchool v]\n        broadcast (jump v)\n        set [yv v] to [22]\n    end\nend\n\nwhen I receive [start v]\nset [death v] to [0]\nshow\ngo to x: (-180) y: (15)\nset [level v] to [0]\nset [xv v] to [0]\nset [yv v] to [0]\nforever\n    if <(mode) = [play]> then\n        if <([costume name v] of [costume change v]) = [normal]> then\n            switch costume to (normal v)\n        end\n        if <([costume name v] of [costume change v]) = [green]> then\n            switch costume to (green v)\n        end\n        if <<<key (right arrow v) pressed?> or <<mouse down?> and <(x position) < (mouse x)>>> or <key (d v) pressed?>> then\n            if <([costume name v] of [costume change v]) = [normal]> then\n                switch costume to (right v)\n                change [xv v] by (1)\n            end\n            if <([costume name v] of [costume change v]) = [green]> then\n                switch costume to (green v)\n                change [xv v] by (1)\n            end\n        end\n        if <<<key (left arrow v) pressed?> or <<mouse down?> and <(mouse x) < (x position)>>> or <key (a v) pressed?>> then\n            if <([costume name v] of [costume change v]) = [normal]> then\n                switch costume to (left v)\n                change [xv v] by (-1)\n            end\n            if <([costume name v] of [costume change v]) = [green]> then\n                switch costume to (green v)\n                change [xv v] by (-1)\n            end\n        end\n        if <<<key (down arrow v) pressed?> or <<mouse down?> and <(mouse y) < (y position)>>> or <key (s v) pressed?>> then\n            if <([costume name v] of [costume change v]) = [normal]> then\n                switch costume to (down v)\n            end\n            if <([costume name v] of [costume change v]) = [green]> then\n                switch costume to (green little v)\n            end\n        end\n        set [xv v] to ((Xv) * (0.9))\n        change x by (Xv)\n        if <<touching (ground v)?> or <touching (moving plattform v)?>> then\n            change y by (1)\n            if <<touching (ground v)?> or <touching (moving plattform v)?>> then\n                change y by (1)\n                if <<touching (ground v)?> or <touching (moving plattform v)?>> then\n                    change y by (1)\n                    if <<touching (ground v)?> or <touching (moving plattform v)?>> then\n                        change y by (1)\n                        if <<touching (ground v)?> or <touching (moving plattform v)?>> then\n                            change y by (1)\n                            if <<touching (ground v)?> or <touching (moving plattform v)?>> then\n                                change x by ((Xv) * (-1))\n                                change y by (-5)\n                                if <<key (up arrow 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 [10]\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 (ground v)?> or <touching (moving plattform v)?>> then\n            change y by ((Yv) * (-1))\n            set [yv v] to [0]\n        end\n        change y by (-1)\n        if <<touching (ground v)?> or <touching (moving plattform v)?>> then\n            if <<<<key (up arrow v) pressed?> or <<mouse down?> and <(mouse y) > (y position)>>> or <key (space v) pressed?>> or <key (w v) pressed?>> then\n                set [yv v] to [15]\n            end\n        end\n        change y by (1)\n        if <(x position) > [240]> then\n            change [level v] by (1)\n            broadcast (change level v)\n        end\n    end\nend\n\nwhen flag clicked\nhide\n\nwhen flag clicked\nforever\n    if <touching (teleport v)?> then\n        if <<([costume name v] of [ground v]) = [18]> or <([costume name v] of [ground v]) = [19]>> then\n            start sound [Teleport v]\n            set [mode v] to [screen pause]\n            repeat (40)\n                change [ghost v] effect by (2)\n            end\n            go to x: (185) y: (-10)\n            repeat (40)\n                change [ghost v] effect by (-2)\n            end\n            set [mode v] to [play]\n        end\n        if <([costume name v] of [ground v]) = [21]> then\n            start sound [Teleport v]\n            set [mode v] to [screen pause]\n            repeat (40)\n                change [ghost v] effect by (2)\n            end\n            go to x: (-114) y: (-50)\n            repeat (40)\n                change [ghost v] effect by (-2)\n            end\n            set [mode v] to [play]\n        end\n        if <([costume name v] of [ground v]) = [25]> then\n            start sound [Teleport v]\n            set [mode v] to [screen pause]\n            repeat (40)\n                change [ghost v] effect by (2)\n            end\n            go to x: (186) y: (-37)\n            repeat (40)\n                change [ghost v] effect by (-2)\n            end\n            set [mode v] to [play]\n        end\n        if <([costume name v] of [ground v]) = [27]> then\n            start sound [Teleport v]\n            set [mode v] to [screen pause]\n            repeat (40)\n                change [ghost v] effect by (2)\n            end\n            go to x: (209) y: (-45)\n            repeat (40)\n                change [ghost v] effect by (-2)\n            end\n            set [mode v] to [play]\n        end\n    end\nend\n\nwhen I receive [restart v]\ngo to x: (-180) y: (15)\n\n@spikes\n\nwhen flag clicked\nset [ghost v] effect to (0)\nswitch costume to (0 v)\nshow\ngo to [back v] layer\n\nforever\n\nwhen I receive [change level v]\nnext costume\n\n@ground\n\nwhen flag clicked\nswitch costume to (0 v)\n\nwhen flag clicked\nhide\nforever\n    go to x: (2) y: (-1)\nend\n\nwhen I receive [change level v]\nnext costume\n\nwhen I receive [start v]\nshow\n\n@shredder\n\ndefine clone at (x) (y)\ngo to x: (x) y: (y)\ncreate clone of (_myself_ v)\n\nwhen I receive [change level v]\nhide\nif <([costume name v] of [ground v]) = [14]> then\n    clone at [0] [-120]\nend\n\nwhen flag clicked\nforever\n    go to [back v] layer\nend\n\nwhen I start as a clone\nshow\nforever\n    turn right (3) degrees\nend\n\n@intro\n\ndefine Smooth Glide X: (x) Y: (y) Speed: (speed)\nrepeat until <<(round (x position)) = (round (x))> and <(round (y position)) = (round (y))>>\n    change x by (((round (x)) - (round (x position))) / (speed))\n    change y by (((round (y)) - (round (y position))) / (speed))\nend\ngo to x: (x) y: (y)\n\nwhen flag clicked\nreset timer\nshow\nswitch costume to (2 v)\ngo to x: (0) y: (0)\nswitch backdrop to (bühnenbild2 v)\nset size to (1) %\nrepeat until <(size) > [240]>\n    change size by (5)\n    turn right ((timer) * (40)) degrees\nend\npoint in direction (90)\n\nwhen flag clicked\nwait until <(size) > [240]>\nrepeat (3)\n    repeat (7)\n        change size by (0)\n    end\n    wait () seconds\n    repeat (7)\n        change size by (0)\n    end\n    wait () seconds\nend\nSmooth Glide X: [-180] Y: [0] Speed: [3]\nSmooth Glide X: [180] Y: [0] Speed: [3]\nSmooth Glide X: [0] Y: [0] Speed: [3]\nSmooth Glide X: [0] Y: [120] Speed: [3]\nSmooth Glide X: [0] Y: [-120] Speed: [3]\nSmooth Glide X: [0] Y: [0] Speed: [3]\n\nwhen flag clicked\nwait until <(size) > [240]>\nrepeat (12)\n    repeat (7)\n        change size by (20)\n    end\n    wait () seconds\n    repeat (7)\n        change size by (-20)\n    end\n    wait () seconds\nend\nswitch costume to (kostüm1 v)\nset size to (100) %\nswitch costume to (slide v)\nrepeat (45)\n    change x by (-30)\n    change y by (15)\nend\nset x to (0)\nhide\nbroadcast (main menü v)\n\nwhen flag clicked\nforever\n    if <(x position) < [-508]> then\n        broadcast (thx v)\n        switch backdrop to (bühnenbild2 v)\n    end\nend\n\n@thing\n\nwhen I receive [change level v]\nhide\nif <(level) = [27]> then\n    broadcast (move thing v)\n    go to x: (36) y: (-70)\nend\n\nwhen I receive [move thing v]\nshow\nforever\n    if <(level) = [27]> then\n        repeat (60)\n            change y by (2)\n        end\n        repeat (60)\n            change y by (-2)\n        end\n    end\nend\n\nwhen flag clicked\nhide\n\n@teleport\n\nwhen flag clicked\nhide\n\nwhen I receive [change level v]\nhide\nif <([costume name v] of [ground v]) = [18]> then\n    switch costume to (normal v)\n    go to x: (0) y: (0)\n    show\nend\nif <([costume name v] of [ground v]) = [19]> then\n    switch costume to (normal v)\n    go to x: (0) y: (0)\n    show\nend\nif <([costume name v] of [ground v]) = [21]> then\n    switch costume to (normal2 v)\n    go to x: (0) y: (0)\n    show\nend\nif <([costume name v] of [ground v]) = [25]> then\n    switch costume to (normal3 v)\n    go to x: (0) y: (0)\n    show\nend\nif <([costume name v] of [ground v]) = [27]> then\n    switch costume to (normal4 v)\n    go to x: (0) y: (0)\n    show\nend\n\n@tele lol\n\nwhen flag clicked\nhide\n\nwhen I receive [change level v]\nhide\nif <([costume name v] of [ground v]) = [18]> then\n    switch costume to (normal v)\n    show\nend\nif <([costume name v] of [ground v]) = [19]> then\n    switch costume to (normal2 v)\n    show\nend\nif <([costume name v] of [ground v]) = [21]> then\n    switch costume to (normal3 v)\n    show\nend\nif <([costume name v] of [ground v]) = [25]> then\n    switch costume to (normal4 v)\n    show\nend\nif <([costume name v] of [ground v]) = [27]> then\n    switch costume to (normal5 v)\n    show\nend\n\n@trampoline\n\ndefine clone at (x) (y)\ngo to x: (x) y: (y)\ncreate clone of (_myself_ v)\n\n\n\nwhen [m v] key pressed\nshow variable [mouse v]\nrepeat until <key (space v) pressed?>\n    set [mouse v] to (join [x:] (join (mouse x) (join [,] (join [y:] (mouse y)))))\nend\n\nwhen I start as a clone\ngo to [back v] layer\nshow\nforever\n    switch costume to (kostüm1 v)\n    if <touching (player v)?> then\n        repeat (8)\n            next costume\n        end\n    end\nend\n\nwhen flag clicked\nset [mode v] to [play]\n\nwhen I receive [change level v]\ngo to [back v] layer\nhide\nwait (0000) seconds\nif <([costume name v] of [ground v]) = [3]> then\n    clone at [95] [-105]\nend\nif <([costume name v] of [ground v]) = [4]> then\n    clone at [-80] [-105]\n    clone at [30] [-105]\n    clone at [140] [-105]\nend\nif <([costume name v] of [ground v]) = [21]> then\n    clone at [115] [-106]\nend\n\n@enemies\n\nwhen flag clicked\nhide\n\nwhen I receive [change level v]\nhide\nif <(level) = [6]> then\n    broadcast (enemie walk v)\n    go to x: (10) y: (-93)\nend\nif <(level) = [7]> then\n    broadcast (enemie walk v)\n    go to x: (-90) y: (-93)\nend\nif <(level) = [16]> then\n    broadcast (enemie walk v)\n    go to x: (120) y: (-93)\nend\n\nwhen I receive [enemie walk v]\nshow\nforever\n    if <(level) = [6]> then\n        repeat (30)\n            change x by (5)\n        end\n        repeat (30)\n            change x by (-5)\n        end\n    end\n    if <(level) = [7]> then\n        repeat (30)\n            change x by (5)\n        end\n        repeat (30)\n            change x by (-5)\n        end\n    end\n    if <(level) = [16]> then\n        repeat (17)\n            change x by (5)\n        end\n        repeat (17)\n            change x by (-5)\n        end\n    end\nend\n\n@enemies2\n\nwhen flag clicked\nhide\n\nwhen I receive [change level v]\nhide\nif <(level) = [16]> then\n    broadcast (enemie walk 2 v)\n    go to x: (-125) y: (-93)\nend\n\nwhen I receive [enemie walk 2 v]\nshow\nforever\n    repeat (15)\n        change x by (5)\n    end\n    repeat (15)\n        change x by (-5)\n    end\nend\n\n@Thumbnail\n\nwhen flag clicked\ngo to x: (2) y: (-3)\nset [ghost v] effect to (100)\nforever\n    go to [front v] layer\nend\n\n@Sprite2\n\nwhen flag clicked\nhide\n\nwhen I receive [start v]\nhide\n\nwhen I receive [thx v]\nshow\ngo to [back v] layer\nforever\n    set y to ((0) + ((3) * ([sin v] of ((timer) * (100)) )))\nend\n\n@effekt\n\nwhen flag clicked\ngo to x: (241) y: (-180)\nhide\nforever\n    go to [back v] layer\n    create clone of (_myself_ v)\n    wait (0.4) seconds\nend\n\nwhen I start as a clone\nif <(mode) = [play]> then\n    set [color v] effect to (0)\n    point in direction (-90)\n    go to x: (228) y: (pick random (-180) to (180))\n    set [ghost v] effect to (83)\n    repeat until <touching (_edge_ v)?>\n        move (2) steps\n    end\n    delete this clone\nend\n\nwhen I receive [start v]\nshow\n\n@comments\n\nwhen flag clicked\ngo to [front v] layer\nswitch costume to (1 v)\n\nwhen flag clicked\ngo to [front v] layer\nhide\nforever\n    go to x: (2) y: (-1)\nend\n\nwhen I receive [change level v]\ngo to [back v] layer\nnext costume\n\nwhen I receive [start v]\ngo to [front v] layer\nshow\n\n@Sprite3\n\nwhen I receive [start v]\nhide\n\nwhen flag clicked\nhide\n\nwhen I receive [main menü v]\nforever\n    if <touching (mouse-pointer v)?> then\n        set [ghost v] effect to (20)\n    end\n    if <not <touching (mouse-pointer v)?>> then\n        set [ghost v] effect to (0)\n    end\nend\n\nwhen I receive [thx v]\nshow\ngo to [back v] layer\nforever\n    point in direction ((90) + ((3) * ([sin v] of ((timer) * (70)) )))\n    set y to ((0) + ((3) * ([sin v] of ((timer) * (100)) )))\nend\n\n@play\n\nwhen flag clicked\nhide\n\nset size to (100) %\n\nset size to (90) %\n\nwhen I receive [start v]\nhide\n\nwhen I receive [main menü v]\nshow\nforever\n    if <<<mouse down?> and <touching (mouse-pointer v)?>> or <key (space v) pressed?>> then\n        broadcast (start v) and wait\n    end\n    set [size5 v] to ((((size5) * (1.8)) + (((40) + (<touching (mouse-pointer v)?> * (10))) + ([sin v] of ((timer) * (100)) ))) / (2.2))\n    set size to (size5) %\nend\n\nwhen I receive [thx v]\nshow\nforever\n    point in direction ((90) + ((4) * ([sin v] of ((timer) * (70)) )))\n    set y to ((-90) + ((4) * ([sin v] of ((timer) * (110)) )))\nend\n\nwhen I receive [main menü v]\nforever\n    if <touching (mouse-pointer v)?> then\n        set [ghost v] effect to (40)\n    end\n    if <not <touching (mouse-pointer v)?>> then\n        set [ghost v] effect to (0)\n    end\nend\n\n@play2\n\nwhen I receive [start v]\nhide\n\nwhen flag clicked\nhide\n\nwhen I receive [thx v]\nshow\nforever\n    if  then\n        start sound [Tap Conga v]\n        broadcast (change costume v)\n        wait until <not <mouse down?>>\n    end\n    set [size 4 v] to ((((size 4) * (1.6)) + (((40) + (<touching (mouse-pointer v)?> * (10))) + ([sin v] of ((timer) * (100)) ))) / (2.2))\n    set size to (size 4) %\nend\n\nwhen I receive [thx v]\nshow\nforever\n    set y to ((-2) + ((3) * ([sin v] of ((timer) * (100)) )))\nend\n\nwhen I receive [main menü v]\nforever\n    if <touching (mouse-pointer v)?> then\n        set [ghost v] effect to (40)\n    end\n    if <not <touching (mouse-pointer v)?>> then\n        set [ghost v] effect to (0)\n    end\nend\n\n@costume change\n\nwhen flag clicked\nhide\n\nwhen I receive [start v]\nhide\n\nwhen I receive [change costume v]\nnext costume\n\nwhen I receive [thx v]\nshow\nswitch costume to (normal v)\nforever\n    set y to ((-10) + ((3) * ([sin v] of ((timer) * (100)) )))\nend\n\n@water\n\nwhen flag clicked\nhide\nforever\n    go [backward v] (1) layers\nend\n\ngo to [back v] layer\n\nwhen I receive [start v]\nshow\nforever\n    go to x: (0) y: (0)\n    repeat (10)\n        change y by (1)\n    end\n    repeat (10)\n        change y by (-1)\n    end\nend\n\nset [me v] to [1]\nset [brightness v] effect to (20)\nrepeat (3)\n    create clone of (_myself_ v)\n    change [brightness v] effect by (-10)\n    change [me v] by (1)\nend\n\nwhen I start as a clone\nset [ghost v] effect to (40)\nforever\n    set y to ((([sin v] of (((timer) + (me)) * (300)) ) * (10)) - (5))\n    point in direction ((90) + (([sin v] of (((timer) + (me)) * (200)) ) * (2)))\nend\n\n@Sprite1\n\nwhen flag clicked\nhide\n\nwhen I receive [main menü v]\ngo to [back v] layer\nforever\n    if <(mouse y) > [130]> then\n        show\n        repeat (5)\n            change y by (-2)\n        end\n        repeat until <(mouse y) < [130]>\n            set y to (-1)\n        end\n    end\n    if <(mouse y) < [130]> then\n        repeat (5)\n            change y by (2)\n        end\n        hide\n    end\nend\n\nwhen flag clicked\ngo [forward v] (200) layers\ngo to x: (0) y: (25)\nhide\n\n    set [ghost v] effect to (40)\nend\n\n@sound\n\nwhen flag clicked\n\nwhen flag clicked\ngo to [front v] layer\ngo to x: (-214) y: (190)\nhide\n\nwhen flag clicked\n\nwhen I receive [main menü v]\nforever\n    if <(mouse y) > [130]> then\n        show\n        repeat (5)\n            change y by (-2)\n        end\n        repeat until <(mouse y) < [130]>\n            set y to (167)\n        end\n    end\n    if <(mouse y) < [130]> then\n        repeat (5)\n            change y by (2)\n        end\n        hide\n    end\nend\n\nwhen I receive [main menü v]\nswitch costume to (1 v)\nforever\n    if <<touching (mouse-pointer v)?> and <mouse down?>> then\n        start sound [Tap Conga v]\n        next costume\n        wait until <not <mouse down?>>\n    end\nend\n\n@moving plattform\n\nwhen flag clicked\nhide\nforever\n    if <([costume name v] of [ground v]) = [16]> then\n        show\n        broadcast (move platform v)\n        \n    else\n        hide\n    end\n    if <not <([costume name v] of [ground v]) = [16]>> then\n        repeat until <([costume name v] of [ground v]) = [16]>\n            hide\n        end\n    end\nend\n\nwhen I receive [move platform v]\ngo to x: (-2) y: (-1)\nforever\n    repeat (110)\n        change x by (2)\n    end\n    repeat (110)\n        change x by (-2)\n    end\nend\n\nshow\nbroadcast (move platform v)\n\n\nwhen flag clicked\nforever\n    if <([costume name v] of [ground v]) > [16]> then\n        hide\n    end\nend\n\n@pause\n\nwhen flag clicked\ngo to x: (-180) y: (190)\nhide\n\nwhen I receive [start v]\nswitch costume to (4_ v)\nforever\n    if <<touching (mouse-pointer v)?> and <mouse down?>> then\n        start sound [Tap Conga v]\n        next costume\n        wait until <not <mouse down?>>\n    end\nend\n\nwhen I receive [start v]\nforever\n    if <(mouse y) > [130]> then\n        show\n        repeat (5)\n            change y by (-2)\n        end\n        repeat until <(mouse y) < [130]>\n            set y to (167)\n        end\n    end\n    if <(mouse y) < [130]> then\n        repeat (5)\n            change y by (2)\n        end\n        hide\n    end\nend\n\nwhen I receive [start v]\nforever\n    if <(costume [number v]) = [2]> then\n        set [mode v] to [pause]\n    end\n    if <(costume [number v]) = [1]> then\n        set [mode v] to [play]\n        wait until <(costume [number v]) = [2]>\n    end\nend\n\n@restart\n\nwhen flag clicked\ngo to x: (-145) y: (190)\nhide\n\nwhen I receive [start v]\nswitch costume to (4_ v)\nforever\n    if <<touching (mouse-pointer v)?> and <mouse down?>> then\n        broadcast (restart v)\n        start sound [Tap Conga v]\n        wait until <not <mouse down?>>\n    end\nend\n\nwhen I receive [start v]\ngo to [back v] layer\ngo [forward v] (400) layers\nforever\n    if <(mouse y) > [130]> then\n        show\n        repeat (5)\n            change y by (-2)\n        end\n        repeat until <(mouse y) < [130]>\n            set y to (167)\n        end\n    end\n    if <(mouse y) < [130]> then\n        repeat (5)\n            change y by (2)\n        end\n        hide\n    end\nend\n\n@Figur1\n\nwhen flag clicked\nhide\ngo to x: (208) y: (166)\n\nwhen I receive [start v]\ngo to [front v] layer\nforever\n    if <<(death) = [5]> or <(death) > [5]>> then\n        show\n        if <<mouse down?> and <touching (mouse-pointer v)?>> then\n            broadcast (change level v)\n            change [level v] by (1)\n        end\n        wait until <not <mouse down?>>\n    end\n    if <(death) < [5]> then\n        hide\n    end\nend\n\n
Welcome my 1st Platformer!\n\n\nMove with arrow keys. Avoid Spikes and enemies.\nIf you die 5 times you can skip the level!\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n