home || a mobile platformer

Instructions: ==========================================\nᕼOᗰE || ᗩ ᗰOᗷIᒪE ᑭᒪᗩTᖴOᖇᗰEᖇ\n==========================================\n[ play first part before ]\n[ https://scratch.mit.edu/projects/341786992 ]\n==========================================\n[ use arrow keys or touch to move ]\n[ don't touch ∆ ]\n[ π makes you jump very high ]\n[ get to the portal to pass the level ]\n[ all levels are possible ]\n[ press R to restart a level ]\n[ press S to skip a level ]\n[ find a new home, and have fun ]\n==========================================\nOnce upon a time...\nA storm blew away your family.\nNow you found them.\nBut your journey around Earth is not over.\nYou must find a new home.\nYour old house was destroyed.\nSearch for the keys...\nAnd travel through the portals that will open.\n==========================================\n#home #a #mobile #platformer

@Stage\n\nwhen I receive [introduction v]\nplay sound [Coldplay || Paradise v] until done\n\n@Intro\n\nwhen flag clicked\nset [ghost v] effect to (0)\ngo to x: (0) y: (0)\nshow\nset [level v] to [0]\nswitch backdrop to (intro backdrop v)\nswitch costume to (giphy-1 v)\nstart sound [Something Just Like This || Short Version v]\nrepeat (199)\n    next costume\nend\nrepeat (100)\n    change [ghost v] effect by (1)\nend\nhide\nswitch backdrop to (home v)\n\n@Thumbnail\n\nwhen flag clicked\nhide\nset [ghost v] effect to (100)\n\nwhen flag clicked\nforever\n    reset timer\nend\n\nwhen [timer v] > (0.000001)\ngo to x: (0) y: (200)\ngo to [front v] layer\nshow\nset [ghost v] effect to (0)\nglide (1) secs to x: (0) y: (0)\n\nwhen [s v] key pressed\nif <not <(Level) = [15]>> then\n    change [level v] by (1)\n    broadcast (change v)\n    broadcast (next level v)\nend\n\n@Introduction\n\nwhen flag clicked\nhide\n\nwhen I receive [introduction v]\nshow\nswitch costume to (costume1 v)\nrepeat (5)\n    wait (5) seconds\n    broadcast (change v)\n    next costume\nend\nwait (5) seconds\nhide\nbroadcast (change v)\nbroadcast (go v)\n\n@Change\n\nwhen flag clicked\nhide\n\nwhen I receive [change v]\ngo to x: (0) y: (0)\nshow\ngo to [front v] layer\nset [ghost v] effect to (0)\nrepeat (25)\n    go to [front v] layer\n    change [ghost v] effect by (4)\nend\nhide\n\n@Player\n\nwhen flag clicked\nforever\n    if <<touching (portal v)?> and <(Key) = [yes]>> then\n        change [level v] by (1)\n        broadcast (change v)\n        go to x: (-175) y: (-50)\n        switch costume to (costume1 v)\n        broadcast (next level v)\n    end\nend\n\nwhen [r v] key pressed\ngo to x: (-175) y: (-50)\nswitch costume to (costume1 v)\nset [key v] to [no]\nset [xv v] to [0]\nset [yv v] to [0]\n\nwhen flag clicked\nhide\n\nwhen I receive [go v]\nshow\nswitch costume to (costume1 v)\nset [level v] to [1]\nset [xv v] to [0]\nset [yv v] to [0]\nhide variable [level v]\ngo to x: (-175) y: (-50)\nforever\n    if <<key (right arrow v) pressed?> or <<mouse down?> and <(mouse x) > (x position)>>> then\n        change [xv v] by (1)\n        switch costume to (costume1 v)\n    end\n    if <<key (left arrow v) pressed?> or <<mouse down?> and <(mouse x) < (x position)>>> then\n        change [xv v] by (-1)\n        switch costume to (costume2 v)\n    end\n    set [xv v] to ((Xv) * (0.9))\n    change x by (Xv)\n    if <touching (ground v)?> then\n        change y by (1)\n        if <touching (ground v)?> then\n            change y by (1)\n            if <touching (ground v)?> then\n                change y by (1)\n                if <touching (ground v)?> then\n                    change y by (1)\n                    if <touching (ground v)?> then\n                        change y by (1)\n                        if <touching (ground v)?> then\n                            change x by ((Xv) * (-1))\n                            change y by (-5)\n                            if <<key (up arrow v) pressed?> or <<mouse down?> and <(mouse y) > (y position)>>> then\n                                if <(Xv) > [0]> then\n                                    set [xv v] to [-5]\n                                else\n                                    set [xv v] to [5]\n                                end\n                                set [yv v] to [10]\n                            else\n                                set [xv v] to [0]\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change [yv v] by (-1)\n    change y by (Yv)\n    if <touching (ground v)?> then\n        change y by ((Yv) * (-1))\n        set [yv v] to [0]\n    end\n    change y by (-1)\n    if <touching (ground v)?> then\n        if <<key (up arrow v) pressed?> or <<mouse down?> and <(mouse y) > (y position)>>> then\n            set [yv v] to [13]\n        end\n    end\n    if <touching (spikes v)?> then\n        broadcast (touched spikes v)\n        repeat (10)\n            change [ghost v] effect by (1)\n        end\n        wait (0.25) seconds\n        go to x: (-175) y: (-50)\n        set [ghost v] effect to (0)\n        switch costume to (costume1 v)\n        set [xv v] to [0]\n        set [yv v] to [0]\n        set [key v] to [no]\n    end\n    if <touching (storm v)?> then\n        broadcast (boss fight v)\n        repeat (10)\n            change [ghost v] effect by (1)\n        end\n        wait (0.25) seconds\n        go to x: (-175) y: (-50)\n        set [ghost v] effect to (0)\n        switch costume to (costume1 v)\n        set [xv v] to [0]\n        set [yv v] to [0]\n        set [key v] to [no]\n    end\n    if <touching (bouncy v)?> then\n        set [yv v] to [20]\n    end\n    change y by (1)\nend\n\nwhen I receive [go v]\nforever\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nforever\n    show\n    set [ghost v] effect to (0)\n    repeat (10)\n        change [ghost v] effect by (10)\n        change size by (-0.5)\n    end\n    hide\n    delete this clone\nend\n\nwhen I start as a clone\nforever\n    if <touching (spikes v)?> then\n        delete this clone\n    end\nend\n\nwhen I receive [next level v]\ngo to x: (-175) y: (-50)\nswitch costume to (costume1 v)\n\n@Ground\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\n\nwhen I receive [go v]\nshow\nforever\n    switch costume to (Level)\nend\n\nwhen I receive [go v]\nwait until <(Level) = [15]>\nsay [Thank you for finding a new home!]\n\n@Spikes\n\nwhen flag clicked\ngo to x: (0) y: (0)\nset [ghost v] effect to (0)\nhide\n\nwhen I receive [go v]\nshow\nforever\n    switch costume to (Level)\nend\n\nwhen flag clicked\nset [level v] to [0]\nforever\n    if <(Level) = [13]> then\n        forever\n            go to x: (0) y: (0)\n            repeat (10)\n                change [ghost v] effect by (-10)\n            end\n            wait (2) seconds\n            repeat until <(y position) = [-175]>\n                change y by (-5)\n            end\n            repeat (10)\n                change [ghost v] effect by (10)\n            end\n            wait (0.5) seconds\n        end\n    end\n    if <(Level) = [14]> then\n        hide\n        stop [this script v]\n    end\nend\n\n@Bouncy\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\n\nwhen I receive [go v]\nshow\nforever\n    switch costume to (Level)\n    if <touching (player v)?> then\n        go [backward v] (1) layers\n        glide (0.15) secs to x: (0) y: (-10)\n        glide (0.15) secs to x: (0) y: (0)\n    else\n        go to x: (0) y: (0)\n    end\nend\n\n@Story\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\n\nwhen I receive [go v]\nshow\nrepeat until <(Level) = [14]>\n    switch costume to (Level)\nend\nswitch costume to (costume14 v)\nwait until <key (q v) pressed?>\nswitch costume to (costume15 v)\nwait until <key (space v) pressed?>\nbroadcast (boss fight v)\nhide\n\nwhen I receive [go v]\nforever\n    if <<(Level) = [14]> and <key (s v) pressed?>> then\n        hide\n    end\nend\n\n@Portal\n\nwhen flag clicked\nswitch costume to (costume1 v)\nhide\n\nwhen I receive [go v]\nshow\nset size to (100) %\nforever\n    repeat (10)\n        change size by (1.3)\n    end\n    repeat (10)\n        change size by (-1.3)\n    end\n    repeat (10)\n        change size by (-1.3)\n    end\n    repeat (10)\n        change size by (1.3)\n    end\nend\n\nwhen I receive [go v]\npoint in direction (90)\nshow\nforever\n    repeat (20)\n        turn right (-2.5) degrees\n    end\n    repeat (20)\n        turn right (2.5) degrees\n    end\n    repeat (20)\n        turn right (2.5) degrees\n    end\n    repeat (20)\n        turn right (-2.5) degrees\n    end\nend\n\nwhen I receive [go v]\nshow\nforever\n    if <(Level) = [1]> then\n        go to x: (187) y: (-40)\n    end\n    if <(Level) = [2]> then\n        go to x: (175) y: (75)\n    end\n    if <(Level) = [3]> then\n        go to x: (200) y: (125)\n    end\n    if <(Level) = [4]> then\n        go to x: (-175) y: (125)\n    end\n    if <(Level) = [5]> then\n        go to x: (212) y: (120)\n    end\n    if <(Level) = [6]> then\n        go to x: (90) y: (-40)\n    end\n    if <(Level) = [7]> then\n        go to x: (165) y: (120)\n    end\n    if <(Level) = [8]> then\n        go to x: (100) y: (125)\n    end\n    if <(Level) = [9]> then\n        go to x: (140) y: (0)\n    end\n    if <(Level) = [10]> then\n        go to x: (185) y: (45)\n    end\n    if <(Level) = [11]> then\n        go to x: (90) y: (-90)\n    end\n    if <(Level) = [12]> then\n        go to x: (75) y: (-90)\n    end\n    if <(Level) = [13]> then\n        go to x: (180) y: (-85)\n    end\n    if <(Level) = [14]> then\n        go to x: (200) y: (-90)\n    end\n    if <(Level) = [15]> then\n        hide\n    end\nend\n\nwhen I receive [next level v]\nif <not <(Level) = [15]>> then\n    switch costume to (costume1 v)\n    show\nend\n\nwhen I receive [key v]\nswitch costume to (costume2 v)\n\nwhen I receive [touched spikes v]\nwait (0.5) seconds\nswitch costume to (costume1 v)\n\n@Touched Spikes\n\nwhen flag clicked\nhide\n\nwhen I receive [touched spikes v]\ngo to x: (0) y: (0)\nshow\ngo to [front v] layer\nwait (0.5) seconds\nhide\n\nwhen I receive [change v]\nhide\n\n@Clouds\n\nwhen I start as a clone\nforever\n    switch costume to (pick random (1) to (3))\n    show\n    go to [back v] layer\n    point in direction (-90)\n    go to x: (210) y: (pick random (0) to (200))\n    set size to (pick random (65) to (100)) %\n    set [ghost v] effect to (pick random (5) to (65))\n    repeat until <(x position) < [-230]>\n        change x by (-1)\n    end\n    delete this clone\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [go v]\nforever\n    if <(Level) = [14]> then\n        delete this clone\n    else\n        wait (pick random (3) to (5)) seconds\n        create clone of (_myself_ v)\n    end\nend\n\n@Home1\n\nwhen flag clicked\npoint in direction (90)\nforever\n    if <(backdrop [name v]) = [Home]> then\n        show\n        if <touching (mouse-pointer v)?> then\n            point in direction (90)\n            set size to (120) %\n            if <mouse down?> then\n                broadcast (introduction v)\n                broadcast (change v)\n                switch backdrop to (game v)\n                hide\n            end\n        else\n            set size to (100) %\n        end\n    else\n        hide\n    end\nend\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\n\nwhen I receive [go v]\nhide\n\nwhen I receive [instructions v]\nhide\n\n@Home2\n\nwhen flag clicked\npoint in direction (90)\nforever\n    if <(backdrop [name v]) = [Home]> then\n        show\n        if <touching (mouse-pointer v)?> then\n            point in direction (90)\n            set size to (120) %\n            go to x: (0) y: (10)\n            if <mouse down?> then\n                broadcast (go v)\n                broadcast (change v)\n                switch backdrop to (game v)\n                hide\n            end\n        else\n            go to x: (0) y: (0)\n            set size to (100) %\n        end\n    else\n        hide\n    end\nend\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\n\nwhen I receive [introduction v]\nhide\n\nwhen I receive [instructions v]\nhide\n\n@Home3\n\nwhen flag clicked\npoint in direction (90)\nforever\n    if <(backdrop [name v]) = [Home]> then\n        show\n        if <touching (mouse-pointer v)?> then\n            point in direction (90)\n            go to x: (-35) y: (5)\n            set size to (120) %\n            if <mouse down?> then\n                broadcast (instructions v)\n                broadcast (change v)\n                switch backdrop to (credits and stuff v)\n                hide\n            end\n        else\n            go to x: (0) y: (0)\n            set size to (100) %\n        end\n    else\n        hide\n    end\nend\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\n\nwhen I receive [introduction v]\nhide\n\n@Back Home\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\n\nwhen flag clicked\npoint in direction (90)\nforever\n    if <(backdrop [name v]) = [Credits and Stuff]> then\n        show\n        if <touching (mouse-pointer v)?> then\n            point in direction (90)\n            go to x: (35) y: (20)\n            set size to (120) %\n            if <mouse down?> then\n                broadcast (change v)\n                switch backdrop to (home v)\n                hide\n            end\n        else\n            go to x: (0) y: (0)\n            set size to (100) %\n        end\n    else\n        hide\n    end\nend\n\n@Key\n\nwhen I receive [go v]\nset [key v] to [no]\nforever\n    switch costume to (Level)\n    if <touching (player v)?> then\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n        hide\n        broadcast (key v)\n        set [key v] to [yes]\n    end\n    if <(Key) = [no]> then\n        show\n        set [ghost v] effect to (0)\n    end\nend\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\n\nwhen I receive [next level v]\nset [key v] to [no]\n\n@The End\n\nwhen flag clicked\nset [level v] to [0]\ngo to x: (0) y: (0)\nhide\nset [ghost v] effect to (100)\nwait until <(Level) = [15]>\nshow\nrepeat (100)\n    change [ghost v] effect by (-1)\nend\n\n@Shadows\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\nset [ghost v] effect to (50)\n\nwhen I receive [go v]\nshow\nforever\n    switch costume to (Level)\n    go [backward v] (1) layers\nend\n\n@Storm\n\nwhen flag clicked\nerase all\ngo to x: (0) y: (0)\nhide\nset size to (100) %\nset [ghost v] effect to (100)\nset [brightness v] effect to (0)\n\nwhen I receive [boss fight v]\nerase all\ngo to x: (0) y: (0)\nshow\nset size to (100) %\nset [ghost v] effect to (100)\nset [brightness v] effect to (0)\nswitch costume to (costume1 v)\nrepeat (100)\n    change [ghost v] effect by (-1)\n    change volume by (-1)\nend\nstamp\nhide\nswitch costume to (costume2 v)\nrepeat (7)\n    set size to (pick random (100) to (150)) %\n    set [brightness v] effect to (pick random (0) to (20))\n    go to x: (pick random (-100) to (125)) y: (0)\n    wait (pick random (0.5) to (1.5)) seconds\n    show\n    wait (0.5) seconds\n    hide\nend\ngo to x: (0) y: (0)\nswitch costume to (costume1 v)\nerase all\nset [key v] to [yes]\nbroadcast (key v)\nrepeat (100)\n    change [ghost v] effect by (1)\n    change volume by (1)\nend\nhide\n\nwhen I receive [go v]\nset volume to (100) %\nwait (0.5) seconds\nforever\n    play sound [Coldplay || Something Just Like This v] until done\nend\n\n