Shrunk: a platformer | #games #all #trending

Instructions: Check out my new game!\nhttps://scratch.mit.edu/projects/646777774/\n\n-Use WAD or Arrow Keys to move around\n-Press R to restart a level

@Stage\n\nwhen flag clicked\nswitch backdrop to (backdrop1 v)\n\nwhen I receive [start game v]\nswitch backdrop to (backdrop2 v)\nset volume to (45) %\nforever\n    play sound [Clutterfunk v] until done\nend\n\n@Blank\n\n@Title\n\nwhen flag clicked\ngo to x: (0) y: (84)\nshow\nforever\n    point in direction ((90) + (([sin v] of ((timer) * (23)) ) * (1.5)))\n    set size to ((100) + (([sin v] of ((timer) * (250)) ) * (3))) %\nend\n\nwhen I receive [start game v]\nstop [other scripts in sprite v]\nhide\n\n@Start\n\nwhen flag clicked\nshow\ngo to x: (0) y: (-65)\nforever\n    set y to ((-65) + (([sin v] of ((timer) * (360)) ) * (1.5)))\n    if <touching (mouse-pointer v)?> then\n        set [brightness v] effect to (5)\n        set size to ((size) + (((120) - (size)) / (5))) %\n    else\n        set [brightness v] effect to (0)\n        set size to ((size) + (((102) - (size)) / (5))) %\n        point in direction ((direction) + (((90) - (direction)) / (5)))\n    end\nend\n\nwhen this sprite clicked\nbroadcast (start game v)\n\nwhen I receive [start game v]\nstop [other scripts in sprite v]\nstart sound [blipSelect v]\nhide\n\nwhen flag clicked\nforever\n    wait until <touching (mouse-pointer v)?>\n    set [pitch v] effect to (pick random (-20) to (20))\n    start sound [blipSelect \(1\) v]\n    wait until <not <touching (mouse-pointer v)?>>\n    set [pitch v] effect to (pick random (-20) to (20))\n    start sound [blipSelect \(2\) v]\nend\n\n@Player\n\nwhen flag clicked\nhide\n\nwhen I receive [start game v]\nshow\nset size to (200) %\ngo to x: (-200) y: (-10)\nset [xvel v] to [0]\nset [yvel v] to [0]\nforever\n    if <(size?) = [1]> then\n        set size to (200) %\n        physics [-1] [7] [15] [.75]\n    else\n        set size to (50) %\n        physics [-.6] [3] [6.5] [.75]\n    end\nend\n\ndefine physics (gravity) (speed) (jump power) (friction)\nswitch costume to (costume3 v)\nset [oldx v] to (x position)\nset [oldy v] to (y position)\nchange [yvel v] by (gravity)\nchange y by (yvel)\nif <not <<touching (level v)?> or <touching (door v)?>>> then\n    set [ground? v] to [0]\nelse\n    if <(yvel) > [1]> then\n        set [ground? v] to [0]\n    else\n        set [ground? v] to [1]\n    end\n    set y to (oldy)\n    set [yvel v] to [0]\nend\nif <<key (a v) pressed?> or <key (left arrow v) pressed?>> then\n    switch costume to (costume2 v)\n    set [xvel v] to ((speed) * (-1))\nend\nif <<key (d v) pressed?> or <key (right arrow v) pressed?>> then\n    switch costume to (costume1 v)\n    set [xvel v] to (speed)\nend\nchange x by (xvel)\nif <<touching (level v)?> or <touching (door v)?>> then\n    set x to (oldx)\nend\nset [xvel v] to ((xvel) * (friction))\nif <<<key (w v) pressed?> or <key (up arrow v) pressed?>> and <(ground?) = [1]>> then\n    set [pitch v] effect to (0)\n    start sound [jump v]\n    set [yvel v] to (jump power)\nend\nif <(yvel) > [1]> then\n    switch costume to (costume4 v)\n    if <<key (a v) pressed?> or <key (left arrow v) pressed?>> then\n        switch costume to (costume6 v)\n    end\n    if <<key (d v) pressed?> or <key (right arrow v) pressed?>> then\n        switch costume to (costume5 v)\n    end\nend\n\nwhen I receive [start game v]\nforever\n    wait until <(x position) > [243]>\n    broadcast (next level v)\nend\n\nwhen I receive [next level v]\ngo to x: (-200) y: (-10)\nset [xvel v] to [0]\nset [yvel v] to [0]\n\nwhen I receive [start game v]\nforever\n    wait until <<touching (spring v)?> or <touching (lava v)?>>\n    if <touching (spring v)?> then\n        set [pitch v] effect to (-45)\n        start sound [spring v]\n        set [yvel v] to [19]\n        wait until <not <touching (spring v)?>>\n    end\n    if <touching (lava v)?> then\n        start sound [hitHurt \(7\) v]\n        broadcast (dead v)\n        hide\n        wait (1.2) seconds\n        go to x: (-200) y: (-10)\n        set [xvel v] to [0]\n        set [yvel v] to [0]\n        show\n    end\nend\n\nwhen I receive [start game v]\nset [size? v] to [1]\nforever\n    wait until <not <<key (s v) pressed?> or <key (down arrow v) pressed?>>>\n    wait until <<key (s v) pressed?> or <key (down arrow v) pressed?>>\n    start sound [shrink v]\n    change y by (-15)\n    set [size? v] to [0]\n    wait until <not <<key (s v) pressed?> or <key (down arrow v) pressed?>>>\n    wait until <<key (s v) pressed?> or <key (down arrow v) pressed?>>\n    start sound [grow v]\n    change y by (15)\n    set [size? v] to [1]\nend\n\nwhen [r v] key pressed\ngo to x: (-200) y: (-10)\nset [xvel v] to [0]\nset [yvel v] to [0]\n\ngo to x: (245) y: (0)\n\n@thumbnail\n\nwhen flag clicked\nhide\n\nshow\ngo to [front v] layer\n\n@level\n\nwhen flag clicked\nhide\n\nwhen I receive [start game v]\nswitch costume to (1 v)\ngo to x: (0) y: (0)\nshow\n\nwhen I receive [next level v]\nnext costume\ngo to [front v] layer\n\n@lava\n\nwhen flag clicked\nhide\n\nwhen I receive [next level v]\nnext costume\n\nwhen I receive [start game v]\nshow\nswitch costume to (costume1 v)\nforever\n    go to [back v] layer\n    set y to (([sin v] of ((timer) * (350)) ) * (3))\nend\n\n@spring\n\nwhen flag clicked\nhide\n\nwhen I receive [next level v]\nnext costume\n\nwhen I receive [start game v]\nswitch costume to (costume2 v)\nshow\nforever\n    go to [back v] layer\nend\n\nset [pitch v] effect to (-25)\n\n@button\n\nwhen flag clicked\nhide\n\nwhen I receive [next level v]\ngo to [back v] layer\nnext costume\nshow\nwait until <touching (player v)?>\nstart sound [click \(3\) v]\nbroadcast (door v)\nnext costume\n\nwhen I receive [start game v]\nshow\nswitch costume to (costume1 v)\n\n@door\n\nwhen flag clicked\nhide\n\nwhen I receive [start game v]\nshow\nswitch costume to (costume1 v)\n\nwhen I receive [door v]\nhide\n\nwhen I receive [next level v]\ngo to [back v] layer\nnext costume\nshow\n\n@dead\n\nwhen I receive [dead v]\nshow\nif <([size? v] of [player v]) = [1]> then\n    set size to (200) %\nelse\n    set size to (50) %\nend\ngo to (player v)\nset [xvel v] to [-7]\nset [yvel v] to [20]\nrepeat until <(y position) < [-170]>\n    turn right (yvel) degrees\n    change x by (xvel)\n    change y by (yvel)\n    set [xvel v] to ((xvel) * (.89))\n    change [yvel v] by (-2)\n    go to [front v] layer\nend\nhide\n\nwhen flag clicked\nhide\n\n