-Wanderling Demo- #Games #Scrolling Platformer


@Stage\n\nwhen flag clicked\nset [idle frame v] to [0]\nforever\n    set [idle frame v] to [0]\n    repeat (6)\n        change [idle frame v] by (1)\n        wait (.01) seconds\n    end\n    repeat (6)\n        change [idle frame v] by (-1)\n        wait (.01) seconds\n    end\nend\n\n@Blank\n\nwhen flag clicked\ndelete all of [user v]\ngo to [front v] layer\nset [ghost v] effect to (0)\ngo to x: (0) y: (0)\nadd [Enigmatic21] to [user v]\nadd [] to [user v]\nwait (1) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\nend\n\n@Layers\n\nwhen flag clicked\nset [level x amount v] to [3]\n\nwhen I receive [intro done v]\ndelete all of [array-layers v]\nadd [sound] to [array-layers v]\nadd [Loading Screen] to [array-layers v]\nadd [Intro] to [array-layers v]\nadd [Layers] to [array-layers v]\nadd [Developer] to [array-layers v]\nadd [Double Taps] to [array-layers v]\nadd [Grid] to [array-layers v]\nadd [x] to [array-layers v]\nadd [stamina] to [array-layers v]\nadd [ads] to [array-layers v]\nadd [hurt] to [array-layers v]\nadd [hearts] to [array-layers v]\nadd [st counter] to [array-layers v]\nadd [Effects] to [array-layers v]\nadd [Player] to [array-layers v]\nadd [fake wall] to [array-layers v]\nadd [Coins] to [array-layers v]\nadd [fx] to [array-layers v]\nadd [Mushrooms] to [array-layers v]\nadd [Jump Through] to [array-layers v]\nadd [Platforms] to [array-layers v]\nadd [Level] to [array-layers v]\nadd [Danger] to [array-layers v]\nadd [signs] to [array-layers v]\nadd [Front] to [array-layers v]\nadd [Saw] to [array-layers v]\nadd [fade] to [array-layers v]\nadd [parallax1] to [array-layers v]\nadd [fade1] to [array-layers v]\nadd [parallax2] to [array-layers v]\nadd [fade2] to [array-layers v]\nadd [parallax3] to [array-layers v]\nif <[array-layers v] contains [Player]?> then\n    insert [tail] at ((item # of [Player] in [array-layers v]) + (1)) of [array-layers v] \nend\nbroadcast (layering v) and wait\nbroadcast (load game v)\nwait until <([wait v] of [begin screen//loading screen v]) > [3]>\nbroadcast (Start Game v)\n\nwhen I receive [layering v]\ngo to [front v] layer\ngo [backward v] (item # of [Layers] in [array-layers v]) layers\n\n@For Developer //Developer \n\nwhen [space v] key pressed\nif <[user v] contains (username)?> then\n    broadcast (save coordinates v)\nend\n\nwhen I receive [tick v]\nif <is compiled?> then\n    Developer\nelse\n    if <[user v] contains (username)?> then\n        Developer\n    else\n        stop [this script v]\n    end\nend\n\nwhen I receive [layering v]\ngo to [front v] layer\ngo [backward v] (item # of [Developer] in [array-layers v]) layers\n\ndefine Developer\nif <(developer mode) = [1]> then\n    show variable [developer player speed v]\nelse\n    hide variable [developer player speed v]\nend\nchange [developer player speed v] by ((<key (w v) pressed?> - <key (s v) pressed?>) / (2))\nif <[15] < (developer player speed)> then\n    set [developer player speed v] to [15]\nend\nif <(developer player speed) < [0]> then\n    set [developer player speed v] to [0]\nend\nif <key (x v) pressed?> then\n    if <(developer key) = [0]> then\n        set [developer player speed v] to [10]\n        if <(developer mode) = [1]> then\n            set [developer mode v] to [0]\n        else\n            set [developer mode v] to [1]\n        end\n    end\n    set [developer key v] to [1]\nelse\n    set [developer key v] to [0]\nend\n\nwhen [p v] key pressed\nif <<[user v] contains (username)?> or <is compiled?>> then\n    if <(developer player speed) > [0]> then\n        set [developer player speed v] to [0]\n        set [developer mode v] to [1]\n    else\n        set [developer player speed v] to [10]\n    end\nelse\n    stop [this script v]\nend\n\nwhen flag clicked\nhide variable [developer player speed v]\nset [developer mode v] to [0]\nhide variable [player x v]\nhide variable [player y v]\n\nwhen I receive [intro done v]\nset [travel x v] to []\nset [travel y v] to []\nforever\n    if <<<key (t v) pressed?> and <[user v] contains (username)?>> or <<key (t v) pressed?> and <is compiled?>>> then\n        ask [] and wait\n        if <(answer) = [0,0]> then\n            Travel x: [353] y: [394] fell off? []\n        end\n        if <(answer) = [1,0]> then\n            Travel x: [807] y: [502] fell off? []\n        end\n        if <(answer) = [2,0]> then\n            Travel x: [1177] y: [313] fell off? []\n        end\n        if <(answer) = [2,1]> then\n            Travel x: [1492] y: [534] fell off? []\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    if <key (z v) pressed?> then\n        if <<[user v] contains (username)?> or <is compiled?>> then\n            if <(z) = [0]> then\n                show variable [player x v]\n                show variable [player y v]\n                set [z v] to [1]\n                wait until <not <key (z v) pressed?>>\n            else\n                hide variable [player x v]\n                hide variable [player y v]\n                set [z v] to [0]\n                wait until <not <key (z v) pressed?>>\n            end\n        end\n    end\nend\n\ndefine Travel x: (x) y: (y) fell off? (f/o?)\nset [travel x v] to (x)\nset [travel y v] to ((y) + (28))\nif <(f/o?) = []> then\n    broadcast (Travel v)\nend\nif <(f/o?) = [1]> then\n    broadcast (player fell off respawn v)\nend\n\nwhen [s v] key pressed\nif <[user v] contains (username)?> then\n    broadcast (refill stamina v)\nend\n\nwhen I receive [fell off v]\nTravel x: [1177] y: [313] fell off? [1]\n\n@For Developer //Double Taps\n\nwhen flag clicked\nset [run/walk? v] to [0]\nforever\n    if <<key (right arrow v) pressed?> and <(RightFirstPress?) = [Yes]>> then\n        reset timer\n        set [rightfirstpress? v] to [No]\n        wait until <not <key (right arrow v) pressed?>>\n    end\n    if <(timer) > [0.5]> then\n        set [rightfirstpress? v] to [Yes]\n    end\n    if <<key (right arrow v) pressed?> and <(RightFirstPress?) = [No]>> then\n        set [run/walk? v] to [1]\n        wait until <not <key (right arrow v) pressed?>>\n        set [run/walk? v] to [0]\n    end\nend\n\nwhen flag clicked\nset [run/walk? v] to [0]\nforever\n    if <<key (left arrow v) pressed?> and <(LeftFirstPress) = [Yes]>> then\n        reset timer\n        set [leftfirstpress v] to [No]\n        wait until <not <key (left arrow v) pressed?>>\n    end\n    if <(timer) > [0.5]> then\n        set [leftfirstpress v] to [Yes]\n    end\n    if <<key (left arrow v) pressed?> and <(LeftFirstPress) = [No]>> then\n        set [run/walk? v] to [1]\n        wait until <not <key (left arrow v) pressed?>>\n        set [run/walk? v] to [0]\n    end\nend\n\nwhen I receive [layering v]\ngo to [front v] layer\ngo [backward v] (item # of [Double Taps] in [array-layers v]) layers\n\n@For Developer //Grid\n\ndefine list\ndelete all of [~level v]\nswitch costume to (join [1] [])\nrepeat until <not < (costume [name v]) contains [,]?>>\n    add (costume [name v]) to [~level v]\n    next costume\nend\n\nwhen I start as a clone\nforever\n    tileController // xPos: (((tile column) * (x spacing)) - (scroll x)) yPos: (((tile row) * (y spacing)) - (scroll y))\nend\n\ndefine tileController // xPos: (x) yPos: (y)\nset [ghost v] effect to (90)\ngo to x: (x) y: (y)\nswitch costume to (0,0 v)\nshow\nif < (~level) contains (join (join ((tile column) - (1)) [,]) ((tile row) - (1)))?> then\n    if <(developer mode) = [1]> then\n        show\n        set [show/hide v] to [show]\n    else\n        hide\n        set [show/hide v] to [hide]\n    end\nelse\n    hide\n    set [show/hide v] to [hide]\nend\nswitch costume to (join (join ((tile column) - (1)) [,]) ((tile row) - (1)))\nif <(x) > (x spacing)> then\n    change [tile column v] by (-2)\nend\nif <(x) < ((0) - (x spacing))> then\n    change [tile column v] by (2)\nend\nif <(y) > (y spacing)> then\n    change [tile row v] by (-2)\nend\nif <(y) < ((0) - (y spacing))> then\n    change [tile row v] by (2)\nend\n\ndefine [layering] go back: (#) layers\ngo [backward v] (#) layers\n\ndefine set up\nset [level color v] to [0]\nset [level brightness v] to [5]\nlist\nset [ghost v] effect to (0)\nset [x spacing v] to [478]\nset [y spacing v] to [360]\nset [total level width v] to [2]\nset [total level height v] to [2]\nset [id v] to [clone]\nset [tile column v] to [1]\nset [tile row v] to [1]\ncreate clone of (_myself_ v)\nset [tile column v] to [1]\nset [tile row v] to [2]\ncreate clone of (_myself_ v)\nset [tile column v] to [2]\nset [tile row v] to [1]\ncreate clone of (_myself_ v)\nset [tile column v] to [2]\nset [tile row v] to [2]\ncreate clone of (_myself_ v)\nset [id v] to [main]\nhide\n\nwhen I receive [start game v]\nset up\n\nwhen I receive [layering v]\ngo to [front v] layer\ngo [backward v] (item # of [Grid] in [array-layers v]) layers\n\n@For Developer //x\n\ndefine go to x: (x) y: (y)\ngo to x: (x) y: (y)\nif <<<(round (x)) = (round (x position))> and <(round (y)) = (round (y position))>> and <(developer mode) = [1]>> then\n    set [ghost v] effect to (50)\nelse\n    set [ghost v] effect to (100)\nend\n\nwhen I receive [tick v]\ngo to x: (((scroll x) - (sprite x)) * (-1)) y: (((scroll y) - (sprite y)) * (-1))\nif <key (space v) pressed?> then\n    change [sprite x v] by (((mouse x) - (x position)) / (1.5))\n    change [sprite y v] by (((mouse y) - (y position)) / (1.5))\nend\nif <key (c v) pressed?> then\n    if <(costume [name v]) = [mushroom]> then\n        say (join (join (join [x: ] (round (sprite x))) (join [ y: ] (round (sprite y)))) (join [ direction: ] (round (direction))))\n    else\n        say (join (join [x: ] (round (sprite x))) (join [ y: ] (round (sprite y))))\n    end\nelse\n    say []\nend\n\nwhen I receive [layering v]\ngo to [front v] layer\ngo [backward v] (item # of [x] in [array-layers v]) layers\n\nwhen flag clicked\nforever\n    if <key (d v) pressed?> then\n        switch costume to ((costume [number v]) + (1))\n        wait (.2) seconds\n    end\n    if <key (a v) pressed?> then\n        switch costume to ((costume [number v]) - (1))\n        wait (.2) seconds\n    end\n    if <(costume [name v]) = [mushroom]> then\n        set rotation style [all around v]\n        if <mouse down?> then\n            point towards (mouse-pointer v)\n            turn right (90) degrees\n        end\n    else\n        set rotation style [don't rotate v]\n        point in direction (90)\n    end\nend\n\nturn right (90) degrees\nturn left (90) degrees\nturn right (90) degrees\n\n@Jump Through\n\ndefine list\ndelete all of [~level v]\nswitch costume to (join [1] [])\nrepeat until <not < (costume [name v]) contains [,]?>>\n    add (costume [name v]) to [~level v]\n    next costume\nend\n\nwhen I start as a clone\nforever\n    set [ghost v] effect to (100)\n    tileController // xPos: (((tile column) * (x spacing)) - (scroll x)) yPos: (((tile row) * (y spacing)) - (scroll y))\n    if <(developer mode) = [1]> then\n        set [ghost v] effect to (50)\n    end\nend\n\ndefine tileController // xPos: (x) yPos: (y)\nswitch costume to (border v)\ngo to x: (x) y: (y)\nshow\nif < (~level) contains (join (join ((tile column) - (1)) [,]) ((tile row) - (1)))?> then\n    show\n    set [show/hide v] to [show]\nelse\n    hide\n    set [show/hide v] to [hide]\nend\nswitch costume to (join (join ((tile column) - (1)) [,]) ((tile row) - (1)))\nif <(x) > (x spacing)> then\n    change [tile column v] by (-2)\nend\nif <(x) < ((0) - (x spacing))> then\n    change [tile column v] by (2)\nend\nif <(y) > (y spacing)> then\n    change [tile row v] by (-2)\nend\nif <(y) < ((0) - (y spacing))> then\n    change [tile row v] by (2)\nend\n\ndefine set up\nset [level color v] to [0]\nset [level brightness v] to [5]\nlist\nset [ghost v] effect to (100)\nset [x spacing v] to [478]\nset [y spacing v] to [360]\nset [id v] to [clone]\nset [tile column v] to [1]\nset [tile row v] to [1]\ncreate clone of (_myself_ v)\nset [tile column v] to [1]\nset [tile row v] to [2]\ncreate clone of (_myself_ v)\nset [tile column v] to [2]\nset [tile row v] to [1]\ncreate clone of (_myself_ v)\nset [tile column v] to [2]\nset [tile row v] to [2]\ncreate clone of (_myself_ v)\nset [id v] to [main]\nhide\n\nwhen I receive [start game v]\nset up\n\nwhen I receive [layering v]\ngo to [front v] layer\ngo [backward v] (item # of [Jump Through] in [array-layers v]) layers\n\n@Level\n\ndefine list\ndelete all of [~level v]\nswitch costume to (join [1] [])\nrepeat until <not < (costume [name v]) contains [,]?>>\n    add (costume [name v]) to [~level v]\n    next costume\nend\n\nwhen I start as a clone\nforever\n    tileController // xPos: (((tile column) * (x spacing)) - (scroll x)) yPos: (((tile row) * (y spacing)) - (scroll y))\n    set [ghost v] effect to (100)\nend\n\ndefine tileController // xPos: (x) yPos: (y)\nswitch costume to (border v)\ngo to x: (x) y: (y)\nshow\nif < (~level) contains (join (join ((tile column) - (1)) [,]) ((tile row) - (1)))?> then\n    show\n    set [show/hide v] to [show]\nelse\n    hide\n    set [show/hide v] to [hide]\nend\nswitch costume to (join (join ((tile column) - (1)) [,]) ((tile row) - (1)))\nif <(x) > (x spacing)> then\n    change [tile column v] by (-2)\nend\nif <(x) < ((0) - (x spacing))> then\n    change [tile column v] by (2)\nend\nif <(y) > (y spacing)> then\n    change [tile row v] by (-2)\nend\nif <(y) < ((0) - (y spacing))> then\n    change [tile row v] by (2)\nend\n\ndefine set up\nset [level color v] to [0]\nset [level brightness v] to [5]\nlist\nset [x spacing v] to [478]\nset [y spacing v] to [360]\nset [total level width v] to [2]\nset [total level height v] to [2]\nset [id v] to [clone]\nset [tile column v] to [1]\nset [tile row v] to [1]\ncreate clone of (_myself_ v)\nset [tile column v] to [1]\nset [tile row v] to [2]\ncreate clone of (_myself_ v)\nset [tile column v] to [2]\nset [tile row v] to [1]\ncreate clone of (_myself_ v)\nset [tile column v] to [2]\nset [tile row v] to [2]\ncreate clone of (_myself_ v)\nset [id v] to [main]\nhide\n\nwhen I receive [start game v]\nset up\n\nwhen I receive [layering v]\ngo to [front v] layer\ngo [backward v] (item # of [Level] in [array-layers v]) layers\n\n@Front\n\ndefine list\ndelete all of [~level v]\nswitch costume to (join [1] [])\nrepeat until <not < (costume [name v]) contains [,]?>>\n    add (costume [name v]) to [~level v]\n    next costume\nend\n\nwhen I start as a clone\nforever\n    tileController // xPos: (((tile column) * (x spacing)) - (scroll x)) yPos: (((tile row) * (y spacing)) - (scroll y))\nend\n\ndefine tileController // xPos: (x) yPos: (y)\nswitch costume to (border v)\ngo to x: (x) y: (y)\nshow\nif < (~level) contains (join (join ((tile column) - (1)) [,]) ((tile row) - (1)))?> then\n    show\n    set [show/hide v] to [show]\nelse\n    hide\n    set [show/hide v] to [hide]\nend\nswitch costume to (join (join ((tile column) - (1)) [,]) ((tile row) - (1)))\nif <(x) > (x spacing)> then\n    change [tile column v] by (-2)\nend\nif <(x) < ((0) - (x spacing))> then\n    change [tile column v] by (2)\nend\nif <(y) > (y spacing)> then\n    change [tile row v] by (-2)\nend\nif <(y) < ((0) - (y spacing))> then\n    change [tile row v] by (2)\nend\n\ndefine set up\nset [level color v] to [0]\nset [level brightness v] to [5]\nlist\nset [ghost v] effect to (0)\nset [x spacing v] to [478]\nset [y spacing v] to [360]\nset [id v] to [clone]\nset [tile column v] to [1]\nset [tile row v] to [1]\ncreate clone of (_myself_ v)\nset [tile column v] to [1]\nset [tile row v] to [2]\ncreate clone of (_myself_ v)\nset [tile column v] to [2]\nset [tile row v] to [1]\ncreate clone of (_myself_ v)\nset [tile column v] to [2]\nset [tile row v] to [2]\ncreate clone of (_myself_ v)\nset [id v] to [main]\nhide\n\nwhen I receive [start game v]\nset up\n\nwhen I receive [layering v]\ngo to [front v] layer\ngo [backward v] (item # of [Front] in [array-layers v]) layers\n\n@Level Details//fade\n\nwhen flag clicked\nshow\nset [name v] to [fade]\ngo to x: (0) y: (0)\nset [name v] to [fade1]\ncreate clone of (_myself_ v)\nset [name v] to [fade2]\ncreate clone of (_myself_ v)\nset [name v] to [fade]\nforever\n    set [ghost v] effect to (90)\nend\n\nwhen I receive [layering v]\ngo to [front v] layer\ngo [backward v] (item # of (name) in [array-layers v]) layers\n\nwhen I start as a clone\nforever\n    set [ghost v] effect to (60)\nend\n\n@Level Details//parallax1\n\ndefine list\ndelete all of [~level v]\nswitch costume to (join [1] [])\nrepeat until <not < (costume [name v]) contains [,]?>>\n    add (costume [name v]) to [~level v]\n    next costume\nend\n\nwhen I start as a clone\nforever\n    tileController // xPos: (((tile column) * (x spacing)) - (((scroll x) / (1.2)) + (100))) yPos: (((tile row) * (y spacing)) - (((scroll y) / (1.2)) + (100)))\nend\n\ndefine tileController // xPos: (x) yPos: (y)\nswitch costume to (border v)\ngo to x: (x) y: (y)\nshow\nif < (~level) contains (join (join ((tile column) - (1)) [,]) ((tile row) - (1)))?> then\n    show\n    set [show/hide v] to [show]\nelse\n    hide\n    set [show/hide v] to [hide]\nend\nswitch costume to (join (join ((tile column) - (1)) [,]) ((tile row) - (1)))\nif <(x) > (x spacing)> then\n    change [tile column v] by (-2)\nend\nif <(x) < ((0) - (x spacing))> then\n    change [tile column v] by (2)\nend\nif <(y) > (y spacing)> then\n    change [tile row v] by (-2)\nend\nif <(y) < ((0) - (y spacing))> then\n    change [tile row v] by (2)\nend\n\ndefine set up\nset [level color v] to [0]\nset [level brightness v] to [5]\nlist\nset [x spacing v] to [478]\nset [y spacing v] to [360]\nset [id v] to [clone]\nset [tile column v] to [1]\nset [tile row v] to [1]\ncreate clone of (_myself_ v)\nset [tile column v] to [1]\nset [tile row v] to [2]\ncreate clone of (_myself_ v)\nset [tile column v] to [2]\nset [tile row v] to [1]\ncreate clone of (_myself_ v)\nset [tile column v] to [2]\nset [tile row v] to [2]\ncreate clone of (_myself_ v)\nset [id v] to [main]\nhide\n\nwhen I receive [start game v]\nset up\n\nwhen I receive [layering v]\ngo to [front v] layer\ngo [backward v] (item # of [parallax1] in [array-layers v]) layers\n\n@Level Details//parallax2\n\ndefine list\ndelete all of [~level v]\nswitch costume to (join [1] [])\nrepeat until <not < (costume [name v]) contains [,]?>>\n    add (costume [name v]) to [~level v]\n    next costume\nend\n\nwhen I start as a clone\nforever\n    tileController // xPos: (((tile column) * (x spacing)) - (((scroll x) / (2)) + (240))) yPos: (((tile row) * (y spacing)) - (((scroll y) / (2)) + (200)))\nend\n\ndefine tileController // xPos: (x) yPos: (y)\nswitch costume to (border v)\ngo to x: (x) y: (y)\nshow\nif < (~level) contains (join (join ((tile column) - (1)) [,]) ((tile row) - (1)))?> then\n    show\n    set [show/hide v] to [show]\nelse\n    hide\n    set [show/hide v] to [hide]\nend\nswitch costume to (join (join ((tile column) - (1)) [,]) ((tile row) - (1)))\nif <(x) > (x spacing)> then\n    change [tile column v] by (-2)\nend\nif <(x) < ((0) - (x spacing))> then\n    change [tile column v] by (2)\nend\nif <(y) > (y spacing)> then\n    change [tile row v] by (-2)\nend\nif <(y) < ((0) - (y spacing))> then\n    change [tile row v] by (2)\nend\n\ndefine set up\nlist\nset [x spacing v] to [478]\nset [y spacing v] to [360]\nset [id v] to [clone]\nset [tile column v] to [1]\nset [tile row v] to [1]\ncreate clone of (_myself_ v)\nset [tile column v] to [1]\nset [tile row v] to [2]\ncreate clone of (_myself_ v)\nset [tile column v] to [2]\nset [tile row v] to [1]\ncreate clone of (_myself_ v)\nset [tile column v] to [2]\nset [tile row v] to [2]\ncreate clone of (_myself_ v)\nset [id v] to [main]\nhide\n\nwhen I receive [start game v]\nset up\n\nwhen I receive [layering v]\ngo to [front v] layer\ngo [backward v] (item # of [parallax2] in [array-layers v]) layers\n\n@Level Details//parallax3\n\ndefine list\ndelete all of [~level v]\nswitch costume to (join [1] [])\nrepeat until <not < (costume [name v]) contains [,]?>>\n    add (costume [name v]) to [~level v]\n    next costume\nend\n\nwhen I start as a clone\nforever\n    tileController // xPos: (((tile column) * (x spacing)) - (((scroll x) / (3)) + (300))) yPos: (((tile row) * (y spacing)) - (((scroll y) / (3)) + (300)))\nend\n\ndefine tileController // xPos: (x) yPos: (y)\nswitch costume to (border v)\ngo to x: (x) y: (y)\nshow\nif < (~level) contains (join (join ((tile column) - (1)) [,]) ((tile row) - (1)))?> then\n    show\n    set [show/hide v] to [show]\nelse\n    hide\n    set [show/hide v] to [hide]\nend\nswitch costume to (join (join ((tile column) - (1)) [,]) ((tile row) - (1)))\nif <(x) > (x spacing)> then\n    change [tile column v] by (-2)\nend\nif <(x) < ((0) - (x spacing))> then\n    change [tile column v] by (2)\nend\nif <(y) > (y spacing)> then\n    change [tile row v] by (-2)\nend\nif <(y) < ((0) - (y spacing))> then\n    change [tile row v] by (2)\nend\n\ndefine set up\nset [level color v] to [0]\nset [level brightness v] to [5]\nlist\nset [x spacing v] to [478]\nset [y spacing v] to [360]\nset [id v] to [clone]\nset [tile column v] to [1]\nset [tile row v] to [1]\ncreate clone of (_myself_ v)\nset [tile column v] to [1]\nset [tile row v] to [2]\ncreate clone of (_myself_ v)\nset [tile column v] to [2]\nset [tile row v] to [1]\ncreate clone of (_myself_ v)\nset [tile column v] to [2]\nset [tile row v] to [2]\ncreate clone of (_myself_ v)\nset [id v] to [main]\nhide\n\nwhen I receive [start game v]\nset up\n\nwhen I receive [layering v]\ngo to [front v] layer\ngo [backward v] (item # of [parallax3] in [array-layers v]) layers\n\n@begin screen//Loading Screen\n\nwhen I receive [end load screen v]\nstop [other scripts in sprite v]\nif <(ID) = [Main]> then\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\nelse\n    if <(ID) = [Tail]> then\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n    else\n        if <(ID) = [White]> then\n            repeat (10)\n                change x by (-40)\n            end\n            glide to x: [-480] y: (y position) speed: [4] ghost [10]\n        else\n            if <(ID) = [Black]> then\n                wait (.1) seconds\n                repeat (10)\n                    change x by (-40)\n                end\n                glide to x: [-480] y: (y position) speed: [4] ghost [10]\n            else\n                glide to x: [-420] y: (y position) speed: [2] ghost [10]\n            end\n        end\n    end\nend\ndelete this clone\n\nwhen I start as a clone\nclear graphic effects\ngo to x: (0) y: (0)\nset size to (100) %\npoint in direction (90)\nif <(ID) = [Tail]> then\n    set [ghost v] effect to (100)\n    set size to (40) %\n    set [brightness v] effect to (-100)\n    set [r v] to [1]\n    forever\n        go to x: ([x position v] of [begin screen//loading screen v]) y: (([y position v] of [begin screen//loading screen v]) - (6))\n        if <([direction v] of [begin screen//loading screen v]) > [0]> then\n            switch costume to (loading//90 v)\n        else\n            switch costume to (loading//-90 v)\n        end\n        change [r v] by (1)\n        set [r v] to ((r) mod (30))\n        idle\n    end\nelse\n    if <(ID) = [White]> then\n        switch costume to (loading//white v)\n        go to x: (480) y: (0)\n        wait (.1) seconds\n        repeat (10)\n            change x by (-40)\n        end\n        glide to x: [0] y: [0] speed: [4] ghost []\n    else\n        if <(ID) = [Black]> then\n            switch costume to (loading//black v)\n            go to x: (480) y: (0)\n            repeat (10)\n                change x by (-40)\n            end\n            glide to x: [0] y: [0] speed: [4] ghost []\n        else\n            forever\n                caption\n            end\n        end\n    end\nend\n\nwhen I receive [load screen v]\nswitch costume to (run//1 v)\nset [ghost v] effect to (100)\nset [brightness v] effect to (-100)\ngo to x: (206) y: (-124)\nset size to (40) %\nforever\n    set [random load interrupt v] to [1]\n    change [frame v] by ((1) + (.2))\n    if <(random load interrupt) = [1]> then\n        switch costume to ((2) + (([floor v] of (frame) ) mod (23)))\n    end\nend\n\ndefine idle\nset rotation style [all around v]\nchange [shift v] by (20)\nif <([random load interrupt v] of [begin screen//loading screen v]) = [1]> then\n    if <(r) < [15]> then\n        point in direction ((([sin v] of (shift) ) * (5)) + (90))\n    else\n        point in direction ((([sin v] of (shift) ) * (10)) + (90))\n    end\nend\n\ndefine glide to x: (x) y: (y) speed: (s) ghost (ghost)\nrepeat until <<(round (x position)) = (x)> and <(round (y position)) = (y)>>\n    change x by (((x) - (x position)) / (s))\n    change y by (((y) - (y position)) / (s))\n    change [ghost v] effect by (ghost)\nend\n\nwhen I receive [load game v]\nset [id v] to [Main]\nif <<key (s v) pressed?> and <[user v] contains (username)?>> then\n    set [wait v] to [4]\n    broadcast (end load screen v)\n    stop [this script v]\nelse\n    broadcast (load screen v)\nend\nrepeat until <(wait) > [10]>\n    if <<key (s v) pressed?> and <[user v] contains (username)?>> then\n        change [wait v] by (.5)\n    else\n        wait (.5) seconds\n        change [wait v] by (.5)\n    end\nend\nbroadcast (end load screen v)\n\ndefine caption\nset [clicked v] to [0]\nset [ghost v] effect to (100)\nswitch costume to (loading//cptn1 v)\ngo to x: (420) y: (86)\nglide to x: [0] y: [86] speed: [4] ghost [-7]\nforever\n    if <<touching (mouse-pointer v)?> and <not <(clicked) = [1]>>> then\n        change size by (((105) - (size)) / (5))\n    else\n        change size by (((100) - (size)) / (5))\n    end\nend\n\nwhen I receive [load screen v]\nif <(ID) = [Main]> then\n    set [id v] to [White]\n    create clone of (_myself_ v)\n    set [id v] to [Black]\n    create clone of (_myself_ v)\n    wait (.3) seconds\n    set [id v] to [Caption]\n    create clone of (_myself_ v)\n    set [id v] to [Tail]\n    create clone of (_myself_ v)\n    set [id v] to [Main]\n    wait (1) seconds\n    repeat (10)\n        change [ghost v] effect by (-10)\n    end\nelse\n    delete this clone\nend\n\nwhen I start as a clone\nif <(ID) = [Tail]> then\n    wait (1) seconds\n    repeat (10)\n        change [ghost v] effect by (-10)\n    end\nend\n\nwhen flag clicked\nset [ghost v] effect to (100)\nset [wait v] to [0]\n\nwhen this sprite clicked\nif <(ID) = [Caption]> then\n    set [clicked v] to [1]\n    change size by (10)\n    wait (.1) seconds\n    glide to x: [-420] y: [86] speed: [4] ghost [7]\n    set [clicked v] to [0]\n    go to x: (420) y: (86)\n    glide to x: [0] y: [86] speed: [4] ghost [-7]\nend\n\nwhen I receive [layering v]\ngo to [front v] layer\ngo [backward v] (item # of [Loading Screen] in [array-layers v]) layers\n\n@begin screen//Intro\n\nwhen flag clicked\nset [intro frame v] to [1]\nshow\nswitch costume to (black v)\nwait (3) seconds\nrepeat (169)\n    change [intro frame v] by (1)\n    switch costume to (intro frame)\n    if <key (s v) pressed?> then\n        repeat (10)\n            if <[170] > (intro frame)> then\n                change [intro frame v] by (1)\n            end\n            change [brightness v] effect by (-10)\n        end\n        broadcast (intro done v)\n        stop [this script v]\n    end\nend\nbroadcast (intro done v)\n\nwhen I receive [end load screen v]\nhide\nstop [other scripts in sprite v]\n\nwhen I receive [layering v]\ngo to [front v] layer\ngo [backward v] (item # of [Intro] in [array-layers v]) layers\n\n@Player\n\ndefine Set State\nset [state v] to [???]\nset rotation style [left-right v]\nif <(immune) = [1]> then\n    set [state v] to [travel]\n    stop [this script v]\nend\nif <(developer mode) = [1]> then\n    set [state v] to [developer mode]\nelse\n    if <(Wall Slide) > [0]> then\n        set [state v] to [wall slide]\n        stop [this script v]\n    end\n    if <not <(climb stairs) > [11]>> then\n        set [state v] to [climb stairs]\n        change [climb stairs v] by (1)\n        stop [this script v]\n    end\n    if <(Falling) > [1]> then\n        if <(Speed Y) > [0]> then\n            set [state v] to [jump]\n        else\n            set [state v] to [fall]\n        end\n        stop [this script v]\n    end\n    if <<(c/s) = [s]> or <(c/s) = [n/a]>> then\n        if <<(Frame) > [0]> and <(<key (right arrow v) pressed?> - <key (left arrow v) pressed?>) = ((direction) / (90))>> then\n            switch costume to (sense//push? v)\n            Check Touching Solid\n            if <(Touching) > [0]> then\n                set [state v] to [idle]\n            else\n                switch costume to (sense//walk? v)\n                Check Touching Solid\n                if <(Touching) > [0]> then\n                    switch costume to (sense//stair? v)\n                    Check Touching Solid\n                    if <(Touching) > [0]> then\n                        set [state v] to [idle]\n                    else\n                        set [state v] to [climb stairs]\n                        set [speed y v] to [10]\n                        set [climb stairs v] to [0]\n                    end\n                else\n                    if <(Run/Walk?) = [0]> then\n                        set [state v] to [walk]\n                    else\n                        set [state v] to [run]\n                    end\n                end\n            end\n        else\n            if <(Frame) > [0]> then\n                if <(Run/Walk?) = [0]> then\n                    set [state v] to [walk]\n                else\n                    set [state v] to [run]\n                end\n            else\n                set [state v] to [idle]\n            end\n        end\n    else\n        set [state v] to [crouch]\n    end\n    if <(Wall Slide) = [0]> then\n        set [climb frame v] to [0]\n    end\nend\n\ndefine Check Touching Solid\nif <<touching (level v)?> or <touching (platforms v)?>> then\n    set [touching v] to [1]\n    stop [this script v]\nend\nset [touching v] to [0]\n\ndefine Reset And Begin\nset [immune v] to [1]\nset [player x v] to (player: spawn x)\nset [player y v] to (player: spawn y)\nset [brightness v] effect to (100)\nset [ghost v] effect to (100)\nset [speed y v] to [0]\nset [speed x v] to [0]\nset [falling v] to [99]\nset [wall slide v] to [0]\nset [jumping v] to [0]\nset [long jump v] to [0]\npoint in direction (90)\nbroadcast (Game Loop v)\n\ndefine Fix Collision In Direction (dir)\nset [temp v] to (direction)\nset [distance v] to [1]\npoint in direction (dir)\nrepeat (128)\n    Check Touching Solid\n    if <(Touching) < [1]> then\n        point in direction (Temp)\n        stop [this script v]\n    end\n    move (Distance) steps\n    turn right (180) degrees\n    change [distance v] by (1)\nend\n\ndefine Find Closest Space To (x) (y) Max (max)\nset [temp v] to (direction)\nset [distance v] to [1]\npoint in direction (0)\nrepeat (max)\n    repeat (16)\n        go to x: (x) y: (y)\n        move (Distance) steps\n        Check Touching Solid\n        if <(Touching) < [1]> then\n            point in direction (Temp)\n            stop [this script v]\n        end\n        turn right (22.5) degrees\n    end\n    change [distance v] by (1)\nend\ngo to x: (x) y: (y)\npoint in direction (Temp)\n\ndefine Controls - Up And Down\nif <(developer mode) = [1]> then\n    set [speed y v] to ((<key (up arrow v) pressed?> - <key (down arrow v) pressed?>) * (developer player speed))\n    set [falling v] to [0]\nelse\n    set [jump force v] to [12]\n    if <key (up arrow v) pressed?> then\n        set [climb stairs v] to [12]\n        if <<<(Wall Slide) > [0]> and <(Jumping) = [0]>> and <(global stamina) > [3]>> then\n            if <(wall slide delay) = [0]> then\n                broadcast (jump v)\n                broadcast (hup v)\n                set [slipping off wall v] to [0]\n                set [jump force v] to [18]\n                set [jumping v] to [1]\n                set [falling v] to [3]\n                set [wall slide v] to [0]\n                turn right (180) degrees\n                set [speed x v] to (((direction) / (90)) * (2))\n                set [long jump v] to [3]\n                turn right (180) degrees\n                set [wall slide delay v] to [1]\n            end\n        end\n        if <[-5] > (Speed Y)> then\n            set [wall slide delay v] to [1]\n        end\n        if <<(Falling) < [3]> and <(Jumping) = [0]>> then\n            broadcast (jump v)\n            set [jumping v] to [1]\n            set [falling v] to [3]\n        end\n        if <<(Jumping) > [0]> and <(Jumping) < (Jump Duration)>> then\n            change [jumping v] by (1)\n            set [speed y v] to (Jump Force)\n        end\n    else\n        set [jumping v] to [0]\n    end\n    set [gravity v] to [-1.5]\n    change [speed y v] by (Gravity)\n    if <(Wall Slide) > [0]> then\n        Check Can Wall Slide\n        if <(Speed Y) < [0]> then\n            if <(slipping off wall) = [0]> then\n                set [speed y v] to ((Speed Y) / (1.3))\n            else\n                change [speed y v] by ((0) - (Gravity))\n            end\n        end\n        climb\n    end\n    if <(Falling) < [5]> then\n        if <key (down arrow v) pressed?> then\n            set [c/s v] to [c]\n        else\n            set [c/s v] to [s]\n        end\n    else\n        set [c/s v] to [n/a]\n    end\n    if <key (down arrow v) pressed?> then\n        if <<(Wall Slide) > [0]> and <(Jumping) = [0]>> then\n            set [wall slide delay v] to [1]\n            set [jumping v] to [1]\n            set [falling v] to [3]\n            set [wall slide v] to [0]\n            turn right (180) degrees\n            set [speed x v] to (((direction) / (90)) * (2))\n            set [long jump v] to [7]\n            turn right (180) degrees\n        end\n    end\n    switch costume to (sense//should crouch? \(s\) v)\n    Check Touching Solid\n    if <(Touching) > [0]> then\n        set [c/s v] to [c]\n    end\n    set hitbox\nend\n\ndefine Controls - Left And Right\nif <(developer mode) = [1]> then\n    set [speed x v] to ((<key (right arrow v) pressed?> - <key (left arrow v) pressed?>) * (developer player speed))\n    if <([abs v] of (Speed X) ) > [0]> then\n        point in direction ((<key (right arrow v) pressed?> - <key (left arrow v) pressed?>) * (90))\n    end\nelse\n    set [climb/slide v] to [climb]\n    if <<(c/s) = [s]> or <(c/s) = [n/a]>> then\n        if <(Run/Walk?) = [1]> then\n            set [divide key x v] to [1]\n        else\n            set [divide key x v] to [2]\n        end\n    else\n        set [divide key x v] to [4]\n    end\n    if <(Long Jump) > [0]> then\n        change [long jump v] by (-1)\n        stop [this script v]\n    end\n    set [key x v] to (<key (right arrow v) pressed?> - <key (left arrow v) pressed?>)\n    if <<(Wall Slide) > [0]> and <(Key X) = [0]>> then\n        set [key x v] to ((direction) / (90))\n        set [climb/slide v] to [slide]\n    end\n    if <<(Wall Slide) > [0]> and <not <(Key X) = ((direction) / (90))>>> then\n        set [key x v] to ((direction) / (90))\n    end\n    if <(Key X) = [0]> then\n        if <<(Falling) > [2]> and <(Wall Slide) < [1]>> then\n            set [speed x v] to ((Speed X) * (0.98))\n            stop [this script v]\n        end\n        if <([abs v] of (Speed X) ) < [1]> then\n            if <<(c/s) = [s]> or <(c/s) = [n/a]>> then\n                set [frame v] to [0]\n            else\n                change [frame v] by (.5)\n            end\n            set [speed x v] to [0]\n        else\n            change [frame v] by (0.5)\n        end\n    else\n        change [speed x v] by (((Key X) / (Divide Key X)) * (Acceleration))\n        if <not <(direction) = ((Key X) * (90))>> then\n            set [wall slide v] to [0]\n        end\n        if <(Key X) > [0]> then\n            point in direction (90)\n        else\n            point in direction (-90)\n        end\n        change [frame v] by (1)\n    end\n    set [speed x v] to ((Speed X) * (Resistance))\n    if <(Key X) > [0]> then\n        if <(direction) > [0]> then\n    end\n    if <(Key X) < [0]> then\n        if <(direction) < [0]> then\n    end\n    if <(Wall Slide) = [0]> then\n        set [slipping off wall v] to [0]\n    end\n    if <(Falling) = [0]> then\n        set [wall slide delay v] to [0]\n    end\nend\n\ndefine Check Can Wall Slide\nif <(Should Fall) > [0]> then\n    change [should fall v] by (-2)\n    set [wall slide v] to [0]\n    stop [this script v]\nend\nif <(Falling) < [2]> then\n    set [wall slide v] to [0]\n    stop [this script v]\nend\nif <[1] > (global stamina)> then\n    if <<(Wall Slide) > [0]> and <(Jumping) = [0]>> then\n        set [wall slide delay v] to [1]\n        set [jumping v] to [1]\n        set [falling v] to [3]\n        set [wall slide v] to [0]\n        turn right (180) degrees\n        set [speed x v] to (((direction) / (90)) * (2))\n        set [long jump v] to [7]\n        turn right (180) degrees\n    else\n        set [wall slide v] to [0]\n        stop [this script v]\n    end\nend\nswitch costume to (sense//can wallside? v)\nset rotation style [left-right v]\nCheck Touching Solid\nset [wall slide v] to (Touching)\nset hitbox\nset rotation style [don't rotate v]\nstop [this script v]\n\nwhen I receive [player bounce v]\nset [speed y v] to (Player Spring Y)\nif <([abs v] of (Player Spring X) ) > [.5]> then\n    set [speed x v] to (Player Spring X)\nend\nif <([abs v] of (Player Spring X) ) > [3]> then\n    set [long jump v] to [10]\nend\n\ndefine Move In Steps (steps)\nchange [falling v] by (1)\nrepeat (steps)\n    set [last value v] to (x position)\n    change x by ((Speed X) / (steps))\n    Check Touching Solid\n    if <(Touching) > [0]> then\n        Collide X - Slope Or Wall?\n    end\n    set [last value v] to (y position)\n    change y by ((Speed Y) / (steps))\n    Check Touching Solid\n    if <(Touching) > [0]> then\n        Collide Y - Ceiling Or Floor\n    else\n        jump through platforms (Speed Y) (Falling) (y position)\n    end\nend\n\ndefine Collide Y - Ceiling Or Floor\nset y to (Last Value)\nif <(Speed Y) > [0]> then\n    set [speed y v] to [0]\n    stop [this script v]\nend\nif <(Falling) > [0]> then\n    set [falling v] to [0]\n    Slip\nend\nset [speed y v] to ((Speed Y) * (0.8))\n\ndefine Collide X - Slope Or Wall?\nCheck Can Wall Slide\nchange y by (1)\nCheck Touching Solid\nif <(Touching) > [0]> then\n    change y by (1)\n    Check Touching Solid\n    if <(Touching) > [0]> then\n        change y by (-2)\n        set x to (Last Value)\n        set [speed x v] to [0]\n        stop [this script v]\n    end\n    set [speed x v] to ((Speed X) * (0.8))\nend\nset [speed x v] to ((Speed X) * (0.95))\nSlip\n\nwhen flag clicked\nhide\n\nwhen I receive [start game v]\nshow\npoint in direction (90)\nset [invulnerable v] to [0]\nset [gravity v] to [-1.5]\nset [jump force v] to [12]\nset [jump duration v] to [6]\nset [acceleration v] to [1.5]\nset [resistance v] to [0.8]\nset [lives v] to [12]\nspawn point player x: [353] player y: [422]\nReset And Begin\n\nwhen I receive [tick - player v]\nMoved By Moving Platform\nif <(immune) < [1]> then\n    Controls - Left And Right\n    Controls - Up And Down\nend\nMove In Steps (([abs v] of (Speed X) ) + ([abs v] of (Speed Y) ))\nSet State\nset costume\n\ndefine Slip\nchange y by (-2)\nchange x by (1)\nCheck Touching Solid\nif <(Touching) < [1]> then\n    set [falling v] to [9]\n    change [speed x v] by (1)\n    stop [this script v]\nend\nchange x by (-2)\nCheck Touching Solid\nif <(Touching) < [1]> then\n    set [falling v] to [9]\n    change [speed x v] by (-1)\n    stop [this script v]\nend\nchange y by (2)\nchange x by (1)\n\ndefine Moved By Moving Platform\nchange x by (PLATFORM DX)\nchange y by (PLATFORM DY)\nCheck Touching Solid\nif <(Touching) > [0]> then\n    Find Closest Space To (x position) (y position) Max [10]\n    if <(Touching) > [0]> then\n        broadcast (Reset v)\n    end\nend\n\nwhen I receive [reset v]\nif <(immune) = [0]> then\n    set [immune v] to [1]\n    Reset And Begin\nend\n\nwhen I receive [tick - first v]\nset [platform dx v] to []\nset [platform dy v] to []\nset hitbox\nset rotation style [don't rotate v]\n\ndefine set hitbox\nif <<(c/s) = [s]> or <(c/s) = [n/a]>> then\n    switch costume to (sense//stand \(hb\) v)\nelse\n    switch costume to (sense//crouch \(hb\) v)\nend\n\nwhen I receive [game loop v]\nforever\n    set [last x v] to (x position)\n    set [last y v] to (y position)\n    if <[1] > (global stamina)> then\n        set [run/walk? v] to [0]\n    end\n    broadcast (Tick - First v)\n    broadcast (Ticks - Platforms v)\n    broadcast (Tick - Player v)\n    broadcast (Tick - Last v)\n    broadcast (camera v)\nend\n\ndefine set costume\nchange size by (((60) - (size)) / (3))\nif <(state) = [travel]> then\n    switch costume to (travel v)\n    stop [this script v]\nend\nif <(state) = [developer mode]> then\n    switch costume to (idle//1 v)\n    stop [this script v]\nend\nif <(state) = [wall slide]> then\n    switch costume to ((78) + ([floor v] of ((climb frame) mod (26)) ))\n    stop [this script v]\nend\nif <(state) = [jump]> then\n    switch costume to (airborn//1 v)\n    stop [this script v]\nend\nif <(state) = [fall]> then\n    switch costume to (airborn//2 v)\n    stop [this script v]\nend\nif <(state) = [walk]> then\n    change [frame v] by (-.2)\n    switch costume to ((9) + ([floor v] of ((Frame) mod (21)) ))\n    stop [this script v]\nend\nif <(state) = [run]> then\n    change [frame v] by (.2)\n    switch costume to ((33) + ([floor v] of ((Frame) mod (22)) ))\n    stop [this script v]\nend\nif <(state) = [idle]> then\n    switch costume to ((2) + ([floor v] of (Idle Frame) ))\n    stop [this script v]\nend\nif <(state) = [crouch]> then\n    if <(Frame) > [0]> then\n        switch costume to ((56) + (([floor v] of (Frame) ) mod (21)))\n        change [frame v] by (-.5)\n    else\n        switch costume to (crouch//1 v)\n    end\n    stop [this script v]\nend\nif <(state) = [climb stairs]> then\n    if <(Run/Walk?) = [0]> then\n        switch costume to ((9) + ([floor v] of ((Frame) mod (21)) ))\n        stop [this script v]\n    else\n        change [frame v] by (.4)\n        switch costume to ((33) + ([floor v] of ((Frame) mod (22)) ))\n        stop [this script v]\n    end\nend\n\ndefine jump through platforms (speed y) (falling) (y)\nif <touching (jump through v)?> then\n    if <(Speed Y) < [0]> then\n        change y by (-42.5)\n        if <touching (jump through v)?> then\n            set [speed y v] to [0]\n            set y to (Last Value)\n            set [falling v] to [0]\n        else\n            set y to (y)\n        end\n    end\nend\nswitch costume to (sense//on-ground \(s\) v)\nif <<not <touching (jump through v)?>> or <key (down arrow v) pressed?>> then\n    set hitbox\n    set [speed y v] to (speed y)\n    set y to (y)\n    set [falling v] to (falling)\nend\nset hitbox\nif <not <key (down arrow v) pressed?>> then\n    if <touching (jump through v)?> then\n        change y by (1)\n        if <touching (jump through v)?> then\n            change y by (1)\n            if <touching (jump through v)?> then\n                change y by (-2)\n                stop [this script v]\n            end\n        end\n    end\nend\n\ndefine climb\nif <(climb/slide) = [slide]> then\n    set [slide amount v] to [-2]\nelse\n    set [slide amount v] to [-15]\nend\nswitch costume to (sense//up slope? v)\nCheck Touching Solid\nif <(Touching) > [0]> then\n    set [should fall v] to [10]\nend\nif <[0] > (Speed Y)> then\n    if <<(climb/slide) = [climb]> and <(wall slide delay) = [0]>> then\n        set [slipping off wall v] to [0]\n        if <(<key (right arrow v) pressed?> - <key (left arrow v) pressed?>) = ((direction) / (90))> then\n            set [speed y v] to (((Speed Y) / (1.5)) + (1.3))\n            change [climb frame v] by (1)\n        end\n        if <not <(<key (right arrow v) pressed?> - <key (left arrow v) pressed?>) = ((direction) / (90))>> then\n            set [speed y v] to (((Speed Y) / (1.5)) - (.2))\n            change [climb frame v] by (-1)\n        end\n    else\n        change [speed y v] by ((Speed Y) * (1.1))\n        if <(slide amount) > (Speed Y)> then\n            set [slipping off wall v] to [1]\n        end\n        if <(slipping off wall) = [1]> then\n            change [speed y v] by (((0) - (Speed Y)) / (1.4))\n        end\n        if <(round (Speed Y)) = [0]> then\n            set [wall slide delay v] to [0]\n        end\n    end\nend\nset rotation style [left-right v]\nswitch costume to (sense//can climb up? v)\nCheck Touching Solid\nif <not <(Touching) > [0]>> then\n    set [speed y v] to [10]\nend\nset rotation style [don't rotate v]\nset hitbox\n\nwhen I receive [camera v]\ncamera\n\ndefine camera\nchange [player x v] by ((x position) - (last x))\nchange [player y v] by ((y position) - (last y))\nchange [scroll x v] by (round (((player x) - (scroll x)) / (4)))\nchange [scroll y v] by (round (((player y) - (scroll y)) / (2)))\nif <(scroll x) < [480]> then\n    set [scroll x v] to [480]\nend\nif <(scroll x) > ((level x amount) * (480))> then\n    set [scroll x v] to ((level x amount) * (480))\nend\nif <(scroll y) < [360]> then\n    set [scroll y v] to [360]\nend\ngo to x: ((player x) + ((0) - (scroll x))) y: ((player y) + ((0) - (scroll y)))\nif <not <(screen shake) = [0]>> then\n    change [scroll y v] by (screen shake)\n    set [screen shake v] to [0]\nend\n\nwhen I receive [save coordinates v]\nspawn point player x: (player x) player y: (player y)\n\ndefine spawn point player x: (player x) player y: (player y)\nset [player: spawn x v] to (player x)\nset [player: spawn y v] to (player y)\n\nwhen I receive [coin fx v]\nchange size by (-5)\n\nwhen I receive [tick - last v]\nif <key (r v) pressed?> then\n    broadcast (Reset v)\nend\nif <(developer mode) = [0]> then\n    if <(y position) < [-187]> then\n        broadcast (fell off v)\n    end\n    if <<touching (danger v)?> or <touching (saw v)?>> then\n        if <(invulnerable) = [0]> then\n            if <[1] > (immune)> then\n                set [invulnerable v] to [3]\n                broadcast (hurt v)\n            end\n        end\n    end\n    if <<(Lives) < [0]> or <(Lives) = [0]>> then\n        broadcast (Reset v)\n    end\n    if <<(Lives) < [0]> or <(Lives) = [0]>> then\n        change [lives v] by (-1)\n        broadcast (die v)\n    end\n    if <(Lives) < [-20]> then\n        set [lives v] to [12]\n    end\nend\n\nwhen I receive [save coordinates v]\nspawn point player x: (player: spawn x) player y: (player: spawn y)\n\nwhen I receive [travel v]\nspawn point player x: ([travel x v] of [for developer //developer  v]) player y: ([travel y v] of [for developer //developer  v])\nif <(immune) = [0]> then\n    broadcast (travel FX v)\nend\n\nwhen I receive [travel fx v]\nfade <<(state) = [jump]> or <(state) = [fall]>> <[1] = [1]>\n\nwhen I receive [game loop v]\nif <key (s v) pressed?> then\n    clear graphic effects\n    set [immune v] to [0]\n    stop [this script v]\nend\nwait (.7) seconds\nrepeat (5)\n    change [ghost v] effect by (-10)\nend\nset [fx x v] to (player x)\nset [fx y v] to (player y)\nbroadcast (coin fx v)\nbroadcast (poof v)\nrepeat (5)\n    change [ghost v] effect by (-10)\nend\nrepeat (5)\n    change [brightness v] effect by (-20)\nend\nset [immune v] to [.5]\nwait (1) seconds\nset [immune v] to [0]\n\ndefine fade <jumping?> <traveling?>\nif <key (s v) pressed?> then\n    set [immune v] to [1]\n    stop [other scripts in sprite v]\n    set [player x v] to (player: spawn x)\n    set [player y v] to (player: spawn y)\n    Reset And Begin\n    stop [this script v]\nend\nset [state v] to [travel]\nset [speed x v] to [0]\nset [immune v] to [1]\nwait (.1) seconds\nswitch costume to (travel v)\nif <not <jumping?>> then\n    repeat (5)\n        set [speed y v] to [4]\n    end\n    repeat (8)\n        change [brightness v] effect by (10)\n        set [speed y v] to [1]\n    end\n    set [fx x v] to (player x)\n    set [fx y v] to (player y)\n    broadcast (poof v)\n    broadcast (coin fx v)\n    repeat (4)\n        change [ghost v] effect by (25)\n        set [speed y v] to [.2]\n    end\nelse\n    repeat (8)\n        change [brightness v] effect by (10)\n        change [speed y v] by (((0) - (Speed Y)) / (4))\n    end\n    set [fx x v] to (player x)\n    set [fx y v] to (player y)\n    broadcast (poof v)\n    broadcast (coin fx v)\n    repeat (4)\n        change [ghost v] effect by (25)\n        change [speed y v] by (((0) - (Speed Y)) / (4))\n    end\nend\nstop [other scripts in sprite v]\nset [player x v] to (player: spawn x)\nset [player y v] to (player: spawn y)\nReset And Begin\n\nwhen I receive [travel fx v]\nrepeat until <(round (Speed X)) = [0]>\n    set [speed x v] to (((0) - (Speed X)) / (4))\nend\n\nwhen I receive [tick - last v]\nset [step v] to (([floor v] of (Frame) ) mod (10))\nif << (costume [name v]) contains [walk]?> or < (costume [name v]) contains [run]?>> then\n    if <(step) = [5]> then\n        broadcast (step1 v)\n    end\n    if <(step) = [10]> then\n        broadcast (step2 v)\n    end\nend\n\nwhen I receive [-1 life v]\nchange [lives v] by (-4)\n\nwhen I receive [player fell off respawn v]\nif <(immune) = [0]> then\n    set [immune v] to [1]\n    spawn point player x: ([travel x v] of [for developer //developer  v]) player y: ([travel y v] of [for developer //developer  v])\n    change [lives v] by (-4)\n    if <(Lives) > [0]> then\n        broadcast (Reset v)\n    else\n        broadcast (Reset v)\n    end\n    set [immune v] to [0]\nend\nif <not <(Lives) > [0]>> then\n    spawn point player x: [353] player y: [422]\nend\n\nspawn point player x: [353] player y: [422]\n\nwhen I receive [layering v]\ngo to [front v] layer\ngo [backward v] (item # of [Player] in [array-layers v]) layers\n\nwhen I receive [screen shake v]\n\n@tail\n\nwhen I receive [camera v]\nmove <<<(state) = [jump]> or <(state) = [fall]>> or <(state) = [travel]>>\n\nwhen I receive [start game v]\nclear graphic effects\nset [r v] to [1]\nforever\n    broadcast (Tick v)\nend\n\ndefine idle\nset rotation style [all around v]\nchange [shift v] by (20)\nif <(r) < [15]> then\n    point in direction ((([sin v] of (shift) ) * (5)) + (90))\nelse\n    point in direction ((([sin v] of (shift) ) * (10)) + (90))\nend\n\ndefine move <hide?>\nset rotation style [don't rotate v]\nswitch costume to (move v)\nif <(state) = [crouch]> then\n    go to x: ([x position v] of [player v]) y: (([y position v] of [player v]) - (17))\nelse\n    go to x: ([x position v] of [player v]) y: (([y position v] of [player v]) - (10))\nend\nif <([direction v] of [player v]) > [0]> then\n    switch costume to (90 v)\nelse\n    switch costume to (-90 v)\nend\nif <hide?> then\n    hide\nelse\n    show\nend\nchange [r v] by (1)\nset [r v] to ((r) mod (30))\nidle\n\nwhen I receive [screen shake v]\nrepeat (4)\n    set [screen shake v] to [5]\n    wait (.01) seconds\n    set [screen shake v] to [-5]\n    wait (.01) seconds\nend\n\nwhen I receive [layering v]\ngo to [front v] layer\ngo [backward v] (item # of [tail] in [array-layers v]) layers\n\n@Coins\n\ndefine go to x: (x) y: (y) costume (c)\nswitch costume to (blank v)\ngo to x: (x) y: (y)\nif <<(round (x)) = (round (x position))> and <(round (y)) = (round (y position))>> then\n    show\nelse\n    hide\nend\nswitch costume to (c)\n\nwhen I receive [start game v]\nhide\nswitch costume to (silver//1 v)\ngenerate clones @ x: [490] y: [480] x shift [40] y shift [0] amount [2]\ngenerate clones @ x: [871] y: [624] x shift [0] y shift [-40] amount [3]\ngenerate clones @ x: [1370] y: [480] x shift [30] y shift [30] amount [3]\ngenerate clones @ x: [1312] y: [789] x shift [0] y shift [40] amount [3]\ngenerate clones @ x: [755] y: [769] x shift [50] y shift [0] amount [6]\ngenerate clones @ x: [380] y: [320] x shift [] y shift [] amount [1]\ngenerate clones @ x: [1392] y: [248] x shift [50] y shift [] amount [5]\nswitch costume to (heart v)\ngenerate clones @ x: [557] y: [851] x shift [0] y shift [0] amount [1]\nswitch costume to (star v)\ngenerate clones @ x: [607] y: [851] x shift [0] y shift [0] amount [1]\nswitch costume to (follow v)\ngenerate clones @ x: [657] y: [851] x shift [0] y shift [0] amount [1]\ngo to x: (0) y: (0)\n\ndefine generate clones @ x: (x) y: (y) x shift (xs) y shift (ys) amount (a)\nset [id v] to [clone]\nset [generate x v] to (x)\nset [generate y v] to (y)\nset [wait time v] to [0]\nrepeat (a)\n    set [clone x v] to (generate x)\n    set [clone y v] to (generate y)\n    create clone of (_myself_ v)\n    change [generate x v] by (xs)\n    change [generate y v] by (ys)\n    change [wait time v] by (.2)\nend\nset [id v] to [sprite]\nhide\n\nwhen I receive [tick v]\nif <(ID) = [clone]> then\n    go to x: (((scroll x) - (clone x)) * (-1)) y: (((scroll y) - (clone y)) * (-1)) costume (costume [number v])\n    change size by (((100) - (size)) / (5))\nelse\n    stop [this script v]\nend\n\nwhen I start as a clone\nif <(costume [number v]) = [1]> then\n    wait (wait time) seconds\n    set rotation style [all around v]\n    forever\n        switch costume to (silver//1 v)\n        repeat (13)\n            next costume\n            dir [45]\n        end\n        repeat (30)\n            dir [45]\n        end\n    end\nelse\n    set rotation style [all around v]\n    forever\n        dir [90]\n    end\nend\n\ndefine dir (d)\nchange [shift v] by (6)\nset rotation style [all around v]\npoint in direction ((([sin v] of (shift) ) * (12)) + (d))\n\nwhen I start as a clone\nset [generate x v] to (clone x)\nset [generate y v] to (clone y)\nwait (1) seconds\nforever\n    if < (costume [name v]) contains [silver]?> then\n        if <[1] > ([immune v] of [player v])> then\n            sense (costume [number v])\n            if <(costume [name v]) = [sensed]> then\n                stop [other scripts in sprite v]\n                switch costume to (silver//1 v)\n                fade\n            end\n        end\n    else\n        if <touching (player v)?> then\n            set [fx x v] to (clone x)\n            set [fx y v] to (clone y)\n            broadcast (coin fx v)\n            fade\n        end\n    end\n    if <(distance to [player v]) < [60]> then\n        change [clone x v] by ((([x position v] of [player v]) - (x position)) / (3))\n        change [clone y v] by ((([y position v] of [player v]) - (y position)) / (3))\n    end\n    if <(distance to [player v]) < [60]> then\nend\n\ndefine sense (#)\nswitch costume to (sense v)\nif <touching (player v)?> then\n    switch costume to (sensed v)\n    set [fx x v] to (clone x)\n    set [fx y v] to (clone y)\n    broadcast (coin fx v)\n    stop [this script v]\nend\nswitch costume to (#)\n\ndefine fade\nbroadcast (coin collect v)\nchange size by (30)\nrepeat (10)\n    change [ghost v] effect by (10)\n    if <(distance to [player v]) < [60]> then\n        change [clone x v] by ((([x position v] of [player v]) - (x position)) / (3))\n        change [clone y v] by ((([y position v] of [player v]) - (y position)) / (3))\n    end\nend\ndelete this clone\n\nwhen I receive [layering v]\ngo to [front v] layer\ngo [backward v] (item # of [Coins] in [array-layers v]) layers\n\n@fx\n\ndefine clone costumes 1: (1) 2: (2)\nset [clone x v] to (fx x)\nset [clone y v] to (fx y)\nswitch costume to (1)\nset [id v] to [clone]\nrepeat (5)\n    create clone of (_myself_ v)\nend\nswitch costume to (2)\nset [id v] to [clone2]\ncreate clone of (_myself_ v)\nset [id v] to []\n\nwhen I start as a clone\nif <(ID) = [clone]> then\n    go to x: (((scroll x) - (clone x)) * (-1)) y: (((scroll y) - (clone y)) * (-1))\n    set [fx.x.vel v] to (pick random (-5.) to (5))\n    set [fx.y.vel v] to (pick random (-1.) to (1))\n    set [fx.dir.vel v] to (pick random (-15) to (15))\n    set [fx.size.vel v] to (pick random (-2) to (-5))\n    set size to (200) %\n    show\n    repeat until <(size) = [100]>\n        set [ghost v] effect to ((225) - (size))\n        change size by ((fx.size.vel) / (5))\n        change [clone y v] by (fx.y.vel)\n        change [clone x v] by (fx.x.vel)\n        turn right (fx.dir.vel) degrees\n        set [fx.dir.vel v] to ((.95) * (fx.dir.vel))\n        set [fx.size.vel v] to ((1.05) * (fx.size.vel))\n        set [fx.x.vel v] to ((.85) * (fx.x.vel))\n        change [fx.y.vel v] by (-.15)\n    end\n    delete this clone\nelse\n    go to x: (((scroll x) - (clone x)) * (-1)) y: (((scroll y) - (clone y)) * (-1))\n    set [size.vel v] to [12]\n    set [ghost v] effect to (0)\n    show\n    repeat (10)\n        change [ghost v] effect by (10)\n        change size by (size.vel)\n        change [size.vel v] by (-1)\n    end\n    delete this clone\nend\n\nwhen I receive [coin fx v]\nif <(ID) = []> then\n    clone costumes 1: [1] 2: [2]\n    broadcast (screen shake v)\nend\n\nwhen I receive [tick v]\nif <(ID) = []> then\n    stop [this script v]\nelse\n    go to x: (((scroll x) - (clone x)) * (-1)) y: (((scroll y) - (clone y)) * (-1))\nend\n\nwhen I receive [layering v]\ngo to [front v] layer\ngo [backward v] (item # of [fx] in [array-layers v]) layers\nset [id v] to []\nhide\n\ndefine go to x: (x) y: (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\n@Mushrooms\n\ndefine go to x: (x) y: (y) costume (c)\nswitch costume to (blank v)\ngo to x: (x) y: (y)\nif <<(round (x)) = (round (x position))> and <(round (y)) = (round (y position))>> then\n    show\nelse\n    hide\nend\nswitch costume to (c)\n\nwhen I receive [tick v]\nif <(ID) = [clone]> then\n    go to x: (((scroll x) - (clone x)) * (-1)) y: (((scroll y) - (clone y)) * (-1)) costume (costume [number v])\n    change size by (((100) - (size)) / (5))\nelse\n    stop [this script v]\nend\n\nwhen I receive [start game v]\nhide\ngo to x: (0) y: (0)\nclone @ x: [688] y: [300] direction [90]\nclone @ x: [1131] y: [302] direction [124]\nclone @ x: [1567] y: [700] direction [58]\nclone @ x: [1209] y: [201] direction [146]\n\nwhen I start as a clone\nset [id v] to [clone]\nswitch costume to (1 v)\nforever\n    if <touching (player v)?> then\n        if <[-10] > ([speed y v] of [player v])> then\n            prepare bounce [18]\n            repeat (5)\n                move steps (direction) steps [2]\n            end\n            repeat (5)\n                move steps (direction) steps [-2]\n            end\n        end\n    end\nend\n\nwhen I receive [layering v]\ngo to [front v] layer\ngo [backward v] (item # of [Mushrooms] in [array-layers v]) layers\n\ndefine move steps (dir) steps (s)\nset [last clone x v] to (x position)\nset [last clone y v] to (y position)\npoint in direction ((direction) + (90))\nmove (s) steps\npoint in direction (dir)\nset [xv v] to ((x position) - (last clone x))\nset [yv v] to ((y position) - (last clone y))\nchange [clone x v] by (xv)\nchange [clone y v] by (yv)\n\ndefine prepare bounce (bounce force)\nif <key (up arrow v) pressed?> then\n    change size by (10)\n    move steps (direction) steps ((bounce force) + (4))\n    set [player spring x v] to ((0) - (xv))\n    set [player spring y v] to ((0) - (yv))\n    move steps (direction) steps ((0) - ((bounce force) + (4)))\n    broadcast (Player Bounce v)\nelse\n    change size by (10)\n    move steps (direction) steps (bounce force)\n    set [player spring x v] to ((0) - (xv))\n    set [player spring y v] to ((0) - (yv))\n    move steps (direction) steps ((0) - (bounce force))\n    broadcast (Player Bounce v)\nend\n\ndefine clone @ x: (x) y: (y) direction (dir)\nset [clone x v] to (x)\nset [clone y v] to (y)\npoint in direction (dir)\ncreate clone of (_myself_ v)\n\n@Platforms\n\ndefine Tick (new x) (new y)\nif <(new y) > (Last Y)> then\n    change [clone y v] by (1)\nelse\n    set [clone y v] to ((Last Y) + (1))\nend\ngo to x: (((scroll x) - (clone x)) * (-1)) y: (((scroll y) - (clone y)) * (-1)) []\nchange y by (1)\nif <touching (player v)?> then\n    change y by (-1)\n    set [platform dx v] to ((new x) - (Last X))\n    set [platform dy v] to ((new y) - (Last Y))\nelse\n    change y by (-1)\nend\nset [clone x v] to (new x)\nset [clone y v] to (new y)\n\nwhen I receive [ticks - platforms v]\nif <(ID) = [clone]> then\n    Tick (clone x) (clone y)\n    set [last x v] to (clone x)\n    set [last y v] to (clone y)\nend\n\nwhen I receive [start game v]\nhide\nclone at x: [992] y: [720] speed x: [-2.5] speed y: [0] repeat: [94] type: [platform] costume: [1] wait: [y] stop: [1]\nclone at x: [1315] y: [682] speed x: [0] speed y: [-.5] repeat: [10] type: [platform] costume: [1] wait: [n] stop: [0]\n\nclone at x: [1873] y: [650] speed x: [0] speed y: [-1.5] repeat: [70] type: [crushing platform] costume: [2] wait: [] stop: []\n\ndefine clone at x: (x) y: (y) speed x: (speed x) speed y: (speed y) repeat: (repeat) type: (t) costume: (c) wait: (w) stop: (s)\ndelete all of [platforms~stuff v]\nadd (repeat) to [platforms~stuff v]\nadd (speed x) to [platforms~stuff v]\nadd (speed y) to [platforms~stuff v]\nadd (t) to [platforms~stuff v]\nadd (c) to [platforms~stuff v]\nadd (w) to [platforms~stuff v]\nadd (s) to [platforms~stuff v]\nset [id v] to [clone]\nset [clone x v] to (x)\nset [clone y v] to (y)\ncreate clone of (_myself_ v)\nset [id v] to []\n\nwhen I receive [tick v]\nif <(ID) = [clone]> then\n    go to x: (((scroll x) - (clone x)) * (-1)) y: (((scroll y) - (clone y)) * (-1)) []\nend\n\ndefine go to x: (x) y: (y) (c)\ngo to x: (x) y: (y)\nif <<(x position) = (x)> and <(y position) = (y)>> then\n    show\n    set [show/hide v] to [show]\nelse\n    hide\n    set [show/hide v] to [hide]\nend\n\nwhen I start as a clone\nset [orig x v] to (clone x)\nset [orig y v] to (clone y)\nswitch costume to (item (5) of [platforms~stuff v])\nif <(item (4) of [platforms~stuff v]) = [platform]> then\n    if <(item (6) of [platforms~stuff v]) = [y]> then\n        set [touched v] to [0]\n        repeat until <(touched) = [1]>\n            check touching\n        end\n    end\n    forever\n        repeat (item (1) of [platforms~stuff v])\n            change [clone x v] by (item (2) of [platforms~stuff v])\n            change [clone y v] by (item (3) of [platforms~stuff v])\n        end\n        wait (item (7) of [platforms~stuff v]) seconds\n        repeat (item (1) of [platforms~stuff v])\n            change [clone x v] by ((0) - (item (2) of [platforms~stuff v]))\n            change [clone y v] by ((0) - (item (3) of [platforms~stuff v]))\n        end\n        wait (item (7) of [platforms~stuff v]) seconds\n    end\nelse\n    forever\n        repeat until <<(round (clone y)) = (round ((orig y) + ((item (3) of [platforms~stuff v]) * (item (1) of [platforms~stuff v]))))> and <(round (clone x)) = (round ((orig x) + ((item (2) of [platforms~stuff v]) * (item (1) of [platforms~stuff v]))))>>\n            change [clone y v] by (((round ((orig y) + ((item (3) of [platforms~stuff v]) * (item (1) of [platforms~stuff v])))) - (clone y)) / (2))\n            change [clone x v] by (((round ((orig x) + ((item (2) of [platforms~stuff v]) * (item (1) of [platforms~stuff v])))) - (clone x)) / (2))\n        end\n        wait (.5) seconds\n        repeat ((item (1) of [platforms~stuff v]) / (2))\n            change [clone x v] by (((0) - (item (2) of [platforms~stuff v])) * (2))\n            change [clone y v] by (((0) - (item (3) of [platforms~stuff v])) * (2))\n        end\n        wait (.5) seconds\n    end\nend\n\ndefine check touching\nchange y by (5)\nif <touching (player v)?> then\n    set [touched v] to [1]\nend\nchange y by (-5)\n\nwhen I receive [layering v]\ngo to [front v] layer\ngo [backward v] (item # of [Platforms] in [array-layers v]) layers\n\nwhen I receive [tick - first v]\nswitch costume to (join (item (5) of [platforms~stuff v]) [ \(2\)])\n\nwhen I receive [tick - last v]\nswitch costume to (item (5) of [platforms~stuff v])\n\n@fake wall\n\nwhen I receive [tick v]\nif <(ID) = [clone]> then\n    set [ghost v] effect to (ghost)\n    go to x: (((scroll x) - (clone x)) * (-1)) y: (((scroll y) - (clone y)) * (-1))\nelse\n    stop [this script v]\nend\n\ndefine go to x: (x) y: (y)\ngo to x: (x) y: (y)\nif <<(x position) = (x)> and <(y position) = (y)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [start game v]\nset [id v] to [sprite]\nclone at x: [378] y: [317] costume [2]\nclone at x: [1393] y: [248] costume [3]\n\ndefine clone at x: (clone x) y: (clone y) costume (clone c)\nshow\nswitch costume to (clone c)\nset [clone x v] to (clone x)\nset [clone y v] to (clone y)\ncreate clone of (_myself_ v)\nset [clone x v] to []\nset [clone y v] to []\nhide\n\nwhen I receive [layering v]\nset [hidden spots v] to [0]\ngo to [front v] layer\ngo [backward v] (item # of [fake wall] in [array-layers v]) layers\n\nwhen I start as a clone\nset [id v] to [clone]\nset [found? v] to [0]\nwait (2) seconds\nforever\n    if <(touching player) = [0]> then\n        repeat until <<(ghost) = [0]> or <(touching player) = [1]>>\n            change [ghost v] by (-20)\n        end\n    else\n        repeat until <<(ghost) = [100]> or <not <(touching player) = [1]>>>\n            change [ghost v] by (20)\n            if <(hidden spots) = [0]> then\n                if <(found?) = [0]> then\n                    set [hidden spots v] to [1]\n                    set [found? v] to [1]\n                    set [notification v] to [s1]\n                    broadcast (notification v)\n                end\n            end\n            if <(hidden spots) = [1]> then\n                if <(found?) = [0]> then\n                    set [hidden spots v] to [2]\n                    set [notification v] to [s2]\n                    broadcast (notification v)\n                end\n            end\n        end\n    end\nend\n\nwhen I receive [tick - player v]\nif <(ID) = [clone]> then\n    change y by (-5)\n    if <touching (player v)?> then\n        set [touching player v] to [1]\n    else\n        set [touching player v] to [0]\n    end\n    change y by (5)\nelse\n    stop [this script v]\nend\n\nset [hidden spots v] to [2]\nbroadcast (20/20 v)\n\n@Danger\n\ndefine list\ndelete all of [~level v]\nswitch costume to (join [1] [])\nrepeat until <not < (costume [name v]) contains [,]?>>\n    add (costume [name v]) to [~level v]\n    next costume\nend\n\nwhen I start as a clone\nforever\n    tileController // xPos: (((tile column) * (x spacing)) - (scroll x)) yPos: (((tile row) * (y spacing)) - (scroll y))\nend\n\ndefine tileController // xPos: (x) yPos: (y)\nswitch costume to (border v)\ngo to x: (x) y: (y)\nshow\nif < (~level) contains (join (join ((tile column) - (1)) [,]) ((tile row) - (1)))?> then\n    show\n    set [show/hide v] to [show]\nelse\n    hide\n    set [show/hide v] to [hide]\nend\nswitch costume to (join (join ((tile column) - (1)) [,]) ((tile row) - (1)))\nif <(x) > (x spacing)> then\n    change [tile column v] by (-2)\nend\nif <(x) < ((0) - (x spacing))> then\n    change [tile column v] by (2)\nend\nif <(y) > (y spacing)> then\n    change [tile row v] by (-2)\nend\nif <(y) < ((0) - (y spacing))> then\n    change [tile row v] by (2)\nend\n\ndefine set up\nset [level color v] to [0]\nset [level brightness v] to [5]\nlist\nset [ghost v] effect to (0)\nset [x spacing v] to [478]\nset [y spacing v] to [360]\nset [total level width v] to [2]\nset [total level height v] to [2]\nset [id v] to [clone]\nset [tile column v] to [1]\nset [tile row v] to [1]\ncreate clone of (_myself_ v)\nset [tile column v] to [1]\nset [tile row v] to [2]\ncreate clone of (_myself_ v)\nset [tile column v] to [2]\nset [tile row v] to [1]\ncreate clone of (_myself_ v)\nset [tile column v] to [2]\nset [tile row v] to [2]\ncreate clone of (_myself_ v)\nset [id v] to [main]\nhide\n\nwhen I receive [start game v]\nset up\n\nwhen I receive [layering v]\ngo to [front v] layer\ngo [backward v] (item # of [Danger] in [array-layers v]) layers\n\n@hearts\n\nwhen I start as a clone\nset [ghost v] effect to (100)\nshow\nwait ((ID) / (10)) seconds\nrepeat (5)\n    change [ghost v] effect by (-20)\nend\nforever\n    wait (.5) seconds\n    repeat (2)\n        if <(clone lives) > [0]> then\n            if <<(((ID) * (4)) + (5)) > (max lives)> or <(((ID) * (4)) + (5)) > (round (Lives2))>> then\n                change [brightness v] by (10)\n                change size by (20)\n                wait (.5) seconds\n            end\n        end\n    end\nend\n\nwhen I start as a clone\ngo to [front v] layer\nforever\n    set [clone lives v] to ((round (Lives2)) - ((ID) * (4)))\n    if <[0] > (clone lives)> then\n        set [clone lives v] to [0]\n    end\n    if <(clone lives) > [4]> then\n        set [clone lives v] to [4]\n    end\n    switch costume to (join [-] (round (clone lives)))\n    if <not <(join [-] (round (clone lives))) = (costume [name v])>> then\n        switch costume to (last costume)\n    end\n    if <not <(last costume) = (costume [number v])>> then\n        change [brightness v] by (25)\n    end\n    set [last costume v] to (costume [number v])\n    change size by (((100) - (size)) / (10))\n    set [brightness v] effect to (brightness)\n    change [brightness v] by (((0) - (brightness)) / (5))\nend\n\ndefine lives (amount)\nset [max lives v] to ((amount) * (4))\nif <(amount) > [10]> then\n    go to x: (-235) y: (100)\n    repeat ((amount) - (10))\n        change x by (35)\n    end\n    set [id v] to ((amount) - (1))\n    create clone of (_myself_ v)\n    repeat ((amount) - (11))\n        change x by (-35)\n        change [id v] by (-1)\n        create clone of (_myself_ v)\n    end\n    go to x: (-235) y: (150)\n    repeat (11)\n        change x by (35)\n    end\n    repeat (10)\n        change x by (-35)\n        change [id v] by (-1)\n        create clone of (_myself_ v)\n    end\nelse\n    go to x: (-235) y: (150)\n    repeat (amount)\n        change x by (35)\n    end\n    set [id v] to ((amount) - (1))\n    create clone of (_myself_ v)\n    repeat ((amount) - (1))\n        change x by (-35)\n        change [id v] by (-1)\n        create clone of (_myself_ v)\n    end\nend\nset [id v] to [sprite]\n\nwhen I receive [end load screen v]\nwait (.5) seconds\nlives [3]\n\nwhen I receive [layering v]\ngo to [front v] layer\ngo [backward v] (item # of [hearts] in [array-layers v]) layers\n\nwhen flag clicked\nhide\n\nwhen flag clicked\nforever\n    if <((Lives) - (Lives2)) > [3]> then\n        change [lives2 v] by (4)\n    else\n        change [lives2 v] by (((Lives) - (Lives2)) / (4))\n    end\n    if <((Lives) - (Lives2)) < [-3]> then\n        change [lives2 v] by (-4)\n    else\n        change [lives2 v] by (((Lives) - (Lives2)) / (4))\n    end\n    if <(Lives2) < [0]> then\n        set [lives2 v] to [0]\n    end\nend\n\nwhen I receive [hurt v]\nif <(ID) = [sprite]> then\n    change [lives v] by ((0) - (invulnerable))\n    broadcast (screen shake v)\n    wait (.5) seconds\n    set [invulnerable v] to [0]\nend\n\n@sound\n\nwhen I receive [end load screen v]\nwait (1) seconds\nforever\n    play sound [Songs//Lost Woods v] until done\nend\n\nwhen I receive [step1 v]\nstart sound [effects//grass1 v]\n\nwhen I receive [step2 v]\nstart sound [effects//grass2 v]\n\nwhen I receive [coin collect v]\nstart sound [effects//coin v]\n\nwhen I receive [poof v]\nstart sound [sounds//chime v]\n\nwhen I receive [end load screen v]\nset volume to (100) %\nforever\n    change [bird v] by (pick random (1) to (.5))\n    set [bird v] to ((bird) mod (100))\n    if <([floor v] of (bird) ) = [50]> then\n        if <(pick random (1) to (3)) = [2]> then\n            start sound [effects//chirping v]\n        end\n    end\nend\n\nwhen I receive [player bounce v]\nplay sound [effects//boing v] until done\n\nwhen I receive [jump v]\nplay sound [effects//woosh v] until done\n\nwhen I receive [hup v]\nplay sound [effects//grunt v] until done\n\nwhen flag clicked\nset volume to (0) %\n\nwhen I receive [hurt v]\nplay sound [hurt v] until done\n\nwhen I receive [layering v]\ngo to [front v] layer\ngo [backward v] (item # of [sound] in [array-layers v]) layers\n\n@hurt\n\nwhen I receive [hurt v]\nchange [ghost v] by (-100)\n\nwhen I receive [tick v]\nchange [ghost v] by (((100) - (ghost)) / (10))\nset [ghost v] effect to (ghost)\n\nwhen I receive [layering v]\ngo to [front v] layer\ngo [backward v] (item # of [hurt] in [array-layers v]) layers\n\n@Saw\n\ndefine go to x: (x) y: (y)\ngo to x: (x) y: (y)\nif <<(x position) = (x)> and <(y position) = (y)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [tick v]\nchange [timer v] by (.02)\nif < (ID) contains [clone]?> then\n    go to x: (((scroll x) - (clone x)) * (-1)) y: (((scroll y) - (clone y)) * (-1))\n    point in direction ((90) + (([sin v] of ((timer) * (48)) ) * (180)))\nelse\n    stop [this script v]\nend\n\nwhen I receive [layering v]\ngo to [front v] layer\ngo [backward v] (item # of [Saw] in [array-layers v]) layers\n\ndefine clone (x) (y)\nset [id v] to [clone]\nset [clone x v] to (x)\nset [clone y v] to (y)\ncreate clone of (_myself_ v)\nset [id v] to [sprite]\n\nwhen I receive [start game v]\nclone [1439] [456]\n\n@signs\n\nwhen I receive [tick v]\nif <not < (ID) contains [sprite]?>> then\n    check\n    distance\n    go to x: (((scroll x) - (clone x)) * (-1)) y: (((scroll y) - (clone y)) * (-1))\nelse\n    stop [this script v]\nend\n\ndefine go to x: (x) y: (y)\ngo to x: (x) y: (y)\nif <<(x position) = (x)> and <(y position) = (y)>> then\n    show\nelse\n    hide\nend\n\ndefine clone x: (x) y: (y) ID: (id)\nset [id v] to (id)\nset [clone x v] to (x)\nset [clone y v] to (y)\ncreate clone of (_myself_ v)\nset [id v] to [sprite]\n\nwhen flag clicked\nset [id v] to [sprite]\nhide\n\nwhen I start as a clone\nforever\n    if <key (i v) pressed?> then\n        switch costume to (costume1 v)\n        if <not <touching (effects v)?>> then\n            switch costume to (sign v)\n            if <[120] > (distance to player)> then\n                set [fx x v] to (clone x)\n                set [fx y v] to (clone y)\n                set [notification v] to (ID)\n                broadcast (message v)\n            end\n            wait until <not <key (i v) pressed?>>\n        end\n        switch costume to (sign v)\n    end\nend\n\nwhen I receive [start game v]\nclone x: [417] y: [365] ID: [m1]\nclone x: [736] y: [285] ID: [m2]\nclone x: [1246] y: [663] ID: [m3]\nclone x: [917] y: [498] ID: [m4]\n\nwhen this sprite clicked\nswitch costume to (costume1 v)\nif <not <touching (effects v)?>> then\n    switch costume to (sign v)\n    if <[120] > (distance to player)> then\n        set [fx x v] to (clone x)\n        set [fx y v] to (clone y)\n        set [notification v] to (ID)\n        broadcast (message v)\n    end\nend\nswitch costume to (sign v)\n\ndefine check\nswitch costume to (costume1 v)\nif <touching (effects v)?> then\n    switch costume to (sign2 v)\n    if <(distance to player) > [120]> then\n        set [notification v] to [0]\n    end\nelse\n    switch costume to (sign v)\nend\n\ndefine distance\nchange y by (47)\nset [distance to player v] to (distance to [player v])\nchange y by (-47)\n\nwhen I receive [layering v]\ngo to [front v] layer\ngo [backward v] (item # of [signs] in [array-layers v]) layers\n\n@stamina\n\nwhen I receive [tick v]\nset [climb frame change v] to ((last climb frame) - ([climb frame v] of [player v]))\nset [last climb frame v] to ([climb frame v] of [player v])\nif <(stamina cooldown) > [0]> then\n    change [stamina cooldown v] by (-.1)\nend\nif <(Run/Walk?) = [1]> then\n    if <not <<(state) = [wall slide]> or <(state) = [crouch]>>> then\n        change [stamina v] by (-.05)\n        set [stamina cooldown v] to [2]\n    end\nelse\n    if <(state) = [wall slide]> then\n        set [stamina cooldown v] to [5]\n        if <(climb frame change) < [0]> then\n            change [stamina v] by (-.1)\n        end\n    else\n        if <(stamina cooldown) < [1]> then\n            if <(stamina) < [12]> then\n                change [stamina v] by (.05)\n            end\n        end\n    end\nend\nif <(stamina) < [0]> then\n    set [stamina v] to [0]\nend\n\nwhen I receive [hup v]\nchange [stamina v] by (-4)\n\nwhen I receive [poof v]\nset [stamina v] to [12]\n\nwhen I receive [refill stamina v]\nset [stamina v] to [12]\n\nwhen I receive [layering v]\ngo to [front v] layer\ngo [backward v] (item # of [stamina] in [array-layers v]) layers\n\n@st counter\n\nwhen I start as a clone\nset [ghost v] effect to (100)\nshow\nwait ((ID) / (10)) seconds\nrepeat (5)\n    change [ghost v] effect by (-20)\nend\n\nwhen I start as a clone\ngo to [front v] layer\nforever\n    set [clone lives v] to ((round ([stamina 2 v] of [st counter v])) - ((ID) * (4)))\n    if <[0] > (clone lives)> then\n        set [clone lives v] to [0]\n    end\n    if <(clone lives) > [4]> then\n        set [clone lives v] to [4]\n    end\n    switch costume to (join [-] (round (clone lives)))\n    if <not <(join [-] (round (clone lives))) = (costume [name v])>> then\n        switch costume to (last costume)\n    end\n    if <not <(last costume) = (costume [number v])>> then\n        change [brightness v] by (25)\n        change size by (15)\n    end\n    set [last costume v] to (costume [number v])\n    change size by (((110) - (size)) / (10))\n    set [brightness v] effect to (brightness)\n    change [brightness v] by (((0) - (brightness)) / (5))\nend\n\ndefine lives (amount)\nset [max st counters v] to ((amount) * (4))\ngo to x: (-235) y: (120)\nrepeat (amount)\n    change x by (35)\nend\nset [id v] to ((amount) - (1))\ncreate clone of (_myself_ v)\nrepeat ((amount) - (1))\n    change x by (-35)\n    change [id v] by (-1)\n    create clone of (_myself_ v)\nend\n\nwhen I receive [end load screen v]\nwait (.5) seconds\nlives [3]\n\nwhen I receive [layering v]\ngo to [front v] layer\ngo [backward v] (item # of [st counter] in [array-layers v]) layers\n\nwhen flag clicked\nhide\n\nif <(amount) > [10]> then\n    go to x: (-235) y: (100)\n    repeat ((amount) - (10))\n        change x by (35)\n    end\n    set [id v] to ((amount) - (1))\n    create clone of (_myself_ v)\n    repeat ((amount) - (11))\n        change x by (-35)\n        change [id v] by (-1)\n        create clone of (_myself_ v)\n    end\n    go to x: (-235) y: (150)\n    repeat (11)\n        change x by (35)\n    end\n    repeat (10)\n        change x by (-35)\n        change [id v] by (-1)\n        create clone of (_myself_ v)\n    end\nend\nset [id v] to [sprite]\n\nwhen flag clicked\nforever\n    set stamina ([stamina v] of [stamina v])\n    set [global stamina v] to (round ([stamina v] of [stamina v]))\n    if <<[0] > (global stamina)> or <[0] = (global stamina)>> then\n        repeat until <(round (stamina 2)) = [12]>\n            set stamina ([stamina v] of [stamina v])\n        end\n        set [global stamina v] to (round ([stamina v] of [stamina v]))\n    end\nend\n\ndefine set stamina (#)\nrepeat (100)\n    if <(#) > (stamina 2)> then\n        change [stamina 2 v] by (.01)\n    end\n    if <(#) < (stamina 2)> then\n        change [stamina 2 v] by (-.01)\n    end\nend\n\nwhen I receive [tick v]\nif <not <(round ([stamina v] of [stamina v])) = (global stamina)>> then\n    set [color v] to [90]\nelse\n    set [color v] to ((100) + ((25) * (clone lives)))\nend\nset [color v] effect to (color)\n\n@Effects\n\nwhen I start as a clone\nif <(ID) = [clone dust]> then\n    set rotation style [all around v]\n    hide\n    switch costume to (dust v)\n    set [brightness v] effect to (pick random (0) to (30))\n    set [ghost v] effect to (pick random (50) to (80))\n    point in direction (90)\n    turn left (pick random (0) to (180)) degrees\n    go to x: (((scroll x) - (clone x)) * (-1)) y: (((scroll y) - (clone y)) * (-1))\n    show\n    set size to (pick random (85) to (125)) %\n    repeat (pick random (10) to (25))\n        set [last x v] to (x position)\n        set [last y v] to (y position)\n        move (pick random (1) to (2)) steps\n        change [clone x v] by ((x position) - (last x))\n        change [clone y v] by ((y position) - (last y))\n        change [ghost v] effect by (3)\n    end\n    delete this clone\nend\nif <(ID) = [clone run]> then\n    set [ghost v] effect to (20)\n    set rotation style [left-right v]\n    point in direction ([direction v] of [player v])\n    go to x: (((scroll x) - (clone x)) * (-1)) y: (((scroll y) - (clone y)) * (-1))\n    switch costume to (run 02 v)\n    show\n    repeat (3)\n        wait (.05) seconds\n        next costume\n        change [ghost v] effect by (5)\n    end\n    wait (.05) seconds\n    delete this clone\nend\nif <(ID) = [notification]> then\n    n function <[1] = [1]>\nend\nif <(ID) = [message clone]> then\n    n function <[1] = [0]>\nend\n\nwhen I receive [start game v]\nset [id v] to [sprite]\nhide\nforever\n    wait until <([falling v] of [player v]) > [10]>\n    repeat until <([falling v] of [player v]) = [0]>\n        set [fall speed v] to (round ([speed y v] of [player v]))\n    end\n    set [ghost v] effect to (100)\n    show\n    switch costume to (hitbox v)\n    if <touching (mushrooms v)?> then\n        hide\n    else\n        hide\n        if <([abs v] of (fall speed) ) > [20]> then\n            set [fall speed v] to ((fall speed) + (20))\n            change [lives v] by ((fall speed) / (4))\n        end\n        clone [4]\n    end\nend\n\ndefine clone (amount)\nset [clone x v] to (player x)\nset [clone y v] to ((player y) - (30))\nset [id v] to [clone dust]\nrepeat (amount)\n    create clone of (_myself_ v)\nend\nset [id v] to [sprite]\n\ndefine go to x: (x) y: (y)\ngo to x: (x) y: (y)\nif <<(x position) = (x)> and <(y position) = (y)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [tick v]\nif < (ID) contains [clone]?> then\n    go to x: (((scroll x) - (clone x)) * (-1)) y: (((scroll y) - (clone y)) * (-1))\nelse\n    stop [this script v]\nend\n\ndefine clone run fx\nset [clone x v] to (player x)\nset [clone y v] to ((player y) - (8))\nset [id v] to [clone run]\ncreate clone of (_myself_ v)\nset [id v] to [sprite]\n\nwhen I receive [start game v]\nforever\n    if <(state) = [run]> then\n        clone run fx\n        wait (.2) seconds\n    end\nend\n\nwhen I receive [start game v]\nforever\n    wait until <(state) = [run]>\n    clone [4]\n    wait until <not <(state) = [run]>>\nend\n\nwhen I receive [notification v]\nif <(ID) = [sprite]> then\n    notification (notification) [] [] [notification]\nend\n\ndefine notification (#) (x) (y) (clone?)\nset [clone x v] to (x)\nset [clone y v] to (y)\nswitch costume to (#)\nset [id v] to (clone?)\ncreate clone of (_myself_ v)\nset [id v] to [sprite]\n\nwhen this sprite clicked\nif <(ID) = [notification]> then\n    set [notification v] to [0]\nend\nif <(ID) = [message clone]> then\n    set [notification v] to [0]\nend\n\ndefine n function <clone?>\nhide\nswitch costume to (notification)\nclear graphic effects\nset [ghost v] effect to (100)\nif <clone?> then\n    if < (costume [name v]) contains [s]?> then\n        go to x: (0) y: (120)\n    else\n        go to x: (0) y: (-120)\n    end\nelse\n    go to x: (((scroll x) - (clone x)) * (-1)) y: (((scroll y) - (clone y)) * (-1))\nend\nshow\npoint in direction (90)\nset size to (1) %\nrepeat until <(round (size)) = [100]>\n    change [ghost v] effect by (-5)\n    change size by (((100) - (size)) / (5))\nend\nrepeat until <(round (size)) = [90]>\n    change size by (((90) - (size)) / (5))\nend\nset [ghost v] effect to (0)\nwait until <<not <(notification) = (costume [name v])>> or <key (i v) pressed?>>\nrepeat until <(round (size)) = [100]>\n    change size by (((100) - (size)) / (5))\nend\nrepeat until <(round (size)) = [1]>\n    change [ghost v] effect by (10)\n    change size by (((1) - (size)) / (5))\nend\nset [ghost v] effect to (100)\nhide\ndelete this clone\n\nwhen I receive [message v]\nif <(ID) = [sprite]> then\n    notification (notification) (fx x) ((fx y) + (80)) [message clone]\nend\n\nset [notification v] to [m1]\n\nwhen I receive [layering v]\ngo to [front v] layer\ngo [backward v] (item # of [Effects] in [array-layers v]) layers\n\n@ads\n\ndefine glide y, effect, speed, shine, size (y) (effect) (speed) (shine) (size)\nrepeat until <(round (y position)) = (y)>\n    change y by (((y) - (y position)) / (speed))\n    change [ghost v] effect by (effect)\n    change [brightness v] effect by (shine)\n    change size by (size)\nend\n\nwhen flag clicked\nswitch costume to (g1 v)\nset size to (70) %\ngo to x: (150) y: (160)\nforever\n    set [ghost v] effect to (100)\n    wait (8) seconds\n    next costume\n    glide y, effect, speed, shine, size [100] [-10] [10] [0] [0]\n    wait (2) seconds\n    glide y, effect, speed, shine, size [160] [10] [10] [0] [0]\nend\n\nwhen I receive [layering v]\ngo to [front v] layer\ngo [backward v] (item # of [ads] in [array-layers v]) layers\n\n