Halloween | A Scrolling Platformer
@Stage\n\nwhen [m v] key pressed\nset [mouse v] to (join ((mouse x) + (SCROLL X)) (join [, ] ((mouse y) + (SCROLL Y))))\nshow variable [mouse v]\n\nwhen flag clicked\nforever\n    play sound [Spooky Scary Skeletons  v] until done\nend\n\nwhen flag clicked\nshow variable [collected v]\n\n@............\n\nwhen flag clicked\nshow variable [collected v]\n\n@Player\n\nwhen flag clicked\nbroadcast (Green Flag v) and wait\nbroadcast (Play Game v) and wait\n\nwhen I receive [green flag v]\nhide\ngo to [front v] layer\n\nwhen I receive [play game v]\nset [level v] to [1]\nforever\n    broadcast (Reset v) and wait\n    broadcast (Set up 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    else\n        Game-Die\n    end\nend\n\ndefine Game On\nset [x v] to [0]\nset [y v] to [0]\nset [scroll x v] to [0]\nset [scroll y v] to [0]\nset [sx v] to [0]\nset [sy v] to [0]\nset [in air v] to [0]\nset [exit v] to []\npoint in direction (0)\nset size to (100) %\nset [ghost v] effect to (0)\nshow\n\ndefine Tick\nif <key (left arrow v) pressed?> then\n    change [sx v] by (-2)\nend\nif <key (right arrow v) pressed?> then\n    change [sx v] by (2)\nend\nset [sx v] to ((sx) * (0.8))\nif <([abs v] of (sx) ) > [0.9]> then\n    Change Player x by (round (sx))\nend\nif <key (up arrow v) pressed?> then\n    if <(in air) < [4]> then\n        set [sy v] to [16]\n    end\nend\nif <(sy) > [-20]> then\n    change [sy v] by (-2)\nend\nChange Player y by (sy)\nTest-Die\nchange [scroll x v] by (round (((x) - (SCROLL X)) / (10)))\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 Change Player y by (sy)\nchange [y v] by (sy)\nchange [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 [in air v] to [0]\n    end\n    Position\n    set [sy v] to [0]\nend\n\ndefine Position\ngo to x: ((x) - (SCROLL X)) y: ((y) - (SCROLL Y))\n\ndefine Change Player x by (sx)\nchange [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    if <key (up arrow v) pressed?> then\n        if <(sx) > [0]> then\n            set [sx v] to [-16]\n        else\n            set [sx v] to [16]\n        end\n        set [in air v] to [0]\n    else\n        set [sx v] to [0]\n    end\n    repeat until <not <touching (platforms v)?>>\n        if <(sx) > [0]> then\n            change [x v] by (-1)\n        else\n            change [x v] by (1)\n        end\n        Position\n    end\nend\n\ndefine Game-Die\nset [exit v] to []\nrepeat (3)\n    hide\n    wait (0.1) seconds\n    show\n    wait (0.1) seconds\nend\nhide\nwait (.5) seconds\n\ndefine Test-Die\nif <touching (danger v)?> then\n    set [exit v] to [die]\nend\n\ndefine Game Win\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\nchange [level v] by (1)\nwait (1) seconds\n\ngo to [back v] layer\n\ngo to [back v] layer\n\n@Platforms\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nPostion ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\nwhen I receive [set up v]\nhide\nset [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 [360] y [0]\n    Clone at x [360] y [0]\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (level 2 1 v)\n        Clone at x [0] y [300]\n        Clone at x [450] y [0]\n    else\n        switch costume to (level 3 1 v)\n    end\nend\n\ndefine Postion (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 [x v] by (x)\nchange [x v] by (y)\nnext costume\n\n@Danger\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nPostion ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\nwhen I receive [set up v]\nhide\nset [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 [360] y [0]\n    Clone at x [360] y [0]\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (level 2 1 v)\n        Clone at x [0] y [300]\n        Clone at x [450] y [0]\n    else\n        switch costume to (level 3 1 v)\n    end\nend\n\ndefine Postion (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 [x v] by (x)\nchange [x v] by (y)\nnext costume\n\n@Collectibles\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nPostion ((x) - (SCROLL X)) ((y) - (SCROLL Y))\nif <touching (player v)?> then\n    change [collected v] by (1)\n    if <(COLLECTED) = (COLLECTED MAX)> then\n        broadcast (Open Portal v)\n    end\n    delete this clone\nend\n\nwhen I receive [set up v]\nhide\nset [collected v] to [0]\nset [collected max v] to [0]\nset [x v] to [0]\nset [y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (dot v)\n    Clone at x [50] y [0]\n    Clone at x [100] y [50]\n    Clone at x [401] y [70]\n    Clone at x [567] y [120]\n    Clone at x [719] y [45]\n    Clone at x [1074] y [12]\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (dot v)\n        Clone at x [77] y [-11]\n        Clone at x [-91] y [106]\n        Clone at x [236] y [131]\n        Clone at x [619] y [22]\n        Clone at x [335] y [115]\n        Clone at x [818] y [67]\n    end\nend\nset [x v] to [-99999]\n\ndefine Postion (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 [x v] to (x)\nset [y v] to (y)\nchange [collected max v] by (1)\ncreate clone of (_myself_ v)\n\n@Exit\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nPostion ((x) - (SCROLL X)) ((y) - (SCROLL Y))\nif <<(costume [number v]) = [2]> and <touching (player v)?>> then\n    set [exit v] to [win]\nend\n\nwhen I receive [set up v]\nhide\nset [collected v] to [0]\nset [x v] to [0]\nset [y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (closed v)\n    Clone at x [1000] y [100]\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (closed v)\n        Clone at x [834] y [-80]\n    else\n        set [x v] to [-99999]\n    end\nend\n\ndefine Postion (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 [x v] to (x)\nset [y v] to (y)\n\nwhen I receive [open portal v]\nswitch costume to (open v)\n\nswitch costume to (closed v)\nClone at x [947] y [21]\n\nClone at x [976] y [137]\n\n@Tumbnail\n\nwhen flag clicked\ngo to [back v] layer\nhide\n\ngo to [front v] layer\nshow\nhide variable [collected v]\n\n
HOW 2 PLAY:\nIf u haven't figured it out, this is for you:\nUse the arrow keys to get through the level. Collect all the candy pieces to move on to the next level. Get through all the levels to win. Easy-peasy. There are no bad guys or lasers or what ever, so all you have to do is not touch the spikes and the lava, and not fall off. See easy. If you win then leave a heart and star, if you don't win then leave a heart and star. If you like it tell all your friend about me and that you like my game! If you did NOT like it then you are wrong.\n-------------------------------------------------------------------------\nFeel free to remix to add your own levels or whatever i don't care. I have to start working on my project for next month.\n-------------------------------------------------------------------------\nYes, I know a platformer is a bit generic. It is not my fault, no hate please.\n-------------------------------------------------------------------------\n                                       BYE\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nCHEESE?