Levels Of Platformers || A Platformer 


@Stage\n\n@player\n\nwhen I start as a clone\nswitch costume to (trail v)\nrepeat (10)\n    change [ghost v] effect by (10)\n    change size by (-2)\nend\ndelete this clone\n\nwhen I receive [restart v]\nstart sound [Crunch v]\nset [x v] to [0]\nset [y v] to [0]\nshow\nclear graphic effects\ngo to x: (x spawn) y: (y spawn)\n\nset rotation style [left-right v]\n\nrepeat (10)\n    change y by (6)\n    change [ghost v] effect by (10)\nend\n\nrepeat (10)\n    change y by (-1)\n    change [ghost v] effect by (-10)\nend\n\nhide\n\ndefine run engine\nchange [y v] by (-0.5)\nif < or <key (a v) pressed?>> then\n    change [x v] by (-0.75)\n    point in direction (-90)\nend\nif < or <key (d v) pressed?>> then\n    change [x v] by (0.75)\n    point in direction (90)\nend\nset [x v] to ((x) * (0.88))\nchange x by (x)\nif <touching (ground v)?> then\n    change y by (1)\n    if <touching (ground v)?> then\n        change y by (1)\n        if <touching (ground v)?> then\n            change y by (1)\n            if <touching (ground v)?> then\n                change y by (1)\n                if <touching (ground v)?> then\n                    change y by (1)\n                    if <touching (ground v)?> then\n                        change y by (1)\n                        if <touching (ground v)?> then\n                            change y by (-6)\n                            change x by ((x) * (-1))\n                            if <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n                                set [y v] to [10]\n                                if <(x) > [0]> then\n                                    set [x v] to [-10]\n                                else\n                                    set [x v] to [0]\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\nchange y by (y)\nif <touching (ground v)?> then\n    change y by ((y) * (-1))\n    set [y v] to [0]\nend\nchange y by (-0.5)\nif <<key (down arrow v) pressed?> or < or <key (s v) pressed?>>> then\n    switch costume to (costume3 v)\nelse\n    switch costume to (costume1 v)\nend\nif <<<touching (ground v)?> and <key (up arrow v) pressed?>> or < or <<touching (ground v)?> and <key (w v) pressed?>>>> then\n    set [y v] to [7]\nend\nchange y by (0.5)\nif <<touching (danger v)?> or <<touching (saw v)?> or <<touching (lava v)?> or <touching (moving spikes v)?>>>> then\n    broadcast (Restart v)\nend\nif <touching (bounce pads v)?> then\n    set [y v] to [12]\n    start sound [Jump v]\nend\nif <touching (flag v)?> then\n    broadcast (next v)\n    change [level v] by (1)\n    go to x: (x spawn) y: (y spawn)\n    set [x v] to [0]\n    set [y v] to [0]\nend\n\nset [moving_? v] to [y]\n\nset [moving_? v] to [y]\n\nset [moving_? v] to [y]\n\nset [moving_? v] to [n]\n\npoint in direction (90)\ngo to x: (x spawn) y: (y spawn)\n\nwhen I receive [next v]\ngo to x: (x spawn) y: (y spawn)\n\nwhen I receive [begin now v]\nset rotation style [left-right v]\nset [level v] to [1]\nshow\nset [x spawn v] to [-199]\nset [y spawn v] to [-76]\ngo to x: (x spawn) y: (y spawn)\nswitch costume to (1 v)\nswitch backdrop to (backdrop3 v)\nset size to (20) %\nset [x v] to [0]\nset [y v] to [0]\nforever\n    run engine\nend\n\nset [moving_? v] to [y]\n\nwhen flag clicked\nforever\n    switch costume to (costume1 v)\nend\n\nwhen flag clicked\nforever\n    if <<<key (left arrow v) pressed?> or <<<key (right arrow v) pressed?> or > or <key (d v) pressed?>>> or <key (a v) pressed?>> then\n        set [moving_? v] to [y]\n    else\n        set [moving_? v] to [n]\n    end\nend\n\nif <<<touching (ground v)?> and <key (up arrow v) pressed?>> or <<touching (ground v)?> and <key (w v) pressed?>>> then\n    set [moving_? v] to [up]\nend\n\n\n\nif <(MOVING_?) = [u]> then\n    switch costume to (up v)\nend\n\nif <(y position) > [-60]> then\n    set [moving_? v] to [u]\nelse\n    set [moving_? v] to [n]\nend\n\nrepeat until <(costume [number v]) = [6]>\n\nset [moving_? v] to [n]\n\nif <(MOVING_?) = [y]> then\n    wait (.01) seconds\n    next costume\nelse\n    switch costume to (1 v)\nend\n\ncreate clone of (_myself_ v)\n\nforever\n    if <(MOVING_?) = [y]> then\n        wait (.01) seconds\n        next costume\n    else\n        switch costume to (1 v)\n    end\nend\n\nwhen I receive [begin now v]\nwait (.1) seconds\nbroadcast (go v)\n\nwhen flag clicked\nforever\n    if <(dark mode?) = [y]> then\n        switch costume to (costume2 v)\n    else\n        switch costume to (costume1 v)\n    end\nend\n\nwhen I start as a clone\n\nwhen flag clicked\nbroadcast (BEGIN NOW v)\n\nwhen flag clicked\nforever\n    if <touching (enemy ai v)?> then\n        broadcast (Restart v)\n    end\nend\n\n@Enemy AI\n\nwhen flag clicked\ngo to x: (200) y: (-30)\nwait (8.8) seconds\nset size to (20) %\nforever\n    switch costume to (button3-b v)\n    go to [back v] layer\n    if <([x position v] of [player v]) > (x position)> then\n        change [xv v] by (.5)\n        switch costume to (button3-b2 v)\n    end\n    if <(x position) > ([x position v] of [player v])> then\n        change [xv v] by (-.5)\n        switch costume to (button3-b3 v)\n    end\n    set [xv v] to ((XV) * (0.9))\n    change x by (XV)\n    if <touching (ground v)?> then\n        change y by (2)\n        if <touching (ground v)?> then\n            change y by (2)\n            if <touching (ground v)?> then\n                change y by (2)\n                if <touching (ground v)?> then\n                    change y by (2)\n                    if <touching (ground v)?> then\n                        change y by (2)\n                        if <touching (ground v)?> then\n                            change x by ((XV) * (-2))\n                            change y by (-5)\n                            if <([x position v] of [player v]) > (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 [13]\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 (-0.8)\n    change y by (YV)\n    if <touching (ground 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)?> then\n        if <([x position v] of [player v]) > (y position)> then\n            set [yv v] to [12]\n        end\n    end\n    change y by (1)\n    if <<([x position v] of [player v]) > (y position)> and <touching (ground v)?>> then\n        set [yv v] to [20]\n    end\nend\n\nwhen I receive [restart v]\ngo to x: (200) y: (-30)\n\nwhen flag clicked\nforever\n    if <(level) = [7]> then\n        switch costume to (button3-b3 v)\n        show\n    else\n        if <(level) = [2]> then\n            switch costume to (button3-b v)\n            show\n        else\n            if <(level) = [10]> then\n                switch costume to (button3-b4 v)\n                show\n            else\n                if <(level) = [12]> then\n                    switch costume to (button3-b4 v)\n                    show\n                else\n                    hide\n                end\n            end\n        end\n    end\nend\n\nwhen I receive [next v]\ngo to x: (200) y: (-30)\n\nwhen I receive [skipepd v]\ngo to x: (200) y: (-30)\n\nshow\n\nif <(level) = [6]> then\n\n@Intro\n\nwhen I start as a clone\nif <(Clone) = [Particles]> then\n    switch costume to (pick random (29) to (31))\n    set size to (pick random (50) to (150)) %\n    set [ghost v] effect to (pick random (0.) to (5.))\n    set [brightness v] effect to (pick random (-25.) to (100.))\n    go to x: (0) y: (0)\n    point in direction (pick random (-180) to (180))\n    set [x v] to (pick random (10.) to (12.))\n    set [i v] to (pick random (2.) to (9.))\n    go to [front v] layer\n    show\n    repeat until <touching (_edge_ v)?>\n        move (X) steps\n        change y by (I)\n        change [i v] by (-0.4)\n        set [x v] to ((X) * (0.95))\n    end\n    delete this clone\nend\n\ndefine Particles\nset [clone v] to [Particles]\nrepeat (50)\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nif <(Clone) = [Name]> then\n    switch costume to (name v)\n    set size to (50) %\n    clear graphic effects\n    go to [front v] layer\n    go to x: (0) y: (-100)\n    point in direction (0)\n    show\n    repeat (50)\n        go to [front v] layer\n        change size by (((130) - (size)) / (8))\n        change y by (((0) - (y position)) / (8))\n        turn right (((90) - (direction)) / (8)) degrees\n    end\n    set [i v] to [-1]\n    repeat (10)\n        go to [front v] layer\n        change size by (I)\n        change [i v] by (join [-] (([abs v] of (I) ) / (2)))\n        turn right (I) degrees\n    end\n    switch costume to (logo v)\n    repeat (40)\n        go to [front v] layer\n        change size by (((130) - (size)) / (8))\n        turn right (((90) - (direction)) / (8)) degrees\n    end\n    set [i v] to [-1]\n    repeat (20)\n        go to [front v] layer\n        change size by ((I) / (3))\n        change [i v] by (join [-] (([abs v] of (I) ) / (4)))\n        turn right ((I) / (-3)) degrees\n    end\n    delete this clone\nend\n\nwhen flag clicked\nreset timer\nhide\nstart sound [Prismo - Stronger v]\nset volume to (100) %\nclear graphic effects\nset size to (100) %\npoint in direction (90)\ngo to x: (0) y: (0)\nset [clone v] to [Square]\ncreate clone of (_myself_ v)\nwait (1) seconds\nset [clone v] to [Name]\ncreate clone of (_myself_ v)\nwait (0) seconds\nrepeat (2)\n    Spiral spline explosion\n    Particles\n    Rect\n    Spiral spline explosion\nend\nCircle\nrepeat (4)\n    Spiral spline explosion\n    Particles\n    Rect\n    Spiral spline explosion\nend\nCircle\nrepeat (2)\n    Spiral spline explosion\n    Rect\n    Spiral spline explosion\nend\n\nwhen I start as a clone\nif <(Clone) = [Square]> then\n    clear graphic effects\n    show\n    set size to (0) %\n    go to x: (0) y: (300)\n    point in direction (0)\n    switch costume to (square v)\n    repeat (20)\n        change size by (((100) - (size)) / (5))\n        turn right (((90) - (direction)) / (5)) degrees\n        change y by (((0) - (y position)) / (5))\n    end\n    point in direction (90)\n    repeat (12)\n        next costume\n    end\n    repeat (20)\n        switch costume to (blank v)\n        change size by (((2000) - (size)) / (5))\n        switch costume to (square13 v)\n    end\n    wait (3) seconds\n    repeat (20)\n        switch costume to (blank v)\n        change size by (((100) - (size)) / (5))\n        switch costume to (square13 v)\n    end\n    repeat (12)\n        switch costume to ((costume [number v]) - (1))\n        change size by (-5)\n    end\n    set [i v] to [-1]\n    repeat (20)\n        change size by ((I) / (3))\n        change [i v] by (join [-] (([abs v] of (I) ) / (4)))\n        turn right ((I) / (-3)) degrees\n        change y by ((I) / (3))\n    end\n    delete this clone\nend\n\nwhen I start as a clone\nif <(Clone) = [Bursts]> then\n    switch costume to (lineexplosion1 v)\n    clear graphic effects\n    go to [front v] layer\n    go [backward v] (1) layers\n    set [i v] to (pick random (1) to (3))\n    if <(I) = [1]> then\n        set [brightness v] effect to (100)\n    else\n        if <(I) = [2]> then\n            set [brightness v] effect to (25)\n        else\n            set [brightness v] effect to (-25)\n        end\n    end\n    show\n    set [i v] to [20]\n    Animate   x: [0] y: [0] size: [0] rotate: (pick random (-180) to (180)) speed: [1]\n    repeat (2)\n        set [i v] to ((I) * (0.9))\n        move (I) steps\n        Size: [100] speed: [5]\n    end\n    repeat (10)\n        set [i v] to ((I) * (0.9))\n        move (I) steps\n        Size: [100] speed: [5]\n        change [ghost v] effect by (10)\n        next costume\n    end\n    delete this clone\nend\n\ndefine Animate   x: (x) y: (y) size: (s) rotate: (r) speed: (s)\nchange x by (((round (x)) - (round (x position))) / (s))\nchange y by (((round (y)) - (round (y position))) / (s))\nchange size by (((round (s)) - (round (size))) / (s))\nturn right (((round (r)) - (round (direction))) / (s)) degrees\n\ndefine Spiral spline explosion\nset [clone v] to [Bursts]\nrepeat (5)\n    create clone of (_myself_ v)\nend\n\ndefine Size: (s) speed: (spd)\nchange size by (((round (s)) - (round (size))) / (spd))\n\ndefine Rect\nset [clone v] to [Rect]\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nif <(Clone) = [Rect]> then\n    clear graphic effects\n    show\n    set size to (0) %\n    go to (random position v)\n    point in direction (90)\n    switch costume to (background rect v)\n    repeat until <(round (size)) = [300]>\n        change size by (((300) - (size)) / (15))\n        change [ghost v] effect by (4)\n    end\n    delete this clone\nend\n\nwhen I start as a clone\nif <(Clone) = [Circle]> then\n    clear graphic effects\n    set [brightness v] effect to (100)\n    go to [front v] layer\n    go [backward v] (2) layers\n    show\n    set size to (0) %\n    go to x: (0) y: (0)\n    point in direction (90)\n    switch costume to (circle explosion 1 v)\n    repeat (20)\n        switch costume to (blank v)\n        change size by (((300) - (size)) / (5))\n        switch costume to (circle explosion 1 v)\n    end\n    delete this clone\nend\n\ndefine Circle\nset [clone v] to [Circle]\ncreate clone of (_myself_ v)\nwait (0.1) seconds\nset [clone v] to [Circle 2]\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nif <(Clone) = [Circle 2]> then\n    clear graphic effects\n    set [brightness v] effect to (0)\n    go to [front v] layer\n    go [backward v] (1) layers\n    show\n    set size to (0) %\n    go to x: (0) y: (0)\n    point in direction (90)\n    switch costume to (circle explosion 1 v)\n    repeat (20)\n        switch costume to (blank v)\n        change size by (((300) - (size)) / (5))\n        switch costume to (circle explosion 1 v)\n    end\n    delete this clone\nend\n\nwhen flag clicked\nforever\n    set [color v] effect to (150)\nend\n\nwhen I start as a clone\nforever\n    set [color v] effect to (145)\nend\n\nwhen flag clicked\nforever\n    if <(costume [name v]) = [Logo]> then\n        repeat until <not <(costume [name v]) = [Logo]>>\n            set [color v] effect to (0)\n        end\n    end\nend\n\nwhen I start as a clone\nforever\n    if <(costume [name v]) = [Logo]> then\n        repeat until <not <(costume [name v]) = [Logo]>>\n            set [color v] effect to (0)\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    go to [front v] layer\nend\n\n@ground\n\nwhen flag clicked\ngo to x: (0) y: (-8)\nforever\n    switch costume to (level)\nend\n\ngo to [front v] layer\n\nwhen I receive [next v]\n\nwhen flag clicked\nforever\n    if <(dark mode?) = [y]> then\n        set [brightness v] effect to (100)\n    else\n        set [brightness v] effect to (0)\n    end\nend\n\nwait (10) seconds\n\n@moving spikes\n\nwhen flag clicked\ngo to x: (0) y: (0)\nforever\n    switch costume to (level)\nend\n\nwhen flag clicked\nforever\n    glide (1) secs to x: (0) y: (15)\n    glide (1) secs to x: (0) y: (0)\nend\n\nwhen flag clicked\ngo to [back v] layer\nforever\n    if <(dark mode?) = [y]> then\n        set [brightness v] effect to (100)\n    else\n        set [brightness v] effect to (0)\n    end\nend\n\n@lava\n\nwhen flag clicked\ngo to x: (0) y: (0)\nforever\n    switch costume to (level)\nend\n\nwhen flag clicked\nforever\n    glide (1) secs to x: (0) y: (10)\n    glide (1) secs to x: (0) y: (0)\nend\n\ngo to [back v] layer\n\nwhen flag clicked\nset [ghost v] effect to (30)\n\n@saw\n\nwhen flag clicked\ngo to [front v] layer\nforever\n    go to [back v] layer\n    turn right (8) degrees\nend\n\nwhen flag clicked\nset size to (50) %\nforever\n    if <(level) = [2]> then\n        switch costume to (saw v)\n        show\n        go to x: (50) y: (-122)\n    else\n        if <(level) = [3]> then\n            show\n            go to x: (-30) y: (-21)\n        else\n            if <(level) = [5]> then\n                switch costume to (saw2 v)\n                show\n                go to x: (-30) y: (-53)\n            else\n                if <(level) = [6]> then\n                    switch costume to (saw2 v)\n                    show\n                    go to x: (-155) y: (27)\n                else\n                    if <(level) = [7]> then\n                        switch costume to (saw3 v)\n                        show\n                        go to x: (-140) y: (200)\n                    else\n                        if <(level) = [8]> then\n                            switch costume to (saw3 v)\n                            show\n                            go to x: (-140) y: (140)\n                        else\n                            if <(level) = [9]> then\n                                switch costume to (saw3 v)\n                                show\n                                go to x: (0) y: (0)\n                            else\n                                if <(level) = [10]> then\n                                    switch costume to (saw4 v)\n                                    show\n                                    go to x: (0) y: (0)\n                                else\n                                    if <(level) = [12]> then\n                                        switch costume to (saw4 v)\n                                        show\n                                        go to x: (0) y: (37)\n                                    else\n                                        hide\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\nif <<(level) = [4]> or <<(level) = [6]> or >> then\n    show\n    if <<(level) = [4]> or <(level) = [6]>> then\n        set size to (100) %\n        go to x: (0) y: (-120)\n    end\n    if <(level) = [10]> then\n        set size to (70) %\n        go to x: (-47) y: (-33)\n    end\nelse\n    hide\nend\n\nif <<(level) = [4]> or <(level) = [6]>> then\n    set size to (100) %\n    go to x: (0) y: (-120)\nend\nif <(level) = [10]> then\n    set size to (70) %\n    go to x: (-47) y: (-33)\nend\n\nwhen flag clicked\nforever\n    if <(dark mode?) = [y]> then\n        set [brightness v] effect to (100)\n    else\n        set [brightness v] effect to (0)\n    end\nend\n\ngo to x: (0) y: (-125)\n\nwhen flag clicked\nforever\n    if <(level) = [2]> then\n        change x by ((([sin v] of ((timer) * (200)) ) * (30)) + (0))\n    else\n        if <(level) = [3]> then\n            change x by ((([sin v] of ((timer) * (200)) ) * (30)) + (0))\n        else\n            if <(level) = [5]> then\n                change y by ((([sin v] of ((timer) * (200)) ) * (30)) + (0))\n            else\n                if <(level) = [6]> then\n                    change y by ((([sin v] of ((timer) * (200)) ) * (30)) + (0))\n                else\n                    if <(level) = [7]> then\n                        change y by ((([sin v] of ((timer) * (200)) ) * (30)) + (0))\n                    else\n                        if <(level) = [8]> then\n                            change x by ((([sin v] of ((timer) * (200)) ) * (30)) + (0))\n                            change y by ((([sin v] of ((timer) * (200)) ) * (30)) + (0))\n                        else\n                            if <(level) = [9]> then\n                                change x by ((([sin v] of ((timer) * (200)) ) * (30)) + (0))\n                                change y by ((([sin v] of ((timer) * (200)) ) * (30)) + (0))\n                                change size by ((([sin v] of ((timer) * (200)) ) * (2)) + (0))\n                            else\n                                if <(level) = [10]> then\n                                    change x by ((([sin v] of ((timer) * (200)) ) * (30)) + (0))\n                                    change y by ((([sin v] of ((timer) * (200)) ) * (30)) + (0))\n                                    change size by ((([sin v] of ((timer) * (200)) ) * (2)) + (0))\n                                else\n                                    if <(level) = [12]> then\n                                        change x by ((([sin v] of ((timer) * (200)) ) * (30)) + (0))\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\nchange x by ((([sin v] of ((timer) * (200)) ) * (30)) + (0))\n\n@flag\n\nwhen I receive [next v]\nstart sound [ding sound v]\n\nwhen flag clicked\nshow\ngo to x: (0) y: (0)\nforever\n    switch costume to (level)\nend\n\n@thumb\n\nwhen flag clicked\ngo to x: (0) y: (0)\nforever\n    go to [front v] layer\nend\n\nwhen flag clicked\nset [ghost v] effect to (100)\n\n