Squarey ~ A Platformer

Instructions: PART 2 IS OUT!!!!!: https://scratch.mit.edu/projects/570074435/\n\n\nEdit: Yaaaaaaaaayyyy!!!!!!! It is fully mobile friendly!!!!!!!!! if you are on mobile tapping below the player will duck the player. On mobile hold/tap where you want to go!\n\nEdit: Eeeeeee! I added mobile controls!!!! (26/10/2021)\nMobile friendly is a WIP. You cannot fully play the game since there is not a duck feature. You can go inside and skip the level but remember to stay tuned because Squarey 2 will be fully mobile friendly!!\nHi,\nI haven't shared a game in forever so I decided to quickly throw this together! A part 2 will be coming soon so make sure you love, fave and follow to stay updated! :)\n\n*******************************Story***********************************\nSo basically you live in square-land and when bad people come they take your family! Your job is to rescue them!\n\n******************************Controls********************************Use the arrow keys and if you are on mobile tap where you want to go Also 'r' key to re-spawn the level. If you get stuck spam the 'r' key until you re-spawn. :)\n\nHave fun! I hope you like it!\n\n\n@Fazah_Champ loved, faved and commented!! \nThx everyone so much for 271 views, 42 hearts and 38 stars! :)\n

@Stage\n\nwhen flag clicked\nswitch backdrop to (backdrop5 v)\nset [ghost v] effect to (25)\nforever\n    if <(level :O) = [11]> then\n        switch backdrop to (backdrop3 v)\n    end\n    if <(level :O) = [12]> then\n        switch backdrop to (backdrop2 v)\n    end\n    if <(level :O) = [12]> then\n        switch backdrop to (backdrop2 v)\n    end\n    if <(level :O) = [19]> then\n        switch backdrop to (backdrop4 v)\n    end\n    if <(level :O) = [20]> then\n        switch backdrop to (backdrop1 v)\n    end\nend\n\nwhen I receive [game v]\nswitch backdrop to (backdrop1 v)\n\nwhen I receive [game v]\nforever\n    play sound [Dance Celebrate v] until done\nend\n\n@Hi!!!!! :)\n\n@Player\n\ndefine Platformer\nchange x by (Xspeed)\nrepeat (8)\n    change y by ((1) * <touching (ground v)?>)\nend\nif <touching (ground v)?> then\n    change y by (-8)\n    repeat until <not <touching (ground v)?>>\n        change x by ((0) - ((Xspeed) / ([abs v] of (Xspeed) )))\n    end\n    set [xspeed v] to [0]\nend\nchange [xspeed v] by ((<<key (right arrow v) pressed?> or <<mouse down?> and <(mouse x) > (x position)>>> - <<key (left arrow v) pressed?> or <<mouse down?> and <(mouse x) < (x position)>>>) + ((0.5) * ((<[-10] > (Xspeed)> - <(Xspeed) > [10]>) + (<[0] > (Xspeed)> - <(Xspeed) > [0]>))))\nchange y by (Yspeed)\nif <touching (ground v)?> then\n    repeat until <not <touching (ground v)?>>\n        change y by ((0) - ((Yspeed) / ([abs v] of (Yspeed) )))\n    end\n    set [yspeed v] to ((15) * <<(Yspeed) < [0]> and <<<key (up arrow v) pressed?> or <<mouse down?> and <(mouse y) > (y position)>>> or <key (space v) pressed?>>>)\nend\nchange [yspeed v] by (-1)\n\nwhen flag clicked\nswitch costume to (normal v)\ngo to x: (-205) y: (-66)\nset size to (25) %\nforever\n    Platformer\nend\n\nwhen flag clicked\nhide\nforever\n    if <<key (down arrow v) pressed?> or <<mouse down?> and <(y position) > (mouse y)>>> then\n        switch costume to (duck v)\n    end\n    if <not <<key (down arrow v) pressed?> or <<mouse down?> and <(y position) > (mouse y)>>>> then\n        switch costume to (normal v)\n    end\nend\n\nwhen flag clicked\nforever\n    if <touching (next level v)?> then\n        broadcast (next level. :OOOO v)\n    end\n    if <touching (danger\(u dead again\)  d: v)?> then\n        broadcast (restart v)\n    end\nend\n\nwhen I receive [next level. :oooo v]\nchange [level :o v] by (1)\nswitch costume to (normal v)\ngo to x: (-205) y: (-66)\nset size to (25) %\nshow\n\nwhen flag clicked\nforever\n    if <touching (barrier\(u dead\) v)?> then\n        broadcast (restart v)\n    end\n    if <key (r v) pressed?> then\n        broadcast (restart v)\n    end\n    if <touching (growberry v)?> then\n        set size to (35) %\n        go to x: (-196) y: (-57)\n        broadcast (go away berry v)\n    end\n    if <touching (little sis v)?> then\n        broadcast (fade sissy v)\n    end\n    if <touching (little bro v)?> then\n        broadcast (fade bro lol v)\n    end\n    if <touching (mum square v)?> then\n        broadcast (collect meh mum v)\n    end\n    if <touching (dad square v)?> then\n        broadcast (Fade Away v)\n    end\n    if <<touching (next level v)?> and <(level :O) = [31]>> then\n        broadcast (Family! v)\n    end\nend\n\nwhen I receive [restart v]\ngo to x: (-205) y: (-66)\nset size to (25) %\nshow\n\nwhen flag clicked\nset [y-axis v] to [0]\nchange [y-axis v] by (-1)\nforever\n    if <touching (bouncy\(he he\) v)?> then\n        change [y-axis v] by (pick random (10) to (15))\n    end\nend\n\nwhen flag clicked\nforever\n    if <touching (bouncy\(he he\) v)?> then\n        change y by (Y-Axis)\n    end\nend\n\nwhen flag clicked\nhide\nset [level :o v] to [1]\nswitch costume to (normal v)\n\nwhen I receive [game v]\nshow\n\nwhen flag clicked\nforever\n    if <[] = [yes]> then\n        switch costume to (duck v)\n    end\n    if <[] = [no]> then\n        switch costume to (normal v)\n    end\nend\n\n@Ground\n\nwhen flag clicked\nhide\nswitch costume to (costume1 v)\ngo to x: (0) y: (0)\ngo to [front v] layer\n\nshow\n\nwhen I receive [next level. :oooo v]\nnext costume\n\nwhen I receive [game v]\nshow\n\n@Danger(u dead again)  D:\n\nwhen flag clicked\nswitch costume to (costume1 v)\ngo to [back v] layer\ngo to x: (0) y: (0)\nshow\n\nwhen I receive [next level. :oooo v]\nnext costume\n\n@next level\n\nwhen flag clicked\nforever\n    go to x: (0) y: (0)\n    set [ghost v] effect to (100)\nend\n\n@barrier(u dead)\n\nwhen flag clicked\nforever\n    go to x: (0) y: (37)\n    set [ghost v] effect to (100)\nend\n\n@GrowBerry\n\nwhen I receive [next level. :oooo v]\nnext costume\nshow\n\nwhen flag clicked\nswitch costume to (costume1 v)\ngo to [front v] layer\ngo to x: (0) y: (0)\nshow\n\nwhen I receive [go away berry v]\nhide\n\n@mum square\n\nwhen I receive [collect meh mum v]\n\nwhen flag clicked\n\nhide\n\nforever\n    if <(level :O) = [31]> then\nend\n\nwhen I receive [family! v]\ngo to [front v] layer\nset size to (30) %\ngo to x: (130) y: (125)\n\nshow\n\nwhen flag clicked\nforever\n    if <(level :O) = [31]> then\n        go to x: (130) y: (125)\n        show\n    end\nend\n\nwhen flag clicked\nhide\n\n@dad square\n\nwhen flag clicked\nforever\n    if <(level :O) = [31]> then\n        go to x: (-37) y: (167)\n        show\n    end\nend\n\nhide\n\ngo to [front v] layer\nset size to (31) %\n\nwhen I receive [fade away v]\n\nhide\n\nwhen I receive [family! v]\n\nwhen flag clicked\nhide\n\n@little bro\n\nwhen flag clicked\n\nhide\n\nwhen I receive [fade bro lol v]\n\nhide\n\nwhen I receive [family! v]\n\nwhen flag clicked\nforever\n    if <(level :O) = [31]> then\n        go to x: (12) y: (28)\n        show\n    end\nend\n\nwhen flag clicked\nhide\n\n@little sis\n\nwhen flag clicked\nhide\nhide\n\nwhen I receive [fade sissy v]\n\nwhen I receive [family! v]\ngo to [front v] layer\nset size to (20) %\ngo to x: (-120) y: (-27)\nshow\n\nwhen flag clicked\nforever\n    if <(level :O) = [31]> then\n        go to x: (-120) y: (-27)\n        show\n    end\nend\n\nhide\n\n@words/talky person?\n\nwhen [timer v] > (timer2)\nhide\n\nwhen flag clicked\nhide\nswitch costume to (costume1 v)\ngo [forward v] (99999999999999999999999999999) layers\ngo to [front v] layer\n\nwhen I receive [next level. :oooo v]\nnext costume\n\nwhen I receive [game v]\nshow\n\n@scene thing\n\nwhen flag clicked\nhide\n\nwhen I receive [scene... v]\nswitch costume to (costume1 v)\ngo to [front v] layer\nshow\nwait (1.5) seconds\nswitch costume to (costume2 v)\nwait (1.5) seconds\nswitch costume to (costume3 v)\nwait (1.5) seconds\nbroadcast (game v)\nhide\n\n@Swipe\n\nwhen flag clicked\nset [cloneid v] to [0]\nshow\ngo to x: (544) y: (79)\nrepeat (22)\n    change x by (-25)\nend\nrepeat (1)\n    create clone of (_myself_ v)\nend\nrepeat (20)\n    change y by (30)\nend\nhide\nbroadcast (Logo v)\n\nwhen I start as a clone\nchange [cloneid v] by (1)\nwait (0.5) seconds\ngo to x: (-6) y: (-273)\nrepeat (20)\n    change y by (-30)\nend\nhide\n\nwhen I receive [final swipe v]\nshow\ngo to x: (-121) y: (-352)\nrepeat (12)\n    change y by (30)\nend\nwait (1) seconds\nhide\nclear sound effects\nstop all sounds\nbroadcast (scene... v)\n\nwhen flag clicked\nplay sound [Odesong v] until done\n\n@Logo\n\nwhen flag clicked\nswitch costume to (anime me5 v)\nhide\ngo to x: (-7) y: (-2)\npoint in direction (90)\nrepeat (10)\n    turn right (18) degrees\nend\npoint in direction (90)\nrepeat (10)\n    turn left (18) degrees\nend\npoint in direction (90)\nrepeat (10)\n    go to x: (pick random (5) to (15)) y: (pick random (5) to (15))\nend\nrepeat (3)\n    wait (0.2) seconds\n    repeat (2)\n        change [ghost v] effect by (25)\n    end\n    next costume\n    repeat (2)\n        change [ghost v] effect by (-25)\n    end\nend\nwait (1) seconds\nhide\nbroadcast (Final Swipe v) and wait\n\nwhen I receive [logo v]\nshow\n\n@tb\n\nwhen flag clicked\nforever\n    set [timer2 v] to ((timer) + (.1))\nend\n\nwhen [timer v] > (timer2)\ngo to x: (0) y: (0)\ngo to [front v] layer\nshow\n\nwhen flag clicked\nhide\n\n