(update) bounce dash - a mobile friendly platformer
@Stage\n\nwhen flag clicked\nforever\n    play sound [TheFatRat - Unity v] until done\nend\n\n@empty\n\nset [☁ world record v] to [10000]\n\n@player\n\nwhen flag clicked\nshow\nset [level v] to [1]\nset [game v] to [0]\nset [turbo mode on? v] to [0]\nbroadcast (reset level v) and wait\nreset timer\nforever\n    repeat until <(game) > [0]>\n        set [turbo mode detector v] to (timer)\n        tick\n        broadcast (tick v) and wait\n        if <[0.000000001] > ((timer) - (turbo mode detector))> then\n            set [turbo mode on? v] to [1]\n        end\n    end\n    if <(game) = [1]> then\n        win\n        set [game v] to [0]\n        change [level v] by (1)\n        broadcast (transition v) and wait\n    end\nend\n\ndefine tick\nswitch costume to (hitbox v)\nset rotation style [don't rotate v]\nchange [xvel v] by ((((direction) * (5)) - (xvel)) / (7))\nchange x by (xvel)\nif <<touching (level v)?> or <touching (_edge_ v)?>> then\n    repeat until <not <<touching (level v)?> or <touching (_edge_ v)?>>>\n        if <(xvel) > [0]> then\n            change x by (-1)\n        else\n            change x by (1)\n        end\n    end\n    if <(xvel) > [0]> then\n        set [direction v] to [-1]\n        set [xvel v] to [-2]\n    else\n        set [direction v] to [1]\n        set [xvel v] to [2]\n    end\nend\nchange y by (-5)\nif <touching (level v)?> then\n    change [dirvel v] by ((((xvel) * (2)) - (dirvel)) / (2))\nelse\n    change [dirvel v] by (((0) - (dirvel)) / (10))\nend\nchange y by (5)\nturn right (dirvel) degrees\nchange [yvel v] by (-0.7)\nchange y by (yvel)\nif <<touching (level v)?> or <touching (_edge_ v)?>> then\n    repeat until <not <<touching (level v)?> or <touching (_edge_ v)?>>>\n        if <(yvel) > [0]> then\n            change y by (-1)\n        else\n            change y by (1)\n        end\n    end\n    if <(yvel) > [0]> then\n        set [yvel v] to [0]\n    else\n        set [yvel v] to [0]\n        if <<key (up arrow v) pressed?> or <<key (w v) pressed?> or <<key (space v) pressed?> or <mouse down?>>>> then\n            start sound [Jump v]\n            set [yvel v] to [13]\n        end\n    end\nend\nif <touching (portal v)?> then\n    set [game v] to [1]\nend\nset rotation style [all around v]\nswitch costume to (player v)\n\nwhen I receive [reset level v]\nclear graphic effects\nset [direction v] to [1]\nset [yvel v] to [0]\nset [xvel v] to [0]\nset [dirvel v] to [0]\nset [portal frame v] to [0]\npoint in direction (90)\ngo to x: (-199) y: (-113)\nif <(level) = [8]> then\n    hide\n    stop [other scripts in sprite v]\nend\n\ndefine win\nstart sound [Win v]\nrepeat (25)\n    change x by ((([x position v] of [portal v]) - (x position)) / (6))\n    change y by ((([y position v] of [portal v]) - (y position)) / (6))\n    turn right (((90) - (direction)) / (5)) degrees\nend\nrepeat (10)\n    change [ghost v] effect by (10)\nend\n\n@level\n\nwhen I receive [reset level v]\nswitch costume to (level)\n\n@portal\n\nwhen I receive [reset level v]\nif <(level) = [1]> then\n    go to x: (190) y: (-95)\nelse\n    if <(level) = [2]> then\n        go to x: (190) y: (-95)\n    else\n        if <(level) = [3]> then\n            go to x: (190) y: (60)\n        else\n            if <(level) = [4]> then\n                go to x: (-190) y: (145)\n            else\n                if <(level) = [5]> then\n                    go to x: (-200) y: (45)\n                else\n                    if <(level) = [6]> then\n                        go to x: (-200) y: (142)\n                    else\n                        if <(level) = [7]> then\n                            go to x: (200) y: (167)\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen I receive [tick v]\nchange [portal frame v] by (1)\nchange y by (([sin v] of ((portal frame) * (5)) ) * (0.5))\n\nbroadcast (reset level v) and wait\n\n@transition\n\nwhen I receive [transition v]\ngo to [front v] layer\nswitch costume to (costume1 v)\nset [time v] to [1]\nstart sound [\(2\) v]\ncreate clone of (_myself_ v)\nwait (0.1) seconds\nset [time v] to [0.8]\nswitch costume to (costume2 v)\ncreate clone of (_myself_ v)\nwait (0.1) seconds\nset [time v] to [0.6]\nswitch costume to (costume3 v)\ncreate clone of (_myself_ v)\nwait (0.6) seconds\nbroadcast (reset level v) and wait\n\nwhen I start as a clone\nshow\ngo to x: (-240) y: (180)\nrepeat (24)\n    change x by (20)\n    change y by (-20)\nend\nwait (time) seconds\nif <(time) = [1]> then\n    start sound [\(2\) v]\nend\nrepeat (24)\n    change x by (-20)\n    change y by (20)\nend\ndelete this clone\n\n@Sprite1\n\nwhen I receive [reset level v]\nif <(level) = [8]> then\n    if <(turbo mode on?) = [0]> then\n        switch costume to (e v)\n    else\n        switch costume to (e2 v)\n    end\n    go to [front v] layer\n    set [timer v] to ((round ((timer) * (10))) / (10))\n    set [coin display 2 v] to (join (coins) [ / 27])\n    if <(☁ world record) > (timer)> then\n        if <(turbo mode on?) = [0]> then\n            set [☁ world record v] to (timer)\n        end\n    end\n    show variable [timer v]\n    hide variable [coindisplay v]\n    show variable [coin display 2 v]\n    show variable [☁ world record v]\n    set [ghost v] effect to (100)\n    repeat (10)\n        change [ghost v] effect by (-10)\n    end\nend\n\nwhen flag clicked\nset [ghost v] effect to (100)\nhide variable [timer v]\nshow variable [coindisplay v]\nhide variable [coin display 2 v]\nhide variable [☁ world record v]\n\n@coins\n\nwhen flag clicked\nset [coins v] to [0]\nhide\n\nwhen I receive [tick v]\nset [coindisplay v] to (join [coins: ] (coins))\nswitch costume to ((timer) * (10))\nchange y by (([sin v] of (((portal frame) + ((x position) / (2.5))) * (5)) ) * (0.5))\nset [x, y v] to (join (mouse x) (join [  ] (mouse y)))\nif <touching (player v)?> then\n    if <(collected?) = [0]> then\n        start sound [Coin v]\n        set [collected? v] to [1]\n        change [coins v] by (1)\n    end\nend\nif <(collected?) > [0]> then\n    change y by (1)\n    change [ghost v] effect by (10)\n    change [collected? v] by (1)\nend\nif <(collected?) > [10]> then\n    delete this clone\nend\n\ndefine clone (x) (y)\ngo to x: (x) y: (y)\ncreate clone of (_myself_ v)\n\nwhen I receive [reset level v]\nclear graphic effects\ndelete this clone\n\nwhen I receive [reset level v]\nwait (0.1) seconds\nif <(level) = [1]> then\n    clone [-75] [-100]\n    clone [0] [-100]\n    clone [75] [-100]\nelse\n    if <(level) = [2]> then\n        clone [-20] [-40]\n        clone [40] [-40]\n    else\n        if <(level) = [3]> then\n            clone [125] [-100]\n            clone [200] [-100]\n        else\n            if <(level) = [4]> then\n                clone [-20] [-40]\n                clone [40] [-40]\n                clone [0] [140]\n                clone [-75] [140]\n            else\n                if <(level) = [5]> then\n                    clone [210] [55]\n                    clone [130] [55]\n                    clone [-40] [140]\n                    clone [-120] [140]\n                else\n                    if <(level) = [6]> then\n                        clone [110] [160]\n                        clone [160] [160]\n                        clone [210] [160]\n                    else\n                        if <(level) = [7]> then\n                            clone [-75] [-100]\n                            clone [0] [-100]\n                            clone [75] [-100]\n                            clone [-75] [45]\n                            clone [0] [45]\n                            clone [-150] [45]\n                            clone [-30] [160]\n                            clone [45] [160]\n                            clone [120] [160]\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen I start as a clone\nset [collected? v] to [0]\nshow\n\nbroadcast (reset level v) and wait\n\n@thumbnail\n\nwhen flag clicked\nset [ghost v] effect to (100)\n\n
<<< controls >>>\njump = up arrow || space || w || click\n\n<<< extra >>>\nTry to complete the game and beat all the levels! And if you succeed then play again and try collecting all the coins. And maybe try to get a fast time? 