Sun, A Platformer. #All #Games #Platformer
@Stage\n\nwhen flag clicked\nforever\n    play sound [2 v] until done\nend\n\nwhen [m v] key pressed\nset volume to (0) %\n\nwhen [p v] key pressed\nset volume to (100) %\n\n@Level\n\nwhen I receive [next level v]\nnext costume\n\nwhen flag clicked\nshow\nswitch costume to (costume1 v)\ngo to x: (34) y: (3)\n\nwhen flag clicked\nset [time v] to [0]\nchange [time v] by (1)\nforever\n    wait (1) seconds\n    change [time v] by (1)\nend\n\nwhen [space v] key pressed\nset [☁ time v] to (Time)\n\n@Player\n\nwhen flag clicked\nshow\nreset timer\ngo to [front v] layer\nswitch costume to (center v)\ngo to x: (-186) y: (-12)\nset [player: x vel v] to [0]\nset [y vel v] to [0]\nforever\n    Play\nend\n\ndefine Play\nchange x by (Player: X vel)\nset [player: x vel v] to ((Player: X vel) * (0.9))\nif <touching (level v)?> then\n    change y by (1)\n    if <touching (level v)?> then\n        change y by (1)\n        if <touching (level v)?> then\n            change y by (1)\n            if <touching (level v)?> then\n                change y by (1)\n                if <touching (level v)?> then\n                    change y by (1)\n                    if <touching (level v)?> then\n                        change x by ((Player: X vel) * (-2))\n                        change y by (-5)\n                        if <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n                            if <(Player: X vel) > [0]> then\n                                set [player: x vel v] to [-10]\n                            else\n                                set [player: x vel v] to [10]\n                            end\n                            set [y vel v] to [15]\n                        else\n                            set [player: x vel v] to [0]\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\nchange [y vel v] by (-1)\nchange y by (Y vel)\nif <touching (level v)?> then\n    change y by ((Y vel) * (-1))\n    set [y vel v] to [0]\nend\nchange y by (-1)\nif <<key (up arrow v) pressed?> or <<key (w v) pressed?> or <key (space v) pressed?>>> then\n    if <touching (level v)?> then\n        set [y vel v] to [13]\n    end\nend\nchange y by (1)\nchange [scroll y v] by ((y position) * (-1))\nif <touching (spikes v)?> then\n    go to x: (-196) y: (-61)\nend\nif <[240] < (x position)> then\n    go to x: (-196) y: (-61)\n    broadcast (next level v)\nend\nif <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n    change [player: x vel v] by (1)\nend\nif <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n    change [player: x vel v] by (-1)\nend\nchange x by (Player: X vel)\nset [player: x vel v] to ((Player: X vel) * (0.9))\nif <touching (level v)?> then\n    change y by (1)\n    if <touching (level v)?> then\n        change y by (1)\n        if <touching (level v)?> then\n            change y by (1)\n            if <touching (level v)?> then\n                change y by (1)\n                if <touching (level v)?> then\n                    change y by (1)\n                    if <touching (level v)?> then\n                        change x by ((Player: X vel) * (-2))\n                        change y by (-5)\n                        if <key (w v) pressed?> then\n                            if <(Player: X vel) > [0]> then\n                                set [player: x vel v] to [-10]\n                            else\n                                set [player: x vel v] to [10]\n                            end\n                            set [y vel v] to [15]\n                        else\n                            set [player: x vel v] to [0]\n                            change [scroll y v] by ((y position) * (-1))\n                            if <touching (spikes v)?> then\n                                go to x: (-196) y: (-61)\n                            end\n                            if <[240] < (x position)> then\n                                go to x: (-196) y: (-61)\n                                broadcast (next level v)\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\nif <key (w v) pressed?> then\n    if <touching (level v)?> then\n        set [y vel v] to [13]\n        change y by (1)\n        change [y vel v] by (-1)\n        change y by (Y vel)\n        if <touching (level v)?> then\n            change y by ((Y vel) * (-1))\n            set [y vel v] to [0]\n        end\n    end\nend\n\nif <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n    change [player: x vel v] by (1)\nend\nif <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n    change [player: x vel v] by (-1)\nend\n\nwhen I start as a clone\nswitch costume to (effect v)\nrepeat (10)\n    change [ghost v] effect by (10)\n    change size by (-5)\nend\ndelete this clone\n\nwhen flag clicked\nforever\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nrepeat (5)\n    change [ghost v] effect by (1)\nend\ndelete this clone\n\nchange y by (-1)\n\n@Spikes\n\nwhen flag clicked\nshow\nswitch costume to (costume2 v)\ngo to x: (1) y: (-33)\ngo to [front v] layer\n\nwhen I receive [next level v]\nnext costume\n\nwhen flag clicked\nshow\nswitch costume to (costume2 v)\ngo to x: (1) y: (-33)\ngo to [front v] layer\n\nwhen flag clicked\nshow\nswitch costume to (costume2 v)\ngo to x: (1) y: (-33)\ngo to [front v] layer\n\nwhen flag clicked\nshow\nswitch costume to (costume2 v)\ngo to x: (1) y: (-33)\ngo to [front v] layer\n\n@thumbnail\n\nwhen flag clicked\nset [ghost v] effect to (100)\n\n@costume2\n\nwhen flag clicked\nforever\n    show\n    wait (5) seconds\n    hide\n    wait (5) seconds\n    show\nend\n\n
Welcome to Sun, A platformer!\n-------------------------------------------------------------------------\n Move:  Arrow keys/WASD, you can also use space to jump. Don't touch lava or spikes or you will die. If you want to mute press M, and if you want to play again the press P! Plz like and fav.  Want to play with a sibling? Check out 2 player version: https://scratch.mit.edu/projects/534111547/