lightning || a mobile platformer

Instructions: ==========================================\nᒪIGᕼTᑎIᑎG || ᗩ ᗰOᗷIᒪE ᑭᒪᗩTᖴOᖇᗰEᖇ\n==========================================\n[ play the sequel ]\n[ https://scratch.mit.edu/projects/347297963 ]\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 your family, and have fun ]\n==========================================\nOnce upon a time...\nYou had a family.\nYou were the happiest cube on Earth.\nBut then a storm came...\nAnd it blew them away.\nYou were alone. \nYou were lost in the dark.\nYou couldn't see anything.\nThen you were it by a lightning that gave you the power to light up everything around you.\nNow you must find your family!\n==========================================\n#lightning #a #mobile #platformer

@Stage\n\nwhen I receive [go v]\nwait (1) seconds\nforever\n    play sound [Coldplay || Fix You v] until done\nend\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\n@Introduction\n\nwhen flag clicked\nhide\n\nwhen I receive [introduction v]\nshow\nswitch costume to (costume1 v)\nrepeat (7)\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 [s v] key pressed\nif <not <(Level) = [15]>> then\n    change [level v] by (1)\n    broadcast (change v)\n    go to x: (-175) y: (-50)\n    switch costume to (costume1 v)\nend\n\nwhen flag clicked\nforever\n    if <touching (portal v)?> 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    end\nend\n\nwhen [r v] key pressed\ngo to x: (-175) y: (-50)\nswitch costume to (costume1 v)\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    end\n    if <touching (bouncy v)?> then\n        set [yv v] to [20]\n    end\n    change y by (1)\nend\n\n@Light\n\nwhen flag clicked\nhide\n\nwhen I receive [go v]\nshow\nforever\n    go to (player v)\n    go [backward v] (1) layers\n    if <(Level) < [8]> then\n        switch costume to (costume1 v)\n    end\n    if <(Level) = [8]> then\n        switch costume to (costume2 v)\n    end\n    if <(Level) > [8]> then\n        hide\n        stop [this script v]\n    end\nend\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\n@Spikes\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 [key v]\nhide\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 to x: (0) y: (-10)\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\nforever\n    switch costume to (Level)\n    go [backward v] (1) layers\nend\n\nwhen I receive [key v]\nhide\n\n@Portal\n\nwhen flag clicked\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: (180) y: (-30)\n        switch costume to (costume1 v)\n    end\n    if <(Level) = [2]> then\n        go to x: (200) y: (-50)\n    end\n    if <(Level) = [3]> then\n        go to x: (175) y: (100)\n    end\n    if <(Level) = [4]> then\n        go to x: (200) y: (140)\n    end\n    if <(Level) = [5]> then\n        go to x: (-125) y: (100)\n    end\n    if <(Level) = [6]> then\n        go to x: (130) y: (-75)\n    end\n    if <(Level) = [7]> then\n        go to x: (180) y: (135)\n    end\n    if <(Level) = [8]> then\n        go to x: (115) y: (20)\n        switch backdrop to (game2 v)\n        switch costume to (costume2 v)\n    end\n    if <(Level) = [9]> then\n        go to x: (200) y: (-80)\n        switch backdrop to (game3 v)\n    end\n    if <(Level) = [10]> then\n        go to x: (200) y: (-40)\n    end\n    if <(Level) = [11]> then\n        go to x: (200) y: (-85)\n    end\n    if <(Level) = [12]> then\n        go to x: (200) y: (0)\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: (190) y: (125)\n    end\n    if <(Level) = [15]> then\n        hide\n    end\nend\n\nwhen I receive [go v]\nset [brightness v] effect to (75)\nshow\nforever\n    repeat (10)\n        change [brightness v] effect by (5)\n    end\n    repeat (10)\n        change [brightness v] effect by (-5)\n    end\n    repeat (10)\n        change [brightness v] effect by (-5)\n    end\n    repeat (10)\n        change [brightness v] effect by (5)\n    end\nend\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@Mini Light\n\nwhen I start as a clone\nshow\ngo to [back v] layer\npoint in direction (180)\ngo to x: (pick random (-200) to (200)) y: (185)\nset size to (pick random (10) to (15)) %\nset [ghost v] effect to (pick random (30) to (50))\ngo to [back v] layer\nrepeat until <(y position) < [-220]>\n    change y by (-1.25)\nend\ndelete this clone\n\nwhen flag clicked\nhide\n\nwhen I receive [go v]\nforever\n    show\n    wait (pick random (0.1) to (0.5)) seconds\n    create clone of (_myself_ v)\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 (game1 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 (game1 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@Family\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\nset [level v] to [0]\nwait until <(Level) = [15]>\nshow\n\nwhen I receive [key v]\nwait (1) seconds\nsay [Yay!!! You found us! We were so worry...] for (5) seconds\nsay [Thank you for completing your mission.] for (5) seconds\nsay [You were very brave.] for (5) seconds\nsay [Love, Favorite and Follow for more...] for (5) seconds\nsay [I hope you liked the game.] for (5) seconds\nsay [Are you still here?] for (5) seconds\nsay [This is the end... for now.] for (5) seconds\nsay [Love, Favorite and Follow for more.] for (5) seconds\n\n@Key\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\nset [level v] to [0]\nwait until <(Level) = [15]>\nshow\nforever\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    end\nend\n\n@The End\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\nset [ghost v] effect to (100)\n\nwhen I receive [key v]\nshow\nrepeat (100)\n    change [ghost v] effect by (-1)\nend\n\n