Escape 1 || Platformer by SkettyCat #games


@Stage\n\nwhen flag clicked\nforever\n    reset timer\nend\n\nwhen I receive [start game v]\nforever\n    play sound [Xaf - Inferno v] until done\nend\n\nwhen I receive [main menu v]\nstop all sounds\n\n@Player\n\nwhen flag clicked\nReset\nbroadcast (Main Menu v)\n\nwhen I receive [game loop v]\nforever\n    switch costume to (Actions)\n    Platformer Physics\nend\n\ndefine Platformer Physics\nswitch costume to (Actions)\nif <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n    change [xv v] by (-1.3)\nend\nif <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n    change [xv v] by (1.3)\nend\nset [xv v] to ((Xv) * (0.85))\nchange x by (Xv)\nif <touching (ground v)?> then\n    change y by (1)\nend\nif <touching (ground v)?> then\n    change y by (1)\nend\nif <touching (ground v)?> then\n    change y by (1)\nend\nif <touching (ground v)?> then\n    change y by (1)\nend\nif <touching (ground v)?> then\n    change y by (-4)\n    change x by ((Xv) * (-1))\n    if <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n        if <(Xv) > [0]> then\n            set [xv v] to [-10]\n        else\n            set [xv v] to [10]\n        end\n        set [yv v] to [15]\n    else\n        set [xv v] to [0]\n    end\nend\nchange [yv v] by (-1)\nchange y by (Yv)\nif <touching (ground v)?> then\n    change y by ((Yv) - ((Yv) * (2)))\n    set [yv v] to [0]\nend\nchange y by (-1)\nif <<touching (ground v)?> and <<key (up arrow v) pressed?> or <key (w v) pressed?>>> then\n    set [yv v] to [13]\nend\nif <<touching (spikes & lava v)?> or <(y position) < [-179]>> then\n    broadcast (Death v)\nend\nif <(x position) > [240]> then\n    set x to (-240)\n    change [level v] by (1)\n    broadcast (Next Level v)\nend\nif <touching (trampoline v)?> then\n    set [yv v] to [15]\nend\ncreate clone of (_myself_ v)\nchange y by (1)\n\nwhen I start as a clone\nswitch costume to (c_0 v)\nset size to (100) %\nclear graphic effects\nrepeat (10)\n    switch costume to (join [c_] (Actions))\n    change size by (-3)\n    change [ghost v] effect by (10)\nend\ndelete this clone\n\nwhen I receive [death v]\nstop [other scripts in sprite v]\nbroadcast (Delete Clones v)\nrepeat (10)\n    change [ghost v] effect by (10)\nend\ngo to x: (-174) y: (50)\nset [ghost v] effect to (0)\nset [xv v] to [0]\nset [yv v] to [0]\nbroadcast (Game Loop v)\n\ndefine Reset\nhide\ngo to x: (-174) y: (50)\nbroadcast (Delete Clones v)\nset [level v] to [1]\nset [xv v] to [0]\nset [yv v] to [0]\n\nwhen I receive [start game v]\nshow\nbroadcast (Next Level v)\ngo to [front v] layer\nbroadcast (Game Loop v)\n\nwhen I receive [delete clones v]\ndelete this clone\n\nwhen [timer v] > (0)\nhide\n\n@Ground\n\nwhen flag clicked\nhide\ngo to x: (0) y: (0)\n\nwhen I receive [next level v]\ngo to [back v] layer\ngo [forward v] (2) layers\nswitch costume to (Level)\nshow\n\nwhen [timer v] > (0)\nhide\n\n@Spikes & Lava\n\nwhen flag clicked\nhide\ngo to x: (0) y: (0)\n\nwhen I receive [next level v]\ngo to [back v] layer\nswitch costume to (blank v)\nswitch costume to (join [a] (Level))\nshow\n\nwhen [timer v] > (0)\nhide\n\n@LV_BG\n\nwhen flag clicked\nhide\ngo to x: (0) y: (0)\n\nwhen I receive [next level v]\nshow\ngo to [back v] layer\ngo [forward v] (1) layers\nswitch costume to (blank v)\nswitch costume to (join [a] (Level))\n\nwhen [timer v] > (0)\nhide\n\n@Detector\n\nwhen flag clicked\npoint in direction (90)\nhide\nif <(Actions) < [1]> then\n    set [clone id v] to [0]\n    create clone of (_myself_ v)\n    set [clone id v] to [1]\n    create clone of (_myself_ v)\n    wait until <<(LOVED) = [1]> and <(FAVED) = [1]>>\n    wait (0.5) seconds\n    show\n    go to x: (0) y: (-100)\n    reset timer\n    switch costume to (loved v)\n    set [actions v] to [1]\n    set [ghost v] effect to (100)\n    go [forward v] (2000) layers\n    broadcast (New Player v)\n    repeat (60)\n        change y by ((y position) / (-15))\n        change [ghost v] effect by (-3)\n    end\n    wait (0.5) seconds\n    repeat (60)\n        change y by (((y position) - (-100)) / (-15))\n        change [ghost v] effect by (10)\n    end\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 [timer v] > (0)\nhide\n\n@Reminder\n\nwhen flag clicked\nset [ghost v] effect to (5)\nhide\n\nwhen [space v] key pressed\nif <(username) = [SkettyCat]> then\n    set [actions v] to [0]\nend\n\nwhen I receive [start game v]\nwait (2.5) seconds\nReset\nforever\n    if <(Actions) < [1]> then\n        switch costume to (costume1 v)\n        go to x: (-113) y: (70)\n        show\n        go to [front v] layer\n        repeat (2)\n            change y by (-6)\n        end\n        repeat (7)\n            change y by (3)\n        end\n        repeat (6)\n            change y by (-2)\n        end\n        wait until <<touching (mouse-pointer v)?> and <mouse down?>>\n        repeat (30)\n            change y by (7)\n        end\n        hide\n        stop [this script v]\n    else\n        stop [this script v]\n    end\nend\n\ndefine Reset\ngo to [front v] layer\nhide\n\nwhen [timer v] > (0)\nhide\n\nwhen [0 v] key pressed\nif <(username) = [SkettyCat]> then\n    set [actions v] to [1]\nend\n\n@BG / Thumbnail\n\nwhen flag clicked\nset [ghost v] effect to (100)\ngo to x: (0) y: (0)\nshow\n\nwhen I receive [main menu v]\nclear graphic effects\n\nwhen I receive [start game v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\n\nwhen [timer v] > (0)\nset [ghost v] effect to (50)\nrepeat (10)\n    change [ghost v] effect by (-5)\nend\n\n@Play\n\nwhen flag clicked\nhide\n\nwhen I receive [main menu v]\ngo to x: (0) y: (-70)\nset [ghost v] effect to (100)\ngo to [front v] layer\nshow\nrepeat (20)\n    change [ghost v] effect by (-5)\nend\nforever\n    change [timer v] by (0.06)\n    Smooth Grow [120]\n    if <touching (mouse-pointer v)?> then\n        set [brightness v] effect to (7)\n        if <mouse down?> then\n            broadcast (Click v)\n            stop [this script v]\n        end\n    else\n        set [brightness v] effect to (0)\n    end\nend\n\nwhen I receive [click v]\nset [brightness v] effect to (100)\nstart sound [Click v]\nrepeat (10)\n    change [brightness v] effect by (-10)\nend\nrepeat (20)\n    change [ghost v] effect by (5)\nend\ngo to [back v] layer\nbroadcast (Start Game v)\n\ndefine Smooth Grow (size)\nset size to ((size) + ((6) * ([sin v] of ((timer) * (180)) ))) %\n\nwhen [timer v] > (0)\nhide\n\n@Ad\n\nwhen flag clicked\nhide\n\nwhen I start as a clone\ngo to x: (66) y: (92)\nset [ghost v] effect to (100)\nswitch costume to (mouse v)\ngo to [front v] layer\nset size to (45) %\npoint in direction (90)\nshow\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nrepeat (20)\n    change x by (((115) - (x position)) / (4))\n    change y by (((140) - (y position)) / (4))\nend\nwait (0.05) seconds\nrepeat (20)\n    change x by (((156) - (x position)) / (4))\nend\nwait (0.05) seconds\nrepeat (20)\n    change x by (((195) - (x position)) / (4))\nend\nrepeat (20)\n    change x by (((195) - (x position)) / (4))\nend\nwait (0.05) seconds\nrepeat (20)\n    change x by (((229) - (x position)) / (4))\n    change y by (((95) - (y position)) / (4))\nend\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nset [ghost v] effect to (0)\ndelete this clone\n\nwhen I receive [ad v]\nwait (1) seconds\nplay sound [Click v] until done\nwait (0.5) seconds\nplay sound [Click v] until done\nwait (0.5) seconds\nplay sound [Click v] until done\n\nwhen I receive [ad v]\ncreate clone of (_myself_ v)\ngo to x: (152) y: (250)\nswitch costume to (1 v)\nset size to (40) %\npoint in direction (90)\nshow\nstart sound [pop v]\nrepeat (30)\n    change y by (((145) - (y position)) / (4))\nend\nrepeat (3)\n    next costume\n    wait (0.75) seconds\nend\nrepeat (30)\n    change y by (((220) - (y position)) / (4))\nend\nhide\n\nwhen [timer v] > (0)\nhide\n\nwhen I receive [start game v]\nforever\n    go to [front v] layer\n    if <(Actions) < [1]> then\n        broadcast (Ad v)\n        wait (pick random (15) to (45)) seconds\n    end\nend\n\n@TB_BG\n\nwhen flag clicked\nclear graphic effects\nhide\n\nwhen [timer v] > (0)\nshow\ngo to x: (0) y: (-70)\nset [ghost v] effect to (100)\nset [brightness v] effect to (30)\nwait (0.8) seconds\nrepeat (10)\n    change [ghost v] effect by (-10)\n    change [brightness v] effect by (-2)\nend\n\n@Trampoline\n\nwhen flag clicked\nhide\ngo to x: (0) y: (0)\n\nwhen I receive [next level v]\nshow\ngo to [back v] layer\ngo [forward v] (5) layers\nswitch costume to (blank v)\nswitch costume to (join [a] (Level))\n\nwhen [timer v] > (0)\nhide\n\n@TEMP SPRITE\n\n