CAKE! (a platformer)  | #games #all #trending

Instructions: this game is made for @CharlotteMeJ birthday!! (July 27)\nand for other people's birthday coming up soon!\ncomment: "HAPPY BIRTHDAY!!"\n▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀\nLETS GET TO 200 ❤️⭐ON THIS GAME I KNOW WE CAN DO THIS!! :D\nI literally had so much fun coding and detailing this lol\n\n  CAKE! (a platformer)  | #games #all #trending\n        by @-EnergyCodes-\n\n  I know it's short... but at least it's not generic :/\n   AND I added a story too so please don't hate :(\n\n     hope you have a NOICE day :) <3\n\ncredits\n@-Energycodes- for the art\n@Scratchcat for using it's head for the logo xD\nand @ you you playing :D!\n\n\n#cake #birthday #scratch #featured #energycodes #energy #food #NOMNOM

@Stage\n\nwhen flag clicked\nset [@level v] to [1]\nif <(already watched?) = [0]> then\n    broadcast (Story v) and wait\n    set [already watched? v] to [1]\nelse\n    broadcast (@Game v)\nend\n\nwhen I receive [story v]\nset [pitch v] effect to (-50)\nplay sound [Brazil v] until done\n\nwhen I receive [@game v]\nclear sound effects\nstop all sounds\nforever\n    play sound [Lost and stoned v] until done\nend\n\nwhen flag clicked\nset [personal time v] to [0]\nset [timer v] to [0]\nforever\n    change [timer v] by (timer)\n    reset timer\nend\n\nset [already watched? v] to [0]\n\n@blank\n\nwhen I receive [end v]\nset [personal time v] to (round (timer))\nstop [other scripts in sprite v]\nif <(WORLD Record) > (Personal Time)> then\n    set [world record v] to (Personal Time)\n    broadcast (You Beat the Highscore!! v)\nend\n\nwhen I receive [@game v]\nforever\n    broadcast (Game - TICK v)\nend\n\n@ground\n\nwhen flag clicked\nshow\ngo to x: (0) y: (0)\ngo to [back v] layer\n\nwhen I receive [game - tick v]\nswitch costume to (join [l] (@Level))\n\n@cake\n\nwhen flag clicked\nhide\n\nwhen I receive [reset v]\nshow\nclear graphic effects\nset [yvel v] to [0]\nset [xvel v] to [0]\ngo to x: (-200) y: (0)\nset size to (27) %\npoint in direction (90)\n\nwhen I receive [@game v]\nbroadcast (reset v) and wait\nforever\n    switch costume to (hitbox v)\n    if <<key (a v) pressed?> or <<key (left arrow v) pressed?> or <<mouse down?> and <(mouse x) < (x position)>>>> then\n        change [xvel v] by (-1)\n        point in direction (-90)\n    end\n    if <<key (d v) pressed?> or <<key (right arrow v) pressed?> or <<mouse down?> and <(mouse x) > (x position)>>>> then\n        change [xvel v] by (1)\n        point in direction (90)\n    end\n    set [xvel v] to ((xvel) * (.85))\n    change x by (xvel)\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 ((xvel) * (-1))\n    end\n    change [yvel v] by (-1)\n    change y by (yvel)\n    if <touching (ground v)?> then\n        change y by ((yvel) * (-1))\n        set [yvel v] to [0]\n    end\n    change y by (-1)\n    if <<key (w v) pressed?> or <<key (up arrow v) pressed?> or <<key (space v) pressed?> or <<mouse down?> and <(mouse y) > (y position)>>>>> then\n        if <touching (ground v)?> then\n            start sound [Jump v]\n            set [yvel v] to [14]\n        end\n    end\n    change y by (1)\n    switch costume to (cake v)\n    if <(x position) > [230]> then\n        start sound [Magic Spell v]\n        broadcast (reset v) and wait\n        change [@level v] by (1)\n    end\n    if <touching (dangerous v)?> then\n        start sound [Squish Pop v]\n        broadcast (reset v) and wait\n    end\nend\n\ngo to [front v] layer\n\nwhen [r v] key pressed\nstart sound [Squish Pop v]\nbroadcast (reset v) and wait\n\nwhen I receive [end v]\nstop [other scripts in sprite v]\n\n@front layer\n\nwhen flag clicked\nforever\n    set [ghost v] effect to (100)\n    go to [front v] layer\nend\n\nwhen I receive [end v]\ngo to [front v] layer\nswitch costume to (end v)\nstop [other scripts in sprite v]\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\n\nwhen [timer v] > (0)\nswitch costume to (tb v)\ngo to [front v] layer\n\nset [@level v] to [9]\n\n@fog\n\nwhen I start as a clone\nshow\ngo to [back v] layer\nset rotation style [left-right v]\npoint in direction (pick random (-180) to (180))\nset size to ((pick random (1) to (2)) * (25)) %\nset [ghost v] effect to (pick random (50) to (90))\ngo to (random position v)\ngo to x: ((-1) / (0)) y: (pick random (150) to (100))\nglide (3) secs to x: ((x position) * (-1)) y: (y position)\ndelete this clone\n\nwhen flag clicked\nhide\n\nwhen I receive [@game v]\nforever\n    create clone of (_myself_ v)\n    wait (pick random (.) to (1)) seconds\nend\n\n@shadow\n\ndefine touch ground\nrepeat until <touching (ground v)?>\n    change y by (-1)\n    if <(y position) < [-180]> then\n        stop [this script v]\n    end\nend\nchange y by (1)\n\nwhen I receive [game - tick v]\nshow\nswitch costume to (hb v)\ngo to (cake v)\ntouch ground\nswitch costume to (costume1 v)\nset [ghost v] effect to (((distance to [cake v]) * (2)) + (0))\n\nwhen flag clicked\nhide\n\n@Sprial\n\nwhen flag clicked\nhide\n\nwhen I receive [game - tick v]\nshow\ngo to [back v] layer\nset [ghost v] effect to (70)\nturn right (2) degrees\ngo to (cake v)\n\n@story\n\ndefine get class (c)\nset [class v] to (c)\nset [# v] to [0]\n\ndefine create a clone myself\nchange [# v] by (1)\ncreate clone of (_myself_ v)\n\ndefine SETUP CLONES\nset [# v] to [0]\nget class [fade]\ncreate a clone myself\nget class [story]\ncreate a clone myself\nget class [text]\ncreate a clone myself\n\nwhen I receive [story v]\nset [page v] to [1]\nswitch costume to (blank v)\ngo to x: (0) y: (0)\nset size to (100) %\nshow\nSETUP CLONES\nhide\n\nwhen I start as a clone\nshow\n\nwhen I start as a clone\nif <(class) = [fade]> then\n    go to [front v] layer\n    switch costume to (big v)\n    clear graphic effects\n    wait (.33) seconds\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\n    repeat (2)\n        wait (4) seconds\n        repeat (10)\n            change [ghost v] effect by (-10)\n        end\n        change [page v] by (1)\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n    end\n    wait until <<key (any v) pressed?> or <mouse down?>>\n    repeat (10)\n        change [ghost v] effect by (-10)\n    end\n    change [page v] by (1)\n    wait (.33) seconds\n    broadcast (@Game v)\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\n    delete this clone\nend\n\nwhen I start as a clone\nif <(class) = [story]> then\n    story anim\n    wait until <(page) = [2]>\n    story anim\n    wait until <(page) = [3]>\n    story anim\nend\n\ndefine change size by (s) cos (c)\nswitch costume to (blank v)\nchange size by (s)\nswitch costume to (c)\n\nwhen I start as a clone\nif <(class) = [text]> then\n    switch costume to (t1 v)\n    set size to (90) %\n    set [ghost v] effect to (100)\n    wait (1) seconds\n    repeat (10)\n        change size by (.5)\n        change [ghost v] effect by (-10)\n    end\n    wait until <(page) = [2]>\n    switch costume to (t2 v)\n    set size to (90) %\n    set [ghost v] effect to (100)\n    wait (1) seconds\n    repeat (10)\n        change size by (.5)\n        change [ghost v] effect by (-10)\n    end\n    wait until <(page) = [3]>\n    switch costume to (t3 v)\n    set size to (90) %\n    set [ghost v] effect to (100)\n    repeat (10)\n        change size by (.5)\n        change [ghost v] effect by (-10)\n    end\nend\n\nwhen I start as a clone\nif <(class) = [text]> then\n    \n        set y to (([sin v] of ((timer) * (100)) ) * (5))\n    end\nend\n\ndefine set size to (s) cos (c)\nswitch costume to (blank v)\nset size to (s) %\nswitch costume to (c)\n\ndefine story anim\nset size to [100] cos (join [s] (page))\nrepeat (3)\n    repeat (50)\n        change size by [.05] cos (join [s] (page))\n    end\n    repeat (50)\n        change size by [-.05] cos (join [s] (page))\n    end\nend\n\nwhen I start as a clone\nif <not <(class) = [fade]>> then\n    wait until <(page) = [4]>\n    delete this clone\nend\n\n@art\n\n@Words\n\nwhen flag clicked\nhide\n\nwhen I receive [game - tick v]\nshow\ngo to x: (0) y: (([sin v] of ((timer) * (500)) ) * (3))\nswitch costume to (blank v)\nswitch costume to (join [l] (@Level))\ngo to [front v] layer\nset [ghost v] effect to (<touching (cake v)?> * (90))\n\n@Dangerous\n\nwhen flag clicked\nhide\ngo to x: (0) y: (0)\ngo to [front v] layer\nforever\n    switch costume to (blank v)\n    switch costume to (join [l] (@Level))\nend\n\nwhen I receive [@game v]\nshow\nSETUP\n\ndefine Create clone position: (x) (y) type: (t) onLevel: (ol)\nset [x v] to (x)\nset [y v] to (y)\nset [type v] to (t)\nset [onlevel v] to (ol)\ncreate clone of (_myself_ v)\n\ndefine SETUP\nCreate clone position: [-100] [0] type: [kup] onLevel: [5]\nCreate clone position: [100] [0] type: [kup] onLevel: [5]\nCreate clone position: [0] [0] type: [lava] onLevel: [6]\nCreate clone position: [200] [0] type: [kup] onLevel: [7]\n\nwhen I start as a clone\n\n    if <(@Level) = (onLevel)> then\n        show\n    else\n        hide\n        if <(@Level) > (onLevel)> then\n            delete this clone\n        end\n    end\nend\n\nwhen I start as a clone\nif <(type) = [kup]> then\n    switch costume to (k0 v)\n    go to x: (x) y: (y)\n    \n        if <(@Level) = (onLevel)> then\n            wait (1.5) seconds\n            switch costume to (k1 v)\n            wait (1.5) seconds\n            switch costume to (k0 v)\n        end\n    end\nend\n\nwhen I start as a clone\nif <(type) = [lava]> then\n    switch costume to (lava v)\n    go to x: (x) y: (y)\n    go to [back v] layer\nend\n\n@Bounce\n\nwhen flag clicked\nhide\ngo to x: (0) y: (0)\ngo to [front v] layer\n\nwhen I receive [game - tick v]\nshow\nswitch costume to (blank v)\nswitch costume to (join [l] (@Level))\nif <touching (cake v)?> then\n    set [yvel v] to [18]\nend\n\n@Oil\n\nwhen flag clicked\nhide\ngo to x: (0) y: (0)\ngo to [front v] layer\n\nwhen I receive [game - tick v]\nshow\nswitch costume to (blank v)\nswitch costume to (join [l] (@Level))\nif <touching (cake v)?> then\n    change [xvel v] by (1)\nend\n\n@Door\n\nwhen flag clicked\nhide\ngo to x: (0) y: (0)\ngo to [front v] layer\n\nwhen I receive [game - tick v]\nshow\nswitch costume to (blank v)\nswitch costume to (join [l] (@Level))\nif <touching (cake v)?> then\n    broadcast (End v) and wait\nend\n\nwhen I receive [end v]\n\nset [@level v] to [9]\n\n@Numbers\n\ndefine fast print number (s) position x: (x) y: (y)\nset [i v] to [1]\nhide\nswitch costume to (blank v)\ngo to x: (x) y: (y)\nrepeat (length of (s))\n    switch costume to (join [n] (letter (i) of (s)))\n    change [i v] by (1)\n    change x by ((((50) + (size)) - (45)) / (2))\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nshow\ngo to [front v] layer\nwait () seconds\ndelete this clone\n\nwhen I receive [end v]\nforever\n    fast print number (join (round (Personal Time)) [~]) position x: [-30] y: [-140]\nend\n\n@celebrate\n\nwhen I start as a clone\nif <(id) > [1]> then\n    go to [front v] layer\n    switch costume to (confetti v)\n    clear graphic effects\n    show\n    go to x: (0) y: (0)\n    set [rx v] to (pick random (-240) to (240))\n    set [ry v] to (pick random (-180) to (180))\n    set [color v] effect to (pick random (0) to (200))\n    set [brightness v] effect to (pick random (-10) to (5))\n    set size to (pick random (50) to (100)) %\n    repeat until <<(round (x position)) = (rx)> and <(round (y position)) = (ry)>>\n        change x by (((rx) - (x position)) / (5))\n        change y by (((ry) - (y position)) / (5))\n        point towards (blank v)\n    end\n    wait (2) seconds\n    wait (pick random (.) to (.1)) seconds\n    repeat (10)\n        change [ghost v] effect by (10)\n        change y by (-5)\n    end\n    delete this clone\nelse\n    show\n    go to x: (0) y: (0)\n    point in direction (90)\n    clear graphic effects\n    switch costume to (banner v)\n    go to [front v] layer\n    repeat until <(round (size)) = [120]>\n        point in direction ((([sin v] of ((timer) * (700)) ) * (2)) + (90))\n        change size by (((120) - (size)) / (5))\n    end\n    set size to (120) %\n    wait (2) seconds\n    repeat (10)\n        change [ghost v] effect by (10)\n        change y by (-5)\n    end\n    delete this clone\nend\n\ndefine tick\nset [id v] to [0]\nrepeat (20)\n    change [id v] by (1)\n    create clone of (_myself_ v)\nend\n\nwhen I receive [you beat the highscore!! v]\nhide\nstart sound [Clapping v]\ntick\npoint in direction (90)\nset size to (100) %\n\n