platformer

Instructions: Click on the green flag en use arrow keys to moving.\n\nAmong us version: https://scratch.mit.edu/projects/566942894/\n\nBrawl stars version:\nhttps://scratch.mit.edu/projects/621001347/\n\n\n\n\n#platformer #Bobberoes #game 

@Stage\n\nwhen flag clicked\nswitch backdrop to (achtergrond2 v)\n\n@Sprite1\n\nwhen I receive [startgame v]\nwait (0.01) seconds\nshow\nswitch costume to (right v)\nshow variable [level v]\nset [level v] to [1]\nset [x velocity v] to [0]\nset [y velocity v] to [0]\ngo to x: (-195) y: (-76)\nforever\n    if <(x position) > [230]> then\n        change [level v] by (1)\n        set [y velocity v] to [0]\n        set [x velocity v] to [0]\n        go to x: (-195) y: (-76)\n        broadcast (NextLVL v)\n    end\n    if <key (right arrow v) pressed?> then\n        change [x velocity v] by (1)\n        switch costume to (right v)\n    end\n    if <key (left arrow v) pressed?> then\n        change [x velocity v] by (-1)\n        switch costume to (left v)\n    end\n    if <not <key (any v) pressed?>> then\n        switch costume to (normal v)\n    end\n    set [x velocity v] to ((x velocity) * (.9))\n    change x by (x velocity)\n    if <touching (lijn v)?> then\n        change y by (1)\n        if <touching (lijn v)?> then\n            change y by (1)\n            if <touching (lijn v)?> then\n                change y by (1)\n                if <touching (lijn v)?> then\n                    change y by (1)\n                    if <touching (lijn v)?> then\n                        change y by (1)\n                        if <touching (lijn v)?> then\n                            change x by ((x velocity) * (-1))\n                            change y by (-5)\n                            if <key (up arrow v) pressed?> then\n                                if <(x velocity) > [0]> then\n                                    set [x velocity v] to [-5]\n                                else\n                                    set [x velocity v] to [5]\n                                end\n                                set [y velocity v] to [10]\n                            else\n                                set [x velocity v] to [0]\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change [y velocity v] by (-1)\n    change y by (y velocity)\n    if <touching (lijn v)?> then\n        change y by ((y velocity) * (-1))\n        set [y velocity v] to [0]\n    end\n    change y by (-1)\n    if <touching (lijn v)?> then\n        if <key (up arrow v) pressed?> then\n            change [y velocity v] by (15)\n        end\n    end\n    if <touching (danger2 v)?> then\n        go to x: (-214) y: (-90)\n    end\n    if <touching (spring plank v)?> then\n        set [y velocity v] to [20]\n    end\n    if <(level) = [15]> then\n        hide variable [level v]\n    end\n    if <touching (bounce pad 2 v)?> then\n        set [y velocity v] to [20]\n    end\n    change y by (1)\nend\n\nwhen flag clicked\nshow variable [level v]\nbroadcast (StartGame v)\n\nwhen flag clicked\nshow\n\n@lijn\n\nwhen flag clicked\nswitch costume to (uiterlijk1 v)\nshow\nforever\n    if <(level) = [2]> then\n        switch costume to (uiterlijk2 v)\n    end\n    if <(level) = [3]> then\n        switch costume to (uiterlijk3 v)\n    end\n    if <(level) = [4]> then\n        switch costume to (uiterlijk4 v)\n    end\n    if <(level) = [5]> then\n        switch costume to (uiterlijk5 v)\n    end\n    if <(level) = [7]> then\n        switch costume to (uiterlijk6 v)\n    end\n    if <(level) = [7]> then\n        switch costume to (uiterlijk6 v)\n    end\nend\n\n@spring plank\n\nwhen flag clicked\nforever\n    if <(level) = [2]> then\n        show\n    else\n        hide\n    end\nend\n\n@Danger2\n\nwhen flag clicked\nswitch costume to (uiterlijk1 v)\nshow\nforever\n    if <(level) = [2]> then\n        switch costume to (7 v)\n    end\n    if <(level) = [1]> then\n        switch costume to (uiterlijk1 v)\n    end\n    if <(level) = [3]> then\n        switch costume to (uiterlijk2 v)\n    end\n    if <(level) = [4]> then\n        switch costume to (uiterlijk3 v)\n    end\n    if <(level) = [5]> then\n        switch costume to (uiterlijk4 v)\n    end\n    if <(level) = [6]> then\n        switch costume to (uiterlijk1 v)\n    end\n    if <(level) = [7]> then\n        switch costume to (uiterlijk1 v)\n    end\nend\n\n