0014049 || A Scrolling Platformer

Instructions: INSTRUCTIONS:\n- Arrow keys, WAD or mobile to move\n- Avoid spikes\n- Collect all Pi Coins to open the Pi Portal ;)\n- Have fun\n- Hopefully I win ^^\n\n⚠️⚠️  To win you must have knowledge about @0014019's games

@Stage\n\nwhen flag clicked\nswitch backdrop to (start v)\n\nwhen I receive [green flag clicked v]\nswitch backdrop to (backdrop2 v)\n\nwhen I receive [yes the end finally bwahahahahahahahaha v]\nswitch backdrop to (win v)\n\n@blank\n\n@ScrollPlayer2\n\nif <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > (y position)>>> then\n\ndefine Tick\nset rotation style [don't rotate v]\nif <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <(mouse x) < [-10]>>> then\n    point in direction (-90)\n    Change Player x by [-8]\nend\nif <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <(mouse x) > [10]>>> then\n    point in direction (90)\n    Change Player x by [8]\nend\nif <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > (y position)>>> then\n    if <(ScrollPlayer2: in air) < [6]> then\n        set [scrollplayer2: sy v] to [16]\n    end\nend\nif <(ScrollPlayer2: sy) > [-20]> then\n    change [scrollplayer2: sy v] by (-2)\nend\nChange Player y by (ScrollPlayer2: sy)\nTest - Die\nTest - Bounce\nset [scroll x v] to (ScrollPlayer2: x)\nif <(SCROLL X) < [0]> then\n    set [scroll x v] to [0]\nend\nchange [scroll y v] by (round (((y) - (SCROLL Y)) / (10)))\nif <(SCROLL Y) < [0]> then\n    set [scroll y v] to [0]\nend\nPosition\nif <(y) < [-180]> then\n    set [exit v] to [die]\nend\n\ndefine Game On\npoint in direction (90)\nset [scrollplayer2: x v] to [0]\nset [y v] to [0]\nset [scrollplayer2: sx v] to [0]\nset [scrollplayer2: sy v] to [0]\nset [scrollplayer2: in air v] to [0]\nset [exit v] to []\nset size to (100) %\nclear graphic effects\nshow\n\nwhen I receive [play game v]\nset [level v] to [1]\nforever\n    broadcast (Reset v) and wait\n    broadcast (Setup v) and wait\n    Game On\n    repeat until <(EXIT) > []>\n        Tick\n        broadcast (Tick v) and wait\n    end\n    if <(EXIT) = [win]> then\n        Game - Win\n    end\n    if <(EXIT) = [die]> then\n        Game - Die\n    end\n    if <(EXIT) = [the end]> then\n        Game - The End\n    end\nend\n\nwhen I receive [green flag clicked v]\nhide\ngo to [front v] layer\n\nwhen flag clicked\n\ndefine Change Player y by (sy)\nchange [y v] by (sy)\nchange [scrollplayer2: in air v] by (1)\nPosition\nrepeat until <not <touching (platforms v)?>>\n    if <(sy) > [0]> then\n        change [y v] by (-1)\n    else\n        change [y v] by (1)\n        set [scrollplayer2: in air v] to [0]\n    end\n    Position\n    set [scrollplayer2: sy v] to [0]\nend\n\ndefine Position\ngo to x: ((ScrollPlayer2: x) - (SCROLL X)) y: ((y) - (SCROLL Y))\n\ndefine Change Player x by (sx)\nchange [scrollplayer2: x v] by (sx)\nPosition\nif <touching (platforms v)?> then\n    repeat (12)\n        change [y v] by (1)\n        Position\n        if <not <touching (platforms v)?>> then\n            stop [this script v]\n        end\n    end\n    change [y v] by (-12)\n    repeat until <not <touching (platforms v)?>>\n        if <(sx) > [0]> then\n            change [scrollplayer2: x v] by (-1)\n        else\n            change [scrollplayer2: x v] by (1)\n        end\n        Position\n    end\nend\n\ndefine Game - Die\nbroadcast (nvnvnvnvn v)\nset [exit v] to []\nset rotation style [all around v]\nrepeat (10)\n    change y by (4)\n    turn right (36) degrees\n    change [ghost v] effect by (10)\nend\nhide\nwait (0.5) seconds\n\ndefine Test - Die\nif <touching (danger v)?> then\n    set [exit v] to [die]\nend\n\nwhen I receive [start v]\nbroadcast (Green flag clicked v) and wait\nbroadcast (Play Game v) and wait\n\nwhen I receive [nvnvnvnvn v]\nstart sound [Oops v]\n\ndefine Game - Win\nset rotation style [all around v]\nrepeat (50)\n    point towards (exit v)\n    turn right (65) degrees\n    move ((distance to [exit v]) / (2)) steps\n    change size by (-1)\n    change [ghost v] effect by (2)\nend\nhide\nset rotation style [don't rotate v]\nchange [level v] by (1)\nwait (1) seconds\n\ndefine Game - The End\nset rotation style [all around v]\nrepeat (50)\n    point towards (exit v)\n    turn right (65) degrees\n    move ((distance to [exit v]) / (2)) steps\n    change size by (-1)\n    change [ghost v] effect by (2)\nend\nhide\nset rotation style [don't rotate v]\nwait (0.5) seconds\nchange [level v] by (1)\nstop [other scripts in sprite v]\nbroadcast (Reset v)\nbroadcast (Yes the end finally bwahahahahahahahaha v)\n\nwhen I receive [yes the end finally bwahahahahahahahaha v]\nhide\ndelete this clone\n\nwhen I receive [play game v]\nforever\n    play sound [THE FAT RAT-Unity v] until done\nend\n\nwhen flag clicked\n\nwhen I receive [yes the end finally bwahahahahahahahaha v]\n\nif <(EXIT) = [win]> then\n\nwhen flag clicked\nhide\nclear graphic effects\n\ndefine Test - Bounce\nif <touching (bounce pads v)?> then\n    Game - Bounce\nend\n\ndefine Game - Bounce\nset [scrollplayer2: sy v] to [22]\n\nrepeat (5)\n    hide\n    wait (0.1) seconds\n    show\n    wait (0.1) seconds\nend\n\n@intro2\n\nwhen flag clicked\nhide\n\nwhen I receive [yes the end finally bwahahahahahahahaha v]\nhide\ndelete this clone\n\n@Intro\n\nwhen flag clicked\npoint in direction (90)\nhide\nset [clone id v] to [1]\nswitch costume to (logo v)\ngo to x: (0) y: (0)\nset size to (100) %\ncreate clone of (_myself_ v)\nwait (1) seconds\nset [clone id v] to [2]\ncreate clone of (_myself_ v)\nrepeat (4)\n    change [clone id v] by (1)\n    create clone of (_myself_ v)\n    wait (0.05) seconds\nend\nwait (2) seconds\nrepeat (4)\n    change [brightness v] effect by (-10)\n    change [clone id v] by (1)\n    create clone of (_myself_ v)\n    wait (0.08) seconds\nend\nwait (2) seconds\nswitch costume to (logo v)\nset size to (0) %\npoint in direction (-90)\nset [brightness v] effect to (0)\nshow\nrepeat (60)\n    go to [front v] layer\n    turn right (((90) - (direction)) / (10)) degrees\n    change size by (((100) - (size)) / (10))\nend\nrepeat (100)\n    point in direction ((([sin v] of ((timer) * (200)) ) * (10)) + (90))\n    set size to ((([sin v] of ((timer) * (200)) ) * (10)) + (100)) %\nend\nrepeat (30)\n    go to [front v] layer\n    turn right (((-90) - (direction)) / (10)) degrees\n    change size by (((0) - (size)) / (10))\nend\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nwait (4) seconds\nhide\ndelete this clone\n\nwhen I start as a clone\nif <(Clone ID) = [1]> then\n    show\n    go to x: (-467) y: (467)\n    switch costume to (backdrop v)\n    Smooth Glide to [0] [0] [5]\n    wait (4) seconds\n    delete this clone\nelse\n    if <(Clone ID) = [2]> then\n        hide\n        wait (.5) seconds\n        show\n        go to x: (0) y: (-196)\n        switch costume to (name v)\n        set size to (0) %\n        repeat (35)\n            go to [front v] layer\n            change y by (((0) - (y position)) / (5))\n            change size by (((100) - (size)) / (5))\n        end\n    else\n        if <(Clone ID) = [3]> then\n            go to x: (240) y: (180)\n            switch costume to (particle v)\n            set size to (0) %\n            show\n            repeat (35)\n                go to [front v] layer\n                change size by (((100) - (size)) / (5))\n            end\n            wait (3) seconds\n            delete this clone\n        else\n            if <(Clone ID) = [4]> then\n                go to x: (-240) y: (180)\n                switch costume to (particle v)\n                set size to (0) %\n                show\n                repeat (35)\n                    go to [front v] layer\n                    change size by (((100) - (size)) / (5))\n                end\n                wait (3) seconds\n                delete this clone\n            else\n                if <(Clone ID) = [5]> then\n                    go to x: (-240) y: (-180)\n                    switch costume to (particle v)\n                    set size to (0) %\n                    show\n                    repeat (35)\n                        go to [front v] layer\n                        change size by (((100) - (size)) / (5))\n                    end\n                    wait (3) seconds\n                    delete this clone\n                else\n                    if <(Clone ID) = [6]> then\n                        go to x: (240) y: (-180)\n                        switch costume to (particle v)\n                        set size to (0) %\n                        show\n                        repeat (35)\n                            go to [front v] layer\n                            change size by (((100) - (size)) / (5))\n                        end\n                        wait (3) seconds\n                        delete this clone\n                    else\n                        if <(Clone ID) = [7]> then\n                            set size to (100) %\n                            switch costume to (backdrop v)\n                            show\n                            go to x: (-1000) y: (0)\n                            Smooth Glide to [0] [0] [7]\n                            wait (3) seconds\n                            delete this clone\n                        else\n                            if <(Clone ID) = [8]> then\n                                set size to (100) %\n                                switch costume to (backdrop v)\n                                show\n                                go to x: (-1000) y: (0)\n                                Smooth Glide to [0] [0] [7]\n                                wait (3) seconds\n                                delete this clone\n                            else\n                                if <(Clone ID) = [9]> then\n                                    set size to (100) %\n                                    switch costume to (backdrop v)\n                                    show\n                                    go to x: (-1000) y: (0)\n                                    Smooth Glide to [0] [0] [7]\n                                    wait (3) seconds\n                                    delete this clone\n                                else\n                                    if <(Clone ID) = [10]> then\n                                        set size to (100) %\n                                        switch costume to (backdrop v)\n                                        show\n                                        go to x: (-1000) y: (0)\n                                        Smooth Glide to [0] [0] [7]\n                                        wait (8) seconds\n                                        repeat (10)\n                                            change [ghost v] effect by (10)\n                                        end\n                                        broadcast (start v)\n                                        delete this clone\n                                    else\n                                        delete this clone\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\ndelete this clone\n\ndefine Smooth Glide to (x) (y) (speed)\nrepeat until <<(round (x)) = (round (x position))> and <(round (y)) = (round (y position))>>\n    go to [front v] layer\n    change x by (((x) - (x position)) / (speed))\n    change y by (((y) - (y position)) / (speed))\nend\ngo to x: (x) y: (y)\n\ndefine Clones\nset [clone id v] to [11]\nrepeat (15)\n    change [clone id v] by (1)\n    create clone of (_myself_ v)\nend\n\nwhen I receive [yes the end finally bwahahahahahahahaha v]\nhide\ndelete this clone\n\n@Collectables\n\nwhen I receive [green flag clicked v]\nhide\n\nwhen I receive [tick v]\nPosition ((Collectables: x) - (SCROLL X)) ((y) - (SCROLL Y))\nif <touching (scrollplayer2 v)?> then\n    change [collected v] by (1)\n    start sound [Coin v]\n    if <(COLLECTED) = (COLLECTED MAX)> then\n        broadcast (Open Portal v)\n    end\n    delete this clone\nend\n\nwhen I receive [setup v]\nhide\nset [collected v] to [0]\nset [collected max v] to [0]\nset [collectables: x v] to [0]\nset [y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (money v)\n    Clone at x: [100] y: [100]\n    Clone at x: [602] y: [132]\n    Clone at x: [1023] y: [63]\n    Clone at x: [1772] y: [180]\n    Clone at x: [1611] y: [99]\nelse\n    if <(LEVEL) = [2]> then\n        Clone at x: [196] y: [124]\n        Clone at x: [400] y: [300]\n    end\nend\nset [collectables: x v] to [-9999999999999999999999999999999999]\n\ncreate clone of (_myself_ v)\nchange [collectables: x v] by (500)\nnext costume\ncreate clone of (_myself_ v)\nchange [collectables: x v] by (500)\nnext costume\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Clone at x: (x) y: (y)\nset [collectables: x v] to (x)\nset [y v] to (y)\nchange [collected max v] by (1)\ncreate clone of (_myself_ v)\n\nwhen flag clicked\nhide variable [collected v]\n\nwhen I receive [play game v]\nshow variable [collected v]\n\nwhen I receive [yes the end finally bwahahahahahahahaha v]\nhide\ndelete this clone\n\nwhen I receive [yes the end finally bwahahahahahahahaha v]\nhide\ndelete this clone\n\n@Platforms\n\nwhen I receive [green flag clicked v]\nhide\n\nwhen I receive [tick v]\nPosition ((Platforms: x) - (SCROLL X)) ((y) - (SCROLL Y))\n\nwhen I receive [setup v]\nhide\nset [platforms: x v] to [0]\nset [y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (level 1 1 v)\n    Clone at x: [500] y: [0]\n    Clone at x: [300] y: [45]\n    Clone at x: [300] y: [0]\n    Clone at x: [300] y: [20]\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (level 2 1 v)\n        Clone at x: [600] y: [-60]\n        Clone at x: [600] y: [0]\n        Clone at x: [600] y: [0]\n    else\n        if <(LEVEL) = [3]> then\n            set [collected max v] to [0]\n            switch costume to (level 3 1 v)\n            Clone at x: [300] y: [100]\n            Clone at x: [300] y: [0]\n            Clone at x: [300] y: [0]\n        else\n            switch costume to (level -- end v)\n        end\n    end\nend\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Clone at x: (x) y: (y)\ncreate clone of (_myself_ v)\nchange [platforms: x v] by (x)\nchange [y v] by (y)\nnext costume\n\nwhen flag clicked\nhide\nset [collected max v] to [6]\n\nwhen I receive [yes the end finally bwahahahahahahahaha v]\nhide\nhide variable [collected v]\ndelete this clone\n\nwhen I receive [yes the end finally bwahahahahahahahaha v]\nhide\ndelete this clone\n\nwhen I receive [yes the end finally bwahahahahahahahaha v]\n\n@Exit\n\nwhen I receive [green flag clicked v]\nhide\n\nwhen I receive [tick v]\nPosition ((Exit: x) - (SCROLL X)) ((y) - (SCROLL Y))\nif <<(costume [name v]) = [Exit Open]> and <touching (scrollplayer2 v)?>> then\n    set [exit v] to [win]\nend\n\nwhen I receive [setup v]\nhide\nset [collected v] to [0]\nset [exit: x v] to [0]\nset [y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (exit closed v)\n    Clone at x: [1906] y: [87]\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (exit closed v)\n        Clone at x: [2341] y: [-115]\n    else\n        switch costume to (exit open2 v)\n        Clone at x: [1321] y: [6]\n    end\nend\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Clone at x: (x) y: (y)\nset [exit: x v] to (x)\nset [y v] to (y)\n\nwhen flag clicked\nhide variable [collected v]\n\nwhen I receive [play game v]\nshow variable [collected v]\n\nwhen I receive [open portal v]\nswitch costume to (exit open v)\n\nwhen I receive [tick v]\nPosition ((Exit: x) - (SCROLL X)) ((y) - (SCROLL Y))\nif <<(costume [name v]) = [Exit Open2]> and <touching (scrollplayer2 v)?>> then\n    set [exit v] to [the end]\nend\n\nwhen I receive [yes the end finally bwahahahahahahahaha v]\nhide\ndelete this clone\n\nwhen I receive [yes the end finally bwahahahahahahahaha v]\nhide\ndelete this clone\n\n@Danger\n\nwhen I receive [green flag clicked v]\nhide\n\nwhen I receive [tick v]\nPosition ((Platforms: x) - (SCROLL X)) ((y) - (SCROLL Y))\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Clone at x: (x) y: (y)\ncreate clone of (_myself_ v)\nchange [platforms: x v] by (x)\nchange [y v] by (y)\nnext costume\n\nwhen I receive [yes the end finally bwahahahahahahahaha v]\nhide\ndelete this clone\n\nwhen flag clicked\nset [collected max v] to [6]\n\nwhen I receive [yes the end finally bwahahahahahahahaha v]\nhide\nhide variable [collected v]\ndelete this clone\n\nwhen I receive [yes the end finally bwahahahahahahahaha v]\nhide\ndelete this clone\n\nwhen I receive [setup v]\nhide\nset [platforms: x v] to [0]\nset [y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (level 1 1 v)\n    Clone at x: [550] y: [0]\n    Clone at x: [300] y: [45]\n    Clone at x: [300] y: [0]\n    Clone at x: [300] y: [20]\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (level 2 1 v)\n        Clone at x: [600] y: [-60]\n        Clone at x: [600] y: [0]\n        Clone at x: [600] y: [0]\n    else\n        if <(LEVEL) = [3]> then\n            set [collected max v] to [0]\n            switch costume to (level 3 1 v)\n            Clone at x: [300] y: [100]\n            Clone at x: [300] y: [0]\n            Clone at x: [300] y: [0]\n        else\n            switch costume to (level -- end v)\n        end\n    end\nend\n\n@miniature\n\nwhen flag clicked\nset [ghost v] effect to (100)\nforever\n    go to [front v] layer\nend\n\n