Upside-poʍu | A Mobile Platformer


@Stage\n\n@Thumb\n\nwhen flag clicked\nforever\n    set [ghost v] effect to (100)\n    go to [front v] layer\nend\n\n@Player\n\nwhen flag clicked\ngo to x: (0) y: (28)\nshow\nforever\n    if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n        change [xv v] by (0.75)\n    end\n    if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n        change [xv v] by (-0.75)\n    end\n    set [xv v] to ((Xv) * (0.9))\n    change x by (Xv)\n    if <<touching (ground v)?> or <touching (moving platform v)?>> then\n        change y by (1)\n        if <<touching (ground v)?> or <touching (moving platform v)?>> then\n            change y by (1)\n            if <<touching (ground v)?> or <touching (moving platform v)?>> then\n                change y by (1)\n                if <<touching (ground v)?> or <touching (moving platform v)?>> then\n                    change y by (1)\n                    if <<touching (ground v)?> or <touching (moving platform v)?>> then\n                        change y by (1)\n                        if <<touching (ground v)?> or <touching (moving platform v)?>> then\n                            change y by (1)\n                            if <<touching (ground v)?> or <touching (moving platform v)?>> then\n                                change y by (1)\n                                if <<touching (ground v)?> or <touching (moving platform v)?>> then\n                                    change y by (1)\n                                    if <<touching (ground v)?> or <touching (moving platform v)?>> then\n                                        change y by (1)\n                                        if <<touching (ground v)?> or <touching (moving platform v)?>> then\n                                            change y by (1)\n                                            if <<touching (ground v)?> or <touching (moving platform v)?>> then\n                                                change y by (1)\n                                                if <<touching (ground v)?> or <touching (moving platform v)?>> then\n                                                    change x by ((Xv) * (-1))\n                                                    change y by (-5)\n                                                    set [xv v] to [0]\n                                                end\n                                            end\n                                        end\n                                    end\n                                end\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)?> or <touching (moving platform v)?>> then\n        change y by ((Yv) * (-1))\n        set [yv v] to [0]\n    end\n    change y by (-1)\n    change y by (1)\n    if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> and <touching (jump v)?>> then\n        set [yv v] to [15]\n    end\n    if <touching (portal v)?> then\n        broadcast (NEXT LEVEL v)\n    end\nend\n\nwhen flag clicked\nforever\n    play sound [Invincible v] until done\nend\n\nwhen flag clicked\nforever\n    if <<key (r v) pressed?> or <touching (spikes v)?>> then\n        go to x: (0) y: (28)\n    end\nend\n\nwhen I receive [next level v]\nchange [level v] by (1)\ngo to x: (0) y: (-5)\n\n@Sun\n\nwhen flag clicked\npoint in direction (90)\n\n@Portal\n\nwhen flag clicked\nswitch costume to (costume1 v)\ngo to x: (193) y: (-31)\nforever\n    change [y v] by (7.5)\n    change y by ([sin v] of (y) )\nend\n\nwhen I receive [next level v]\nnext costume\n\n@Clouds\n\nwhen flag clicked\nhide\nforever\n    wait (1) seconds\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nswitch costume to (pick random (1) to (3))\ngo to [back v] layer\nshow\ngo to x: (500) y: (pick random (100) to (0))\nset size to (pick random (50) to (125)) %\nset [ghost v] effect to (pick random (0) to (75))\nrepeat until <[-232] > (x position)>\n    change x by (-2)\nend\ndelete this clone\n\n@Fake walls\n\nwhen flag clicked\nset [level v] to [1]\nforever\n    switch costume to (level)\nend\n\nwhen flag clicked\ngo to [back v] layer\nforever\n    if <touching (player v)?> then\n        set [ghost v] effect to (45)\n    else\n        set [ghost v] effect to (0)\n    end\nend\n\n@Moving Platform\n\nwhen flag clicked\nswitch costume to (costume1 v)\n\nwhen I receive [next level v]\nnext costume\n\nwhen flag clicked\ngo to x: (36) y: (28)\nforever\n    repeat (40)\n        change y by (5)\n    end\n    repeat (40)\n        change y by (-5)\n    end\nend\n\n@Bouncy\n\nwhen flag clicked\nforever\n    switch costume to (level)\nend\n\nwhen flag clicked\nforever\n    if <touching (player v)?> then\n        broadcast (FX v)\n    end\nend\n\n@Sprite1\n\nwhen I receive [next level v]\nset [ghost v] effect to (0)\ngo to [front v] layer\nshow\nstart sound [confirm v]\ngo to x: (-1000) y: (-1)\nrepeat until <(round (x position)) = [-330]>\n    change x by (((-330) - (x position)) / (5))\nend\nrepeat until <(round (x position)) = [577]>\n    change [ghost v] effect by (4)\n    change x by (((577) - (x position)) / (5))\nend\n\nwhen flag clicked\nhide\n\n@Jump\n\nwhen flag clicked\ngo to [back v] layer\nset [level v] to [1]\nforever\n    switch costume to (level)\nend\n\n@Spikes\n\nwhen flag clicked\ngo to [back v] layer\nset [level v] to [1]\nforever\n    switch costume to (level)\nend\n\n@Ground\n\nwhen flag clicked\nset [level v] to [1]\nforever\n    switch costume to (level)\nend\n\n