Colossal- a platformer
@Stage\n\n@player\n\nwhen flag clicked\nhide\n\ndefine reset\ngo to x: (0) y: (0)\ndelete all of [respawn v]\ndelete all of [respawn y v]\ndelete all of [respawn x v]\nupdate respawn list [200]\nset [xv v] to [0]\nset [yv v] to [0]\nset [slope v] to [0]\nset [offset x v] to [0]\nset [offset y v] to [0]\nset [state v] to [game]\n\ndefine physics- gravity: (gravity) jump height: (jump height) speed (speed) friction (friction) slope (slope) scroll intensity (scroll)\nswitch costume to (hitbox v)\nmove Y (gravity) (jump height)\nMove X (slope) (speed) (friction)\nswitch costume to (idle v)\nscroll (scroll)\nupdate respawn list [200]\nswitch to right costume\n\ndefine scroll (scroll intensity)\nchange [scroll x v] by (round (((Player X) - (scroll X)) / (scroll intensity)))\nchange [scroll y v] by (round (((Player Y) - (scroll Y)) / (scroll intensity)))\nset [scroll x v] to ((scroll X) - (Offset X))\nset [scroll y v] to ((scroll Y) - (Offset Y))\ncheck borders\nbroadcast (scroll v)\n\ndefine switch to right costume\nif <<([abs v] of (xv) ) > [3]> and <(touching floor?) > [0]>> then\n    switch costume to ((3) + (([floor v] of ((timer) * (20)) ) mod (5)))\nend\nif <(yv) > [1]> then\n    switch costume to (jump v)\nelse\n    if <[-1] > (yv)> then\n        switch costume to (fall v)\n    end\nend\n\nwhen I receive [scroll v]\nset size to (500) %\ngo to x: ((Player X) - (scroll X)) y: ((Player Y) - (scroll Y))\nset size to (80) %\n\ndefine update respawn list (length of respawn list?)\nif <<(length of [respawn x v]) > (length of respawn list?)> and <(length of [respawn y v]) > (length of respawn list?)>> then\n    repeat until <not <<(length of [respawn x v]) > (length of respawn list?)> and <(length of [respawn y v]) > (length of respawn list?)>>>\n        delete (1) of [respawn x v]\n        delete (1) of [respawn y v]\n    end\nend\nif <<<not <(Player X) = (item (length of [respawn x v]) of [respawn x v])>> or <not <(Player Y) = (item (length of [respawn y v]) of [respawn y v])>>> and <(touching floor?) = [4]>> then\n    add (Player X) to [respawn x v]\n    add (Player Y) to [respawn y v]\nend\n\nwhen I receive [reset death v]\nhide\nset [state v] to [load]\ndelete all of [respawn v]\nadd (Player X) to [respawn v]\nadd (Player Y) to [respawn v]\nset [player x v] to (item ([ceiling v] of ((length of [respawn x v]) / (2)) ) of [respawn x v])\nset [player y v] to (item ([ceiling v] of ((length of [respawn y v]) / (2)) ) of [respawn y v])\nbroadcast (scroll v)\nset [xv v] to [0]\nset [yv v] to [0]\ndelete all of [respawn x v]\ndelete all of [respawn y v]\nupdate respawn list [200]\nwait (1) seconds\nshow\nset [state v] to [game]\n\nwhen I receive [start v]\nshow\nreset\nforever\n    if <(state) = [game]> then\n        physics- gravity: [-1] jump height: [13] speed [3] friction [.7] slope [5] scroll intensity [6]\n    else\n        if <(state) = [load]> then\n            physics- gravity: [0] jump height: [13] speed [0] friction [.7] slope [5] scroll intensity [6]\n        else\n            if <(state) = [camera]> then\n                move camera [10]\n            end\n        end\n    end\nend\n\nwhen I receive [reset level v]\nwait until <(level) = [2]>\ngo to x: (0) y: (0)\nlevel reset\n\ndefine check borders\nif <(scroll Y) < [0]> then\n    set [scroll y v] to [0]\nend\nif <(scroll X) < [-268]> then\n    set [scroll x v] to [-268]\nend\nif <(Player Y) < [-360]> then\n    broadcast (reset death v)\nend\nif <[2100] < (scroll Y)> then\n    set [scroll y v] to [2100]\nend\nif <[20000] < (Player X)> then\n    set [state v] to [fade]\n    broadcast (end cutscene v)\nend\nif <[20000] < (scroll X)> then\n    set [scroll x v] to [20000]\nend\n\ndefine move camera (speed)\nchange [scroll x v] by ((<key (right arrow v) pressed?> - <key (left arrow v) pressed?>) * (speed))\nchange [scroll y v] by ((<key (up arrow v) pressed?> - <key (down arrow v) pressed?>) * (speed))\ncheck borders\nbroadcast (scroll v)\n\nwhen I receive [start v]\nforever\n    if <<([abs v] of (xv) ) > [1]> and <(touching floor?) = [4]>> then\n        play sound [Walk Sound  v] until done\n    end\nend\n\ndefine level reset\ndelete all of [respawn v]\ndelete all of [respawn y v]\ndelete all of [respawn x v]\nupdate respawn list [200]\nset [xv v] to [0]\nset [yv v] to [0]\nset [slope v] to [0]\nset [offset x v] to [0]\nset [offset y v] to [0]\nset [player x v] to [0]\nset [player y v] to [0]\nset [scroll x v] to [0]\nset [scroll y v] to [0]\nset [state v] to [game]\n\ndefine move Y (grvty) (jh)\nchange [yv v] by (grvty)\nchange y by (yv)\nchange [player y v] by (yv)\nchange [touching floor? v] by (-1)\nif <(yv) < [-30]> then\n    set [yv v] to [-30]\nend\nif <touching (ground v)?> then\n    set [touching floor? v] to [4]\n    repeat until <not <touching (ground v)?>>\n        change y by ((([abs v] of (yv) ) / (yv)) * (-1))\n        change [player y v] by ((([abs v] of (yv) ) / (yv)) * (-1))\n    end\n    if <<(([abs v] of (yv) ) / (yv)) = [-1]> and <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <key (space v) pressed?>>> then\n        start sound [jump v]\n        set [yv v] to (jh)\n    else\n        set [yv v] to [0]\n    end\nend\nif <<(touching floor?) < [-5]> and <(yv) < [-10]>> then\n    start sound [Fall v]\nend\n\ndefine Move X (slope) (speed) (friction)\nif <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n    point in direction (90)\n    change [xv v] by (speed)\nelse\n    if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n        point in direction (-90)\n        change [xv v] by ((speed) * (-1))\n    end\nend\nset [xv v] to ((xv) * (friction))\nchange x by (xv)\nchange [player x v] by (xv)\nif <touching (ground v)?> then\n    set [slope v] to [0]\n    repeat until <<(slope) = (slope)> or <not <touching (ground v)?>>>\n        change y by (1)\n        change [player y v] by (1)\n        change [slope v] by (1)\n    end\n    if <touching (ground v)?> then\n        change y by ((slope) * (-1))\n        change [player y v] by ((slope) * (-1))\n        repeat (([abs v] of (xv) ) + (1))\n            if <touching (ground v)?> then\n                change [player x v] by ((([abs v] of (xv) ) / (xv)) * (-1))\n                change x by ((([abs v] of (xv) ) / (xv)) * (-1))\n            end\n        end\n        set [xv v] to [0]\n    end\nend\n\nset [player x v] to [20000]\n\n@ground\n\nwhen I receive [scroll v]\ncheck if on border\nset size to (200) %\ngo to x: ((Tile X) - (scroll X)) y: ((Tile Y) - (scroll Y))\nset size to (100) %\n\nwhen flag clicked\nhide\n\nwhen I start as a clone\nclear graphic effects\nshow\nswitch to right costume\ncheck if on border\n\ndefine check if on border\nif <((Tile X) - (scroll X)) > [480]> then\n    change [tile x v] by (-960)\n    switch to right costume\nend\nif <[-480] > ((Tile X) - (scroll X))> then\n    change [tile x v] by (960)\n    switch to right costume\nend\nif <((Tile Y) - (scroll Y)) > [360]> then\n    change [tile y v] by (-720)\n    switch to right costume\nend\nif <((Tile Y) - (scroll Y)) < [-360]> then\n    change [tile y v] by (720)\n    switch to right costume\nend\n\ndefine switch to right costume\nswitch costume to (join (join (level) [-]) (join (join ((Tile X) / (480)) [-]) ((Tile Y) / (360))))\nif <not <(costume [name v]) = (join (join (level) [-]) (join (join ((Tile X) / (480)) [-]) ((Tile Y) / (360))))>> then\n    switch costume to (blank v)\nend\n\nwhen I receive [start v]\ngo to x: (0) y: (0)\ncreate clones\nset volume to (50) %\nif <(level) = [1]> then\n    forever\n        play sound [death by glamour \(by toby fox\) v] until done\n        if <(level) = [2]> then\n            stop [this script v]\n        end\n    end\nend\n\nwhen I receive [boss battle v]\nwait until <(level) = [2]>\nswitch to right costume\ncheck if on border\n\nset [player x v] to [20000]\n\ndefine create clones\nset [tile x v] to [0]\nset [tile y v] to [0]\nswitch costume to (1-0-0 v)\ncreate clone of (_myself_ v)\nset [tile x v] to [480]\nset [tile y v] to [0]\ncreate clone of (_myself_ v)\nset [tile x v] to [480]\nset [tile y v] to [360]\ncreate clone of (_myself_ v)\nset [tile x v] to [0]\nset [tile y v] to [360]\ncreate clone of (_myself_ v)\n\n@background\n\nwhen I receive [scroll v]\ncheck if on border\nset size to (200) %\ngo to x: ((Tile X) - ((scroll X) * (.7))) y: (() - ((scroll Y) * (.7)))\nset size to (100) %\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\n\nwhen I start as a clone\ncheck if on border\nshow\n\ndefine check if on border\nif <((Tile X) - ((scroll X) * (.7))) > [480]> then\n    change [tile x v] by (-960)\n    switch to right costume\nend\nif <[-480] > ((Tile X) - ((scroll X) * (.7)))> then\n    change [tile x v] by (960)\n    switch to right costume\nend\n\nwhen I receive [start v]\ncreate clones\n\ndefine switch to right costume\nswitch costume to (level)\nif <not <(costume [name v]) = (level)>> then\n    switch costume to (blank v)\nend\n\ndefine create clones\nset [tile x v] to [0]\nswitch costume to (1 v)\ncreate clone of (_myself_ v)\nset [tile x v] to [480]\nswitch costume to (1 v)\ncreate clone of (_myself_ v)\n\n@background 2\n\nwhen I receive [scroll v]\ncheck if on border\nset size to (200) %\ngo to x: ((Tile X) - ((scroll X) * (.3))) y: (() - ((scroll Y) * (.3)))\nset size to (100) %\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\n\nwhen I start as a clone\nshow\nswitch to right costume\n\ndefine check if on border\nif <((Tile X) - ((scroll X) * (.3))) > [480]> then\n    change [tile x v] by (-960)\n    switch to right costume\nend\nif <[-480] > ((Tile X) - ((scroll X) * (.3)))> then\n    change [tile x v] by (960)\n    switch to right costume\nend\n\nwhen I receive [start v]\ncreate clones\n\ndefine switch to right costume\nswitch costume to (join (join (level) [-]) (((Tile X) / (480)) mod (3)))\nif <not <(costume [name v]) = (join (join (level) [-]) (((Tile X) / (480)) mod (3)))>> then\n    switch costume to (blank v)\nend\n\ndefine create clones\nset [tile x v] to [0]\nswitch costume to (1-0 v)\ncreate clone of (_myself_ v)\nset [tile x v] to [480]\nswitch costume to (1-1 v)\ncreate clone of (_myself_ v)\n\n@fader\n\nwhen flag clicked\nhide\n\nwhen I receive [reset level v]\nset [ghost v] effect to (100)\nshow\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nset [level v] to [2]\nset [state v] to [load]\nwait (1) seconds\nwait until <(state) = [game]>\nstop all sounds\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\n\nwhen flag clicked\nif <(intro played?) = [0]> then\n    set [ghost v] effect to (0)\n    show\n    wait (.5) seconds\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\n    hide\nelse\n    broadcast (start v)\n    hide\nend\n\nwhen I receive [fade v]\nset [ghost v] effect to (100)\nshow\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nwait (1) seconds\nbroadcast (start v)\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\n\nwhen I receive [end cutscene v]\nset [ghost v] effect to (100)\nshow\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nwait (1) seconds\nset [level v] to [2]\nstop all sounds\nbroadcast (final thing v)\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\n\nwhen I receive [end v]\nset [ghost v] effect to (100)\nshow\nrepeat (50)\n    change [ghost v] effect by (-2)\nend\nwait (1) seconds\nset [level v] to [1]\nset [intro played? v] to [0]\nset [player x v] to [0]\nset [player y v] to [0]\nset [scroll x v] to [0]\nset [scroll y v] to [0]\nset [giant x v] to [0]\nset [giant y v] to [0]\nstop [all v]\n\n@intro\n\nwhen flag clicked\nif <(intro played?) = [0]> then\n    switch costume to (costume3 v)\n    show\n    wait (2) seconds\n    start sound [Walk Sound  v]\n    repeat (3)\n        next costume\n    end\n    wait (1) seconds\n    start sound [Low Whoosh v]\n    switch costume to (costume7 v)\n    wait (4) seconds\n    switch costume to (costume8 v)\n    wait (1) seconds\n    set [level v] to [1]\n    broadcast (fade v)\n    set [intro played? v] to [1]\nelse\n    hide\nend\n\nwhen I receive [start v]\nhide\n\nset [intro played? v] to [0]\n\n@thumb\n\nwhen flag clicked\ngo to [front v] layer\nset [ghost v] effect to (100)\nshow\n\nset [level v] to [1]\nset [intro played? v] to [0]\nset [player x v] to [0]\nset [player y v] to [0]\nset [scroll x v] to [0]\nset [scroll y v] to [0]\nset [giant x v] to [0]\nset [giant y v] to [0]\n\n@end\n\nwhen flag clicked\nhide\n\nwhen I receive [final thing v]\nswitch costume to (costume1 v)\nshow\nrepeat (2)\n    wait (1) seconds\n    next costume\nend\nwait (1) seconds\nswitch costume to (costume4 v)\nwait (3) seconds\nbroadcast (end v)\n\n
-Colossal-\nHelp stickman find his son!\nWAD / arrow keys to move\ndon't fall off!