The Creative World // A Platformer #All #Games

Instructions: Welcome to my New Platformer : The Creative World\n- Use the Arrow keys or WASD\n- Avoid Lava, spikes, zombies and Defeat the KING!\n- Use the trampoline to bounce higher!\n- And win!\n- To defeat the King, you have to dodge the King.\n\nStory -\nYou are a player and have to defeat the King and the naughty zombies. You can swim in the water by pressing the up arrow key or  W .\nPress down arrow key or S in the water to get down.\nAnd Good luck ;)\n

@Stage\n\n@detector\n\nwhen flag clicked\nhide\nset [clone id v] to [0]\ncreate clone of (_myself_ v)\nwait (0.2) seconds\nset [clone id v] to [1]\ncreate clone of (_myself_ v)\nwait until <<(LOVED__) = [1]> and <(FAVED___) = [1]>>\nwait (0.5) seconds\nshow\ngo to x: (0) y: (-100)\nreset timer\nswitch costume to (pick random (1) to (4))\nset [ghost v] effect to (100)\nrepeat until <(timer) > [3.5]>\n    change y by ((y position) / (-15))\n    change [ghost v] effect by (-3)\nend\nreset timer\nrepeat until <(timer) > [3.5]>\n    change y by (((y position) - (-100)) / (-15))\n    change [ghost v] effect by (10)\nend\n\nwhen I start as a clone\nif <(clone id) = [0]> then\n    go to x: (-15) y: (0)\n    set [loved__ v] to [0]\n    switch costume to (love v)\n    forever\n        set [love? v] to <touching (mouse-pointer v)?>\n        if <touching (mouse-pointer v)?> then\n            wait (0.2) seconds\n            if <touching (mouse-pointer v)?> then\n                set [loved__ v] to [1]\n            end\n        end\n    end\nend\nif <(clone id) = [1]> then\n    go to x: (0) y: (0)\n    switch costume to (fave v)\n    set [faved___ v] to [0]\n    forever\n        set [fav v] to <touching (mouse-pointer v)?>\n        if <touching (mouse-pointer v)?> then\n            wait (0.2) seconds\n            if <touching (mouse-pointer v)?> then\n                set [faved___ v] to [1]\n            end\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    play sound [Geometry Dash - Base After Base All Coins v] until done\nend\n\nwhen flag clicked\nforever\n    go to [front v] layer\nend\n\n@player\n\ndefine Platformer Physics (speed) (friction) (jump height)\nchange [y vel v] by (-1)\nif <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n    change [x vel v] by (speed)\n    switch costume to (costume1 v)\nend\nif <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n    change [x vel v] by ((speed) * (-1))\nend\nset [x vel v] to ((X vel) * (friction))\nchange x by (X vel)\nset [slope v] to [0]\nif <touching (level v)?> then\n    repeat until <<not <touching (level v)?>> or <(slope) = [-8]>>\n        change [slope v] by (-1)\n        change y by (1)\n    end\nend\nif <touching (level v)?> then\n    change y by (slope)\n    repeat until <not <touching (level v)?>>\n        change x by ((([abs v] of (X vel) ) / (X vel)) * (-1))\n    end\n    if <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n        if <(X vel) > [0]> then\n            set [x vel v] to [-12]\n        else\n            set [x vel v] to [12]\n        end\n        set [y vel v] to [12]\n    else\n        set [x vel v] to [0]\n    end\nend\nchange y by (Y vel)\nif <touching (level v)?> then\n    repeat until <not <touching (level v)?>>\n        change y by ((([abs v] of (Y vel) ) / (Y vel)) * (-1))\n    end\n    set [y vel v] to [0]\nend\nchange y by (-1)\nif <<<key (up arrow v) pressed?> or <key (w v) pressed?>> and <touching (level v)?>> then\n    set [y vel v] to (jump height)\nend\nchange y by (1)\n\nwhen flag clicked\n\nwhen I receive [end v]\ngo to x: (-198) y: (-10)\n\nwhen flag clicked\nset [level v] to [1]\nhide\n\nwhen I start as a clone\nswitch costume to (effect v)\nrepeat (10)\n    change [ghost v] effect by (10)\n    change size by (-5)\nend\ndelete this clone\n\nwhen flag clicked\nshow\ngo to [front v] layer\nset [level v] to [1]\nset [x vel v] to [0]\nset [y vel v] to [0]\nswitch costume to (costume1 v)\ngo to x: (-208) y: (-10)\npoint in direction (90)\nforever\n    Platformer Physics [1] [0.9] [14]\n    if <<<<touching (danger v)?> or <touching (zombie v)?>> or <touching (zombie 2 v)?>> or <touching (lasers v)?>> then\n        repeat (20)\n            change [ghost v] effect by (5)\n        end\n        go to x: (-208) y: (-10)\n        repeat (20)\n            change [ghost v] effect by (-5)\n        end\n    end\n    if <touching (trampoline v)?> then\n        set [y vel v] to [20]\n    end\n    if <touching (water v)?> then\n        if <<key (down arrow v) pressed?> or <key (s v) pressed?>> then\n            change [y vel v] by (-1)\n        else\n            change [y vel v] by (1)\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    create clone of (_myself_ v)\nend\n\ngo to x: (-198) y: (-10)\n\n@level\n\nwhen flag clicked\nshow\ngo to x: (-2) y: (6)\nswitch costume to (costume1 v)\n\nwhen I receive [end v]\nnext costume\n\n@danger\n\nwhen flag clicked\nshow\ngo to x: (-2) y: (6)\nswitch costume to (costume1 v)\n\nwhen I receive [end v]\nshow\ngo to [front v] layer\nnext costume\n\n@end\n\nwhen flag clicked\nshow\ngo to x: (136) y: (-4)\nforever\n    if <touching (player v)?> then\n        broadcast (end v)\n    end\nend\n\nwhen flag clicked\ngo to x: (136) y: (-4)\nforever\n    if <(level) = [14]> then\n        hide\n    end\nend\n\nwhen I receive [king dead v]\nforever\n    show\nend\n\n@blank\n\nwhen I receive [end v]\nchange [level v] by (1)\n\n@Trampoline\n\nwhen flag clicked\ngo to x: (36) y: (28)\nhide\n\nwhen flag clicked\nforever\n    if <<(level) = [4]> or <(level) = [9]>> then\n        show\n    end\nend\n\nwhen flag clicked\nforever\n    if <<(level) = [5]> or <(level) = [10]>> then\n        hide\n    end\nend\n\nwhen flag clicked\nswitch costume to (costume1 v)\nforever\n    if <touching (player v)?> then\n        repeat (3)\n            wait (0.01) seconds\n            next costume\n        end\n        start sound [Mario Jump - Gaming Sound Effect \(HD\) v]\n        repeat (3)\n            wait (0.01) seconds\n            switch costume to ((costume [number v]) - (1))\n        end\n    end\nend\n\n@water\n\nwhen flag clicked\ngo to x: (-2) y: (6)\nhide\n\nwhen flag clicked\nforever\n    if <(level) = [5]> then\n        switch costume to (costume1 v)\n        show\n    end\nend\n\nwhen flag clicked\nforever\n    if <<(level) = [6]> or <(level) = [14]>> then\n        hide\n    end\nend\n\nwhen flag clicked\nforever\n    if <(level) = [13]> then\n        switch costume to (costume2 v)\n        show\n    end\nend\n\n@zombie\n\nwhen flag clicked\ngo to x: (205) y: (-41)\nhide\n\nwhen flag clicked\ngo to x: (205) y: (-41)\nswitch costume to (costume1 v)\nforever\n    if <(level) = [6]> then\n        switch costume to (costume1 v)\n        show\n        glide (3) secs to x: (-55) y: (-41)\n        glide (3) secs to x: (205) y: (-41)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(level) = [7]> then\n        hide\n    end\nend\n\nwhen flag clicked\ngo to x: (205) y: (-41)\nforever\n    if <(level) = [10]> then\n        switch costume to (costume1 v)\n        show\n        glide (3) secs to x: (-55) y: (-41)\n        glide (3) secs to x: (205) y: (-41)\n    end\nend\n\nwhen flag clicked\ngo to x: (205) y: (-41)\nforever\n    if <(level) = [11]> then\n        hide\n    end\nend\n\nwhen flag clicked\nrepeat until <(king attack) = [yes]>\n    if <(level) = [14]> then\n        switch costume to (king v)\n        show\n        go to x: (185) y: (-90)\n        wait until <(king attack) = [yes]>\n        show\n        repeat (30)\n            change x by (-8)\n        end\n        wait (0.50) seconds\n        repeat (10)\n            wait (1.5) seconds\n            repeat (20)\n                change [ghost v] effect by (5)\n            end\n            go to (random position v)\n            repeat (20)\n                change [ghost v] effect by (-5)\n            end\n        end\n        start sound [Tada v]\n        repeat (50)\n            change [ghost v] effect by (2)\n        end\n        hide\n        broadcast (King dead v)\n    end\nend\n\nwhen flag clicked\nrepeat (2)\n    if <(level) = [14]> then\n        go to x: (205) y: (-100)\n        switch costume to (costume1 v)\n        show\n        glide (3) secs to x: (-55) y: (-100)\n        glide (3) secs to x: (205) y: (-100)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(level) = [15]> then\n        hide\n        stop [this script v]\n    end\nend\n\nbroadcast (attack=done v)\n\nwhen I receive [king dead v]\nforever\n    hide\n    stop [this script v]\nend\n\n@Thumbnail\n\nwhen flag clicked\nforever\n    go to x: (-3) y: (2)\n    go to [front v] layer\n    set [ghost v] effect to (100)\nend\n\n@zombie 2\n\nwhen flag clicked\nset [king attack v] to [no]\ngo to x: (205) y: (-41)\nhide\n\nwhen flag clicked\ngo to x: (205) y: (-41)\nforever\n    if <(level) = [10]> then\n        show\n        glide (1.3) secs to x: (-55) y: (-41)\n        glide (1.3) secs to x: (205) y: (-41)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(level) = [11]> then\n        hide\n    end\nend\n\nwhen flag clicked\nrepeat until <(king attack) = [yes]>\n    if <(level) = [14]> then\n        show\n        repeat (4)\n            go to x: (205) y: (-100)\n            glide (2) secs to x: (-240) y: (-100)\n            glide (2) secs to x: (205) y: (-100)\n        end\n        broadcast (attack=done v)\n        stop [this script v]\n    end\nend\n\nwhen flag clicked\nforever\n    if <(level) = [15]> then\n        hide\n    end\nend\n\nwait (1.5) seconds\n\nwhen I receive [attack=done v]\nforever\n    hide\n    set [king attack v] to [yes]\n    stop [this script v]\nend\n\nwhen flag clicked\nforever\n    if <(level) = [15]> then\n        hide\n        stop [this script v]\n    end\nend\n\n@lasers\n\nwhen flag clicked\ngo to [back v] layer\nhide\nforever\n    if <(level) = [11]> then\n        wait (1.5) seconds\n        show\n        wait (1.5) seconds\n        hide\n    end\nend\n\nwhen flag clicked\ngo to [back v] layer\nforever\n    if <(level) = [12]> then\n        hide\n    end\nend\n\n@next level\n\nwhen flag clicked\nhide\nforever\n    go to [front v] layer\nend\n\nwhen I receive [end v]\nshow\ngo to [front v] layer\ngo to x: (0) y: (-1000)\nrepeat (40)\n    change y by (((0) - (y position)) / (5))\nend\nset y to (1)\nrepeat (8)\n    change y by (y position)\nend\nhide\n\n@volume button\n\nwhen flag clicked\nshow\nswitch costume to (on v)\ngo to x: (210) y: (155)\nforever\n    if <(costume [number v]) = [1]> then\n        set volume to (100) %\n    else\n        if <(costume [number v]) = [2]> then\n            set volume to (0) %\n        end\n    end\n    if <touching (mouse-pointer v)?> then\n        set size to (125) %\n    else\n        set size to (100) %\n    end\nend\n\nwhen this sprite clicked\nnext costume\n\nwhen flag clicked\nforever\n    point in direction ((([sin v] of ((timer) * (1000)) ) * (4)) + (90))\nend\n\nwhen flag clicked\nshow\nforever\n    play sound [Geometry Dash - Base After Base All Coins v] until done\nend\n\n