= Lost Moon = A 360 Platformer =
@Stage\n\n@land 360\n\ndefine Set hack size to (size)\nswitch costume to (size hack v)\nset size to (size) %\nswitch costume to (costume1 v)\n\nwhen I receive [lag free cam set v]\nset x to (cam x)\n\nwhen I receive [play v]\nforever\n    if <key (right arrow v) pressed?> then\n        if <[-25] > (cam x)> then\n            change [cam x v] by (((-25) - (cam x)) * (0.05))\n        else\n            change [cam x v] by (-1)\n        end\n    end\n    if <key (left arrow v) pressed?> then\n        if <(cam x) > [25]> then\n            change [cam x v] by (((25) - (cam x)) * (0.05))\n        else\n            change [cam x v] by (1)\n        end\n    end\n    if <not <<<key (right arrow v) pressed?> and <(r) = [0]>> or <<key (left arrow v) pressed?> and <(l) = [0]>>>> then\n        change [cam x v] by (((0) - (cam x)) * (0.05))\n    end\n    broadcast (lag free cam set v)\nend\n\nwhen I receive [play v]\npoint in direction (90)\ngo to x: (0) y: (-600)\nSet hack size to [500]\nset [d vel v] to [0]\nset [y vel v] to [0]\nforever\n    change [y vel v] by (0.75)\n    if <<<key (d v) pressed?> or <key (right arrow v) pressed?>> or <(r) = [1]>> then\n        change [d vel v] by (-0.2)\n    end\n    if <<<key (a v) pressed?> or <key (left arrow v) pressed?>> or <(l) = [1]>> then\n        change [d vel v] by (0.2)\n    end\n    set [d vel v] to ((d vel) * (0.8))\n    turn right (d vel) degrees\n    if <touching (player v)?> then\n        change y by (-1)\n        if <touching (player v)?> then\n            change y by (-1)\n            if <touching (player v)?> then\n                change y by (-1)\n                if <touching (player v)?> then\n                    change y by (-1)\n                    if <touching (player v)?> then\n                        change y by (4)\n                        if <(direction) = [154]> then\n                            broadcast (win v) and wait\n                            stop [this script v]\n                        end\n                        turn right ((d vel) * (-1)) degrees\n                        set [d vel v] to [0]\n                    end\n                end\n            end\n        end\n    end\n    change y by (y vel)\n    if <touching (player v)?> then\n        change y by ((y vel) * (-1))\n        set [y vel v] to [0]\n    end\n    change y by (1)\n    if <touching (player v)?> then\n        if <<<key (w v) pressed?> or <<key (space v) pressed?> or <key (up arrow v) pressed?>>> or <(u) = [1]>> then\n            start sound [Jump v]\n            set [y vel v] to [-14]\n        end\n    end\n    change y by (-1)\nend\n\nwhen I receive [respawn v]\npoint in direction (90)\ngo to x: (0) y: (-600)\nset [d vel v] to [0]\nset [y vel v] to [0]\n\n@player\n\nwhen I receive [lag free cam set v]\nset x to (cam x)\n\nwhen I receive [play v]\nclear graphic effects\nforever\n    set x to (cam x)\n    if <touching (enemy v)?> then\n        create clone of (_myself_ v)\n        repeat (20)\n            change [brightness v] effect by (5)\n        end\n        broadcast (respawn v) and wait\n    end\nend\n\nwhen I receive [respawn v]\npoint in direction (90)\nrepeat (10)\n    change [brightness v] effect by (-5)\nend\nclear graphic effects\n\nwhen I receive [play v]\nforever\n    if <not <key (any v) pressed?>> then\n        switch costume to (normal v)\n    end\n    if <[0] > (y vel)> then\n        switch costume to (up v)\n    end\n    if <<<key (d v) pressed?> or <key (right arrow v) pressed?>> or <(r) = [1]>> then\n        switch costume to (right v)\n    end\n    if <<<key (a v) pressed?> or <key (left arrow v) pressed?>> or <(l) = [1]>> then\n        switch costume to (left v)\n    end\n    if <<key (w v) pressed?> or <<key (up arrow v) pressed?> or <(u) = [1]>>> then\n        switch costume to (up v)\n    end\n    if <<<<key (w v) pressed?> and <key (d v) pressed?>> or <<key (up arrow v) pressed?> and <key (right arrow v) pressed?>>> or <<(u) = [1]> and <(r) = [1]>>> then\n        switch costume to (up and right v)\n    end\n    if <<<<key (w v) pressed?> and <key (a v) pressed?>> or <<key (up arrow v) pressed?> and <key (left arrow v) pressed?>>> or <<(l) = [1]> and <(u) = [1]>>> then\n        switch costume to (up and left v)\n    end\nend\n\nwhen flag clicked\npoint in direction (90)\nbroadcast (respawn v) and wait\nbroadcast (play v)\n\nwhen I receive [play v]\nwait until <<([direction v] of [land 360 v]) < [155]> and <([direction v] of [land 360 v]) > [140]>>\nbroadcast (win v) and wait\nstop [other scripts in sprite v]\n\nwhen I start as a clone\nrepeat (10)\n    change y by (5)\n    turn left (1) degrees\n    change [ghost v] effect by (10)\n    set [brightness v] effect to (0)\nend\ndelete this clone\n\n@Win animation\n\nwhen I receive [win v]\nset [won v] to [1]\nstop all sounds\nswitch costume to (costume1 v)\nshow\nset [ghost v] effect to (100)\nset [brightness v] effect to (0)\nset size to (100) %\nrepeat (50)\n    change [ghost v] effect by (-2)\nend\nswitch costume to (costume2 v)\nset size to (100) %\nrepeat (150)\n    change size by (-0.1)\nend\nswitch costume to (costume3 v)\nset size to (100) %\nrepeat (150)\n    change size by (-0.05)\nend\nrepeat (200)\n    change size by (-0.05)\n    change [brightness v] effect by (-0.5)\nend\nswitch costume to (costume4 v)\nset size to (100) %\nrepeat (20)\n    change size by (-0.1)\n    change [brightness v] effect by (5)\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [win v]\nforever\n    play sound [best dramatic music ever!! v] until done\nend\n\nwhen flag clicked\nset [won v] to [0]\nforever\n    if <not <(won) = [1]>> then\n        play sound [best dramatic music ever!! v] until done\n    end\nend\n\n@Thumbnail\n\nwhen flag clicked\nset [ghost v] effect to (0)\nwait (0.5) seconds\nrepeat (20)\n    change [ghost v] effect by (5)\nend\nset [ghost v] effect to (100)\nforever\n    go to [front v] layer\nend\n\n@detector\n\nwhen flag clicked\nhide\nset [faved___ v] to [0]\nset [loved__ v] to [0]\nset [clone id v] to [0]\ncreate clone of (_myself_ v)\nwait (0.2) seconds\nset [clone id v] to [1]\ncreate clone of (_myself_ v)\nwait until <<(LOVED__) = [1]> and <(FAVED___) = [1]>>\nwait (1) seconds\nshow\ngo to x: (0) y: (50)\nreset timer\nswitch costume to (pick random (1) to (4))\nset [ghost v] effect to (100)\nstart sound [Ding - Sound Effect \[HD\] v]\nrepeat until <(timer) > [3.5]>\n    change y by ((y position) / (-15))\n    change [ghost v] effect by (-3)\nend\nreset timer\nrepeat until <(timer) > [3.5]>\n    change y by (((y position) - (-100)) / (-15))\n    change [ghost v] effect by (10)\nend\n\nwhen I start as a clone\nif <(clone id) = [0]> then\n    go to x: (-15) y: (0)\n    set [loved__ v] to [0]\n    switch costume to (love v)\n    forever\n        set [love? v] to <touching (mouse-pointer v)?>\n        if <touching (mouse-pointer v)?> then\n            set [loved__ v] to [1]\n        end\n    end\nend\nif <(clone id) = [1]> then\n    go to x: (0) y: (0)\n    switch costume to (fave v)\n    set [faved___ v] to [0]\n    forever\n        set [fav v] to <touching (mouse-pointer v)?>\n        if <touching (mouse-pointer v)?> then\n            set [faved___ v] to [1]\n        end\n    end\nend\n\n@Remember\n\nwhen flag clicked\nhide\nwait (7) seconds\nstart sound [Ding - Sound Effect \[HD\] v]\ngo to x: (0) y: (85)\nshow\nglide (1) secs to x: (0) y: (0)\nwait (1) seconds\nglide (1) secs to x: (0) y: (85)\nhide\n\n
Click the green flag and wasd and < ^ > to move\n\nNew game MARS:\nhttps://scratch.mit.edu/projects/414732861/