Sky City | a Platformer #games
@Stage\n\nwhen flag clicked\nforever\n    play sound [Nebula v] until done\nend\n\nwhen I receive [you win! v]\nstop [other scripts in sprite v]\nstop all sounds\nplay sound [YOU WON! v] until done\nforever\n    play sound [FORTNITE - SCENARIO \(Trap Remix\) Ikonik skin Emote by Isaiah Music v] until done\nend\n\n@Player\n\nwhen [r v] key pressed\nbroadcast (Restart v)\n\nwhen I receive [restart v]\nif <([costume # v] of [ground v]) = [9]> then\n    go to x: (-214) y: (-58)\n    point in direction (90)\nelse\n    if <([costume # v] of [ground v]) = [6]> then\n        go to x: (-212) y: (146)\n        point in direction (90)\n    else\n        go to x: (-220) y: (-30)\n        point in direction (90)\n    end\nend\nset [y v] to [0]\nset [x v] to [0]\n\nwhen flag clicked\nshow\n\nchange [y v] by (-1)\n\ndefine Move\ngo to [front v] layer\n\ngo to x: (300) y: (167)\n\nwhen I receive [next level v]\nbroadcast (Restart v)\n\nwhen flag clicked\nforever\n    Move\nend\n\nwhen flag clicked\nswitch backdrop to (costume1 v)\nshow\nforever\n    if <<(x position) > [230]> and <touching (_edge_ v)?>> then\n        broadcast (Next level v)\n    end\n    if <<touching (spikes v)?> or <<touching (lava v)?> or <<(y position) < [-170]> and <touching (_edge_ v)?>>>> then\n        broadcast (Restart v)\n    end\n    if <touching (bounce v)?> then\n        set [y v] to [20]\n    end\nend\n\nwhen flag clicked\nbroadcast (Restart v)\nswitch costume to (costume1 v)\nshow\nset [x v] to [0]\nset [y v] to [0]\nforever\n    go to [front v] layer\n    if <touching (ladders v)?> then\n        set [y v] to [0]\n        if <<key (up arrow v) pressed?> or <<mouse down?> and <(mouse y) > (y position)>>> then\n            set [y v] to [8]\n        end\n        if <<key (down arrow v) pressed?> or <<mouse down?> and <(y position) > (mouse y)>>> then\n            set [y v] to [-8]\n        end\n    else\n        change [y v] by (-1)\n    end\n    if <<key (left arrow v) pressed?> or <<mouse down?> and <(mouse x) < (x position)>>> then\n        change [x v] by (-1)\n        point in direction (-90)\n    end\n    if <<key (right arrow v) pressed?> or <<mouse down?> and <(x position) < (mouse x)>>> then\n        change [x v] by (1)\n        point in direction (90)\n    end\n    set [x v] to ((x) * (0.9))\n    change x by (x)\n    if <touching (ground v)?> then\n        change y by (1)\n    end\n    if <touching (ground v)?> then\n        change y by (1)\n    end\n    if <touching (ground v)?> then\n        change y by (1)\n    end\n    if <touching (ground v)?> then\n        change y by (1)\n    end\n    if <touching (ground v)?> then\n        change y by (-4)\n        change x by ((x) * (-1))\n        if <<key (up arrow v) pressed?> or <<mouse down?> and <(mouse y) > (y position)>>> then\n            set [y v] to [15]\n            if <([abs v] of (x) ) = (x)> then\n                set [x v] to [-10]\n            else\n                set [x v] to [10]\n            end\n        else\n            set [x v] to [0]\n        end\n    end\n    change y by (y)\n    if <touching (ground v)?> then\n        change y by ((y) - ((y) * (2)))\n        set [y v] to [0]\n    end\n    change y by (-1)\n    if <<<key (up arrow v) pressed?> or <<mouse down?> and <(mouse y) > (y position)>>> and <touching (ground v)?>> then\n        set [y v] to [15]\n    end\n    change y by (1)\nend\n\n@Ground\n\nwhen flag clicked\nforever\n    if <(costume [number v]) = [1]> then\n        switch backdrop to (costume1 v)\n    end\n    if <(costume [number v]) = [3]> then\n        switch backdrop to (costume2 v)\n    end\n    if <(costume [number v]) = [6]> then\n        switch backdrop to (costume3 v)\n    end\n    if <(costume [number v]) = [7]> then\n        switch backdrop to (costume4 v)\n    end\n    if <(costume [number v]) = [9]> then\n        switch backdrop to (costume3 v)\n    end\n    if <(costume [number v]) = [10]> then\n        switch backdrop to (costume5 v)\n    end\n    if <(costume [number v]) = [11]> then\n        switch backdrop to (costume3 v)\n    end\nend\n\nwhen [s v] key pressed\nif <not <([costume # v] of [ground v]) = [10]>> then\n    broadcast (Next level v)\nend\n\nwhen flag clicked\nswitch backdrop to (costume1 v)\nswitch costume to (costume1 v)\nshow\n\nwhen I receive [next level v]\nnext costume\ndelete this clone\n\nwhen I start as a clone\nswitch costume to (costume11 v)\nif <([costume # v] of [ground v]) = [5]> then\n    forever\n        go to x: (133) y: (-80)\n        repeat (56)\n            change x by (-5)\n        end\n        repeat (56)\n            change x by (5)\n        end\n    end\nend\nif <([costume # v] of [ground v]) = [6]> then\n    forever\n        go to x: (70) y: (15)\n        repeat (53)\n            change x by (-5)\n            change y by (-1.5)\n        end\n        repeat (53)\n            change x by (5)\n            change y by (1.5)\n        end\n    end\nend\nif <([costume # v] of [ground v]) = [7]> then\n    forever\n        go to x: (140) y: (13)\n        repeat (68)\n            change x by (-5)\n        end\n        repeat (68)\n            change x by (5)\n        end\n    end\nend\nif <([costume # v] of [ground v]) = [9]> then\n    forever\n        go to x: (120) y: (50)\n        repeat (47)\n            change x by (-5)\n        end\n        repeat (47)\n            change x by (5)\n        end\n    end\nend\n\nwhen [space v] key pressed\nset [my variable v] to (join (mouse x) (mouse y))\n\nwhen I receive [message1 v]\nshow\n\nwhen flag clicked\nwait until <(costume [number v]) = [11]>\nbroadcast (You Win! v)\n\n@Art\n\nwhen flag clicked\nshow\nset [ghost v] effect to (20)\ngo to [back v] layer\nforever\n    switch costume to ([costume # v] of [ground v])\n    go to [back v] layer\nend\n\n@Sprite1\n\nwhen I start as a clone\ngo to [back v] layer\npoint in direction (pick random (0) to (360))\ngo to (random position v)\nswitch costume to (pick random (1) to (3))\nsize (pick random (50) to (200))\n\nwhen flag clicked\nhide\nforever\n    create clone of (_myself_ v)\n    wait (0.5) seconds\nend\n\ndefine size (zz)\nset size to (0) %\nset [ghost v] effect to (100)\nshow\nrepeat (30)\n    change size by (((zz) - (size)) / (5))\n    change [ghost v] effect by (-1)\nend\nwait (0.1) seconds\nrepeat (30)\n    change [ghost v] effect by (1)\nend\ndelete this clone\n\n@The King\n\nwhen I receive [restart v]\ndelete this clone\n\ndefine Clone (x) (y)\ngo to x: (x) y: (y)\nset rotation style [all around v]\nswitch costume to (costume1 v)\nset [ghost v] effect to (100)\nshow\npoint in direction (90)\nrepeat (10)\n    change [ghost v] effect by (-10)\n    turn right (5) degrees\nend\nswitch costume to (costume2 v)\ncreate clone of (_myself_ v)\nswitch costume to (costume1 v)\nrepeat (10)\n    change [ghost v] effect by (10)\n    turn right (5) degrees\nend\nhide\n\nwhen I receive [restart v]\nhide\nif  then\n    delete this clone\nend\nif <([costume # v] of [ground v]) = [1]> then\nif <([costume # v] of [ground v]) = [2]> then\nif <([costume # v] of [ground v]) = [3]> then\nif <([costume # v] of [ground v]) = [4]> then\nif <([costume # v] of [ground v]) = [5]> then\n    Clone [200] [30]\nend\nif <([costume # v] of [ground v]) = [6]> then\nif <([costume # v] of [ground v]) = [7]> then\nif <([costume # v] of [ground v]) = [8]> then\nif <([costume # v] of [ground v]) = [9]> then\n\nwhen I start as a clone\nif <(costume [number v]) = [2]> then\n    set rotation style [left-right v]\n    clear graphic effects\n    set size to (9) %\n    show\n    set [enemyx v] to [0]\n    set [enemyy v] to [0]\n    go to [front v] layer\n    forever\n        change [enemyy v] by (-1)\n        if <([x position v] of [player v]) < ((x position) - (10))> then\n            change [enemyx v] by (-0.4)\n            point in direction (-90)\n        end\n        if <((x position) - (-10)) < ([x position v] of [player v])> then\n            change [enemyx v] by (0.4)\n            point in direction (90)\n        end\n        set [enemyx v] to ((Enemyx) * (0.9))\n        change x by (Enemyx)\n        if <touching (ground v)?> then\n            change y by (1)\n        end\n        if <touching (ground v)?> then\n            change y by (1)\n        end\n        if <touching (ground v)?> then\n            change y by (1)\n        end\n        if <touching (ground v)?> then\n            change y by (1)\n        end\n        if <touching (ground v)?> then\n            change y by (-4)\n            change x by ((Enemyx) * (-1))\n            if <(y position) < ([y position v] of [player v])> then\n                set [enemyy v] to [10]\n                if <([abs v] of (x) ) = (x)> then\n                    set [enemyx v] to [-10]\n                else\n                    set [enemyx v] to [10]\n                end\n            else\n                set [enemyx v] to [0]\n            end\n        end\n        change y by (Enemyy)\n        if <touching (ground v)?> then\n            change y by ((Enemyy) - ((Enemyy) * (2)))\n            set [enemyy v] to [0]\n        end\n        change y by (-1)\n        if <<((y position) - (-120)) < ([y position v] of [player v])> and <touching (ground v)?>> then\n            set [enemyy v] to [14]\n        end\n        if <<touching (ground v)?> and <<touching (player v)?> and <(([y position v] of [player v]) - (10)) > (y position)>>> then\n            set [y v] to [15]\n            repeat (10)\n                change [ghost v] effect by (10)\n                change [enemyy v] by (1)\n            end\n            delete this clone\n        end\n        change y by (1)\n        switch costume to (costume3 v)\n        create clone of (_myself_ v)\n        switch costume to (costume2 v)\n        if <touching (player v)?> then\n            broadcast (Restart v)\n        end\n        if <touching (ladders v)?> then\n            if <([y position v] of [player v]) > (y position)> then\n                set [enemyy v] to [6]\n            else\n                set [enemyy v] to [-6]\n            end\n        end\n        if <touching (bounce v)?> then\n            set [enemyy v] to [20]\n        end\n    end\nelse\n    show\n    clear graphic effects\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\n    delete this clone\nend\n\nwhen flag clicked\nset [amount v] to [1]\nset [speed v] to [1]\n\nwait (1) seconds\n\ngo to [back v] layer\ngo [forward v] (1) layers\n\nwhen flag clicked\nhide\n\n@Spikes\n\nwhen flag clicked\nswitch costume to (costume1 v)\ngo to [back v] layer\nshow\nforever\n    switch costume to ([costume # v] of [ground v])\nend\n\n@Mad Person\n\nwhen I receive [restart v]\ndelete this clone\n\ndefine Clone (x) (y)\ngo to x: (x) y: (y)\nset rotation style [all around v]\nswitch costume to (costume1 v)\nset [ghost v] effect to (100)\nshow\npoint in direction (90)\nrepeat (10)\n    change [ghost v] effect by (-10)\n    turn right (5) degrees\nend\nswitch costume to (costume2 v)\ncreate clone of (_myself_ v)\nswitch costume to (costume1 v)\nrepeat (10)\n    change [ghost v] effect by (10)\n    turn right (5) degrees\nend\nhide\n\nwhen I receive [restart v]\nhide\nif  then\n    delete this clone\nend\nif <([costume # v] of [ground v]) = [1]> then\nif <([costume # v] of [ground v]) = [2]> then\nif <([costume # v] of [ground v]) = [3]> then\nif <([costume # v] of [ground v]) = [4]> then\nif <([costume # v] of [ground v]) = [5]> then\nif <([costume # v] of [ground v]) = [6]> then\nif <([costume # v] of [ground v]) = [7]> then\nif <([costume # v] of [ground v]) = [8]> then\n    Clone [200] [13]\nend\nif <([costume # v] of [ground v]) = [9]> then\n\nwhen I start as a clone\nif <(costume [number v]) = [2]> then\n    set rotation style [left-right v]\n    clear graphic effects\n    set size to (9) %\n    show\n    set [enemyx v] to [0]\n    set [enemyy v] to [0]\n    go to [front v] layer\n    forever\n        change [enemyy v] by (-1)\n        if <([x position v] of [player v]) < ((x position) - (10))> then\n            change [enemyx v] by (-0.4)\n            point in direction (-90)\n        end\n        if <((x position) - (-10)) < ([x position v] of [player v])> then\n            change [enemyx v] by (0.4)\n            point in direction (90)\n        end\n        set [enemyx v] to ((Enemyx) * (0.9))\n        change x by (Enemyx)\n        if <touching (ground v)?> then\n            change y by (1)\n        end\n        if <touching (ground v)?> then\n            change y by (1)\n        end\n        if <touching (ground v)?> then\n            change y by (1)\n        end\n        if <touching (ground v)?> then\n            change y by (1)\n        end\n        if <touching (ground v)?> then\n            change y by (-4)\n            change x by ((Enemyx) * (-1))\n            if <(y position) < ([y position v] of [player v])> then\n                set [enemyy v] to [10]\n                if <([abs v] of (x) ) = (x)> then\n                    set [enemyx v] to [-10]\n                else\n                    set [enemyx v] to [10]\n                end\n            else\n                set [enemyx v] to [0]\n            end\n        end\n        change y by (Enemyy)\n        if <touching (ground v)?> then\n            change y by ((Enemyy) - ((Enemyy) * (2)))\n            set [enemyy v] to [0]\n        end\n        change y by (-1)\n        if <<((y position) - (-120)) < ([y position v] of [player v])> and <touching (ground v)?>> then\n            set [enemyy v] to [14]\n        end\n        if <<touching (ground v)?> and <<touching (player v)?> and <(([y position v] of [player v]) - (10)) > (y position)>>> then\n            set [y v] to [15]\n            repeat (10)\n                change [ghost v] effect by (10)\n                change [enemyy v] by (1)\n            end\n            delete this clone\n        end\n        change y by (1)\n        switch costume to (costume3 v)\n        create clone of (_myself_ v)\n        switch costume to (costume2 v)\n        if <touching (player v)?> then\n            broadcast (Restart v)\n        end\n        if <touching (ladders v)?> then\n            if <([y position v] of [player v]) > (y position)> then\n                set [enemyy v] to [6]\n            else\n                set [enemyy v] to [-6]\n            end\n        end\n        if <touching (bounce v)?> then\n            set [enemyy v] to [20]\n        end\n    end\nelse\n    show\n    clear graphic effects\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\n    delete this clone\nend\n\nwhen flag clicked\nset [amount v] to [1]\nset [speed v] to [1]\n\nwait (1) seconds\n\ngo to [back v] layer\ngo [forward v] (1) layers\n\nwhen flag clicked\nhide\n\n@Thumbnail\n\nwhen flag clicked\nforever\n    set [ghost v] effect to (100)\n    reset timer\n    go to [front v] layer\n    show\nend\n\nwhen [timer v] > (0)\ngo to [front v] layer\n\n
Sky City                           \n=============================================\nYou are an explorer agent lost in the city of the sky. You have to find your way to the airport to fly down to HQ.\n==============================================