Simple Platformer Editor
@Stage\n\nwhen flag clicked\nforever\n    change [fpscounter v] by (1)\nend\n\nwhen flag clicked\nforever\n    wait (1) seconds\n    set [fps v] to (FPScounter)\n    if <(FPS) < [25]> then\n        set [fps v] to [25]\n    end\n    set [fpscounter v] to [0]\n    set [fpsmult v] to ((FPS) / (32))\n    set [fpsdivide v] to ((32) / (FPS))\nend\n\nwhen flag clicked\nset volume to (25) %\n\nwhen [m v] key pressed\nif <(volume) > [10]> then\n    set volume to (0) %\nelse\n    set volume to (25) %\nend\n\nwhen flag clicked\n\nforever\n    wait (pick random (25) to (50)) seconds\n    play sound (pick random (1) to (2)) until done\nend\n\n@Sprite1\n\ndefine Get all text between (╪) from (input)\ndelete all of [startpos v]\ndelete all of [comments v]\nset [num v] to [0]\nset [toggle v] to [0]\nset [out v] to []\nrepeat (length of (input))\n    change [num v] by (1)\n    if <(letter (num) of (input)) = (╪)> then\n        set [toggle v] to ([abs v] of ((toggle) - (1)) )\n        if <(toggle) = [1]> then\n            if <not <(letter ((num) + (1)) of (input)) = [ ]>> then\n                add (num) to [startpos v]\n            end\n        end\n    end\n    if <(letter (num) of (input)) = [ ]> then\n        set [toggle v] to [0]\n    end\n    if <(toggle) = [1]> then\n        if <not <(letter (num) of (input)) = (╪)>> then\n            set [out v] to (join (out) (letter (num) of (input)))\n        end\n    else\n        if <not <(out) = []>> then\n            add (out) to [comments v]\n            set [out v] to []\n        end\n    end\nend\n\ndefine Get user (start) in (input)\nset [num v] to (start)\nset [spaces v] to [0]\nset [out v] to []\nrepeat until <(spaces) > [2]>\n    change [num v] by (-1)\n    if <(letter (num) of (input)) = [ ]> then\n        change [spaces v] by (1)\n    end\nend\nchange [num v] by (1)\nrepeat until <(letter (num) of (input)) = [ ]>\n    set [out v] to (join (out) (letter (num) of (input)))\n    change [num v] by (1)\nend\n\ndefine Users (in)\ndelete all of [users v]\nset [num2 v] to [0]\nrepeat (length of [startpos v])\n    change [num2 v] by (1)\n    Get user (item (num2) of [startpos v]) in (in)\n    add (out) to [users v]\nend\n\nwhen [f v] key pressed\nask [] and wait\nGet all text between [╪] from (answer)\nUsers (answer)\n\n@Sprite2\n\ndefine Make Grid (x) (y) & size (size)\ndelete all of [level v]\nset [width v] to (x)\nset [height v] to (y)\nset [gridsize v] to (size)\nset [clonenumber v] to [0]\nset y to ((height) * ((gridsize) * (0.5)))\nchange y by ((gridsize) * (-0.5))\nrepeat (height)\n    set x to ((width) * ((gridsize) * (-0.5)))\n    change x by ((gridsize) * (-0.5))\n    repeat (width)\n        change x by (gridsize)\n        change [clonenumber v] by (1)\n        create clone of (_myself_ v)\n        add [ ] to [level v]\n    end\n    change y by ((gridsize) * (-1))\nend\nset [clonenumber v] to [-1]\n\nchange [clonenumber v] by (1)\n\nwhen I start as a clone\nhide\ndelete all of [gridcells v]\nrepeat (4)\n    add [0] to [gridcells v]\nend\nswitch costume to (join (item (1) of [gridcells v]) (join (item (2) of [gridcells v]) (join (item (3) of [gridcells v]) (item (4) of [gridcells v]))))\nwait (0.2) seconds\nshow\nforever\n    switch costume to (join (item (1) of [gridcells v]) (join (item (2) of [gridcells v]) (join (item (3) of [gridcells v]) (item (4) of [gridcells v]))))\n    set size to ((gridsize) * (100)) %\n    if <<(Playing) = [0]> and <(Uneditable) = [0]>> then\n        if <mouse down?> then\n            Replace [1] [8]\n        end\n        if <key (r v) pressed?> then\n            Replace [0] [12]\n        end\n    end\n    set [ghost v] effect to (0)\n    if <<(Playing) = [0]> and <key (q v) pressed?>> then\n        set [ghost v] effect to (25)\n    end\nend\n\nwhen flag clicked\nset [clonenumber v] to [-1]\nhide\nswitch costume to (0110 v)\n\ndefine Replace (replacewith) (dist)\nset [distcheck v] to (dist)\nset [x v] to (x position)\nset [y v] to (y position)\nChange [-1] [1] id [1] replace (replacewith)\nif <(distance to [mouse-pointer v]) < (distCheck)> then\n    replace item (1) of [gridcells v] with (replacewith)\nend\ngo to x: (x) y: (y)\nChange [1] [1] id [2] replace (replacewith)\nif <(distance to [mouse-pointer v]) < (distCheck)> then\n    replace item (2) of [gridcells v] with (replacewith)\nend\ngo to x: (x) y: (y)\nChange [-1] [-1] id [3] replace (replacewith)\nif <(distance to [mouse-pointer v]) < (distCheck)> then\n    replace item (3) of [gridcells v] with (replacewith)\nend\ngo to x: (x) y: (y)\nChange [1] [-1] id [4] replace (replacewith)\nif <(distance to [mouse-pointer v]) < (distCheck)> then\n    replace item (4) of [gridcells v] with (replacewith)\nend\ngo to x: (x) y: (y)\n\ndefine Change (x) (y) id (id) replace (replace)\nchange x by ((gridsize) / ((x) * (4)))\nchange y by ((gridsize) / ((y) * (4)))\nif <(distance to [mouse-pointer v]) < (distCheck)> then\n    if <not <(item (id) of [gridcells v]) = (replace)>> then\n        add [2] to [particlecount v]\n        add [0] to [particletype v]\n        add (y position) to [particley v]\n        add (x position) to [particlex v]\n    end\nend\n\nwhen I receive [getcode v]\nif <(cloneNumber) > [-1]> then\n    replace item (cloneNumber) of [level v] with (item (costume [number v]) of [letters v])\nend\n\ndefine Encode\nset [num v] to [0]\nset [output v] to []\nset [space v] to [0]\nrepeat (length of [level v])\n    change [num v] by (1)\n    if <(item (num) of [level v]) = [f]> then\n        change [space v] by (1)\n        if <(space) = (length of [amounts v])> then\n            set [output v] to (join (Output) (item (space) of [amounts v]))\n            set [space v] to [0]\n        end\n    else\n        if <(space) > [0]> then\n            set [output v] to (join (Output) (item (space) of [amounts v]))\n        end\n        set [space v] to [0]\n        set [output v] to (join (Output) (item (num) of [level v]))\n    end\nend\nset [output v] to (join (Output) [╪])\nset [output v] to (join [╪] (Output))\ndelete all of [out v]\nadd (Output) to [out v]\n\ndefine Load (input)\ndelete all of [decode v]\nset [in v] to (input)\nset [in2 v] to [0]\nset [num v] to [0]\nif <(letter (1) of (input)) = [╪]> then\n    set [in2 v] to (input)\n    set [num v] to [0]\n    repeat (length of (in2))\n        change [num v] by (1)\n        add (letter (num) of (in2)) to [decode v]\n    end\n    delete (1) of [decode v]\n    delete (length of [decode v]) of [decode v]\n    set [num v] to [0]\n    set [in v] to []\n    repeat (length of [decode v])\n        change [num v] by (1)\n        set [in v] to (join (in) (item (num) of [decode v]))\n    end\n    delete all of [decode v]\nend\nset [num v] to [0]\nrepeat (length of (in))\n    change [num v] by (1)\n    if <[amounts v] contains (letter (num) of (in))?> then\n        repeat (item # of (letter (num) of (in)) in [amounts v])\n            add [f] to [decode v]\n        end\n    else\n        add (letter (num) of (in)) to [decode v]\n    end\nend\nset [num v] to [0]\nrepeat (length of [decode v])\n    change [num v] by (1)\n    switch costume to (item # of (item (num) of [decode v]) in [letters v])\n    replace item (num) of [decode v] with (costume [name v])\nend\n\nwhen I receive [applycode v]\nif <(cloneNumber) > [-1]> then\n    replace item (1) of [gridcells v] with (letter (1) of (item (cloneNumber) of [decode v]))\n    replace item (2) of [gridcells v] with (letter (2) of (item (cloneNumber) of [decode v]))\n    replace item (3) of [gridcells v] with (letter (3) of (item (cloneNumber) of [decode v]))\n    replace item (4) of [gridcells v] with (letter (4) of (item (cloneNumber) of [decode v]))\nend\n\nif <(space) > [0]> then\n    set [output v] to (join (Output) (item (space) of [amounts v]))\nend\n\nwhen I receive [loadlevel v]\nif <(cloneNumber) = [-1]> then\n    if <(Selection) = [-2]> then\n        Make Grid [18] [14] & size [25]\n        ask [Insert Code] and wait\n        Load (answer)\n        broadcast (ApplyCode v)\n        wait (1) seconds\n        broadcast (ShowControls v)\n    else\n        if <(Selection) = [-1]> then\n            Make Grid [18] [14] & size [25]\n            broadcast (ShowControls v)\n        else\n            Make Grid [18] [14] & size [25]\n            wait (0.3) seconds\n            Load (item (Selection) of [comments v])\n            broadcast (ApplyCode v)\n            wait (0.3) seconds\n            broadcast (ShowControls v)\n            set [playing v] to [1]\n        end\n    end\nend\n\nwait (0.5) seconds\n\nwhen [space v] key pressed\nif <<(cloneNumber) = [-1]> and <(Playing) = [0]>> then\n    set [uneditable v] to [1]\n    broadcast (GetCode v)\n    wait (0.1) seconds\n    Encode\n    hide list [out v]\n    wait (1) seconds\n    wait until <mouse down?>\n    show list [out v]\n    wait (0.1) seconds\n    set [uneditable v] to [0]\nend\n\nwhen flag clicked\nshow list [out v]\n\nwhen flag clicked\nset [uneditable v] to [0]\n\nwhen I start as a clone\nwait (0.5) seconds\nset [oldcostume v] to (costume [name v])\nforever\n    if <not <(OldCostume) = (costume [name v])>> then\n        set [oldcostume v] to (costume [name v])\n        if <key (r v) pressed?> then\n            start sound [pop2 v]\n        else\n            if <mouse down?> then\n                start sound [pop v]\n            end\n        end\n    end\nend\n\nwhen I receive [backtostart v]\ndelete this clone\n\nbroadcast (BackToStart v)\n\n@Text\n\nwhen flag clicked\nbroadcast (BackToStart v)\n\nerase all\n\ndefine Write (write) at (x)\nset [ylevel v] to (((((num) - (1)) * (-50)) + (120)) + ((SmoothScroll) * (-30)))\nset [i v] to [0]\nswitch costume to (bigtm v)\ngo to x: (x) y: (YLevel)\nset [ghost v] effect to (0)\nset [brightness v] effect to (99999)\nif <<([abs v] of ((mouse y) - (y position)) ) < [25]> and <not <(letter (length of (write)) of (write)) = [_]>>> then\n    change x by (2)\n    if <mouse down?> then\n        set [selection v] to (num)\n        if <(Special) < [0]> then\n            set [selection v] to (Special)\n        end\n        broadcast (LoadLevel v)\n        start sound [Pop v]\n    end\nend\nrepeat (length of (write))\n    change [i v] by (1)\n    switch costume to (bigtm v)\n    change x by (10)\n    switch costume to (letter (i) of (write))\n    stamp\nend\nif <<not <(Special) < [0]>> and <not <(letter (length of (write)) of (write)) = [_]>>> then\n    add (x position) to [xs v]\nend\n\ndefine List\nset [num v] to [0]\nset [special v] to [0]\nrepeat (length of [comments v])\n    change [num v] by (1)\n    Write (join [○ ] (join (item (num) of [users v]) ['s level])) at [-200]\nend\nchange [num v] by (1)\nWrite [_________] at [-200]\nchange [num v] by (1)\nset [special v] to [-1]\nWrite [♣ New Level] at [-200]\nchange [num v] by (1)\nset [special v] to [-2]\nWrite [♠ Load Level] at [-200]\n\nwhen [up arrow v] key pressed\nchange [scrolly v] by (1)\n\nwhen [down arrow v] key pressed\nchange [scrolly v] by (-1)\n\nwhen I receive [loadlevel v]\nerase all\nstop [other scripts in sprite v]\n\nwhen I receive [renderlevels v]\ndelete all of [xs v]\nList\nchange [smoothscroll v] by (((ScrollY) - (SmoothScroll)) / ((4) * (FPSmult)))\n\nwhen I receive [backtostart v]\nstop [other scripts in sprite v]\nset [scrolly v] to [0]\nset [smoothscroll v] to [0]\nforever\n    broadcast (RenderLevels v)\nend\n\n@Sprite3Sprite4\n\nwhen I receive [showcontrols v]\nerase all\ngo to x: (0) y: (0)\nswitch costume to (p v)\nrepeat (5)\n    set [key v] to (costume [name v])\n    next costume\n    create clone of (_myself_ v)\n    change y by (-25)\nend\nforever\n    if <key (b v) pressed?> then\n        broadcast (BackToStart v)\n        stop [this script v]\n    end\nend\n\nwhen I start as a clone\nshow\nforever\n    go to [front v] layer\n    set [ghost v] effect to (50)\n    set [brightness v] effect to (50)\n    switch costume to (Key)\n    if <<(Key) = [p]> and <(Playing) = [1]>> then\n        switch costume to (p2 v)\n        set [ghost v] effect to (0)\n        set [brightness v] effect to (80)\n    end\n    if <key ((Key) v) pressed?> then\n        clear graphic effects\n        set [brightness v] effect to (9999)\n    end\n    if <<<(Key) = [r]> or <(Key) = [space]>> and <(Playing) = [1]>> then\n        hide\n    else\n        show\n    end\n    if <<(Key) = [q]> and <(Playing) = [1]>> then\n        hide\n    else\n        if <(Key) = [q]> then\n            if <(Trail?) = [0]> then\n                hide\n            else\n                show\n            end\n        end\n    end\n    if <(Key) = [b]> then\n        go to x: (180) y: (-150)\n    end\nend\n\nwhen I receive [backtostart v]\nset [trail? v] to [0]\nhide\nset [playing v] to [0]\nwait (0.1) seconds\nstop [other scripts in sprite v]\nforever\n    if <<key (p v) pressed?> or <key (t v) pressed?>> then\n        set [playing v] to ([abs v] of ((Playing) - (1)) )\n        start sound [Pop v]\n        if <(Playing) = [1]> then\n            erase all\n        end\n    end\n    wait until <not <<key (p v) pressed?> or <key (t v) pressed?>>>\nend\n\nwhen I receive [backtostart v]\ndelete this clone\n\nwait until <not <<key (p v) pressed?> or <key (t v) pressed?>>>\n\n@Player\n\nwhen I receive [showcontrols v]\nshow\nset [gravity v] to [0]\nforever\n    if <(Playing) = [1]> then\n        show\n        go to [front v] layer\n        go [backward v] (1) layers\n        set [ghost v] effect to (0)\n        Ground\n        set size to (100) %\n        Move ((Xac) * (FPSdivide))\n        if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n            change [xac v] by ((FPSdivide) * (1.5))\n        end\n        if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n            change [xac v] by ((FPSdivide) * (-1.5))\n        end\n        change [xac v] by (((0) - (Xac)) / ((FPSmult) * (4)))\n        if <(y position) < [-170]> then\n            go to x: (-174) y: (-76)\n            set [gravity v] to [0]\n            set [xac v] to [0]\n            start sound [Pop v]\n        end\n        set pen color to (#7d7d7d)\n        set pen size to (2)\n        if <touching (sprite2 v)?> then\n            pen down\n            pen up\n        end\n        set [trail? v] to [1]\n        change [leftground v] by (1)\n        change [jumptimer v] by (1)\n        if <<<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <key (space v) pressed?>> or <key (z v) pressed?>> then\n            if <(LeftGround) < [7]> then\n                set [leftground v] to [9999]\n                set [gravity v] to ((((FPSdivide) + (1)) / (2)) * (9))\n                start sound [pop2 v]\n                add (x position) to [particlex v]\n                add [2] to [particletype v]\n                add (y position) to [particley v]\n                add [3] to [particlecount v]\n            else\n                set [jumptimer v] to [0]\n            end\n        end\n        if <<(gravity) > [3]> and <not <<<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <key (space v) pressed?>> or <key (z v) pressed?>>>> then\n            change [gravity v] by ((FPSdivide) * (-2))\n        end\n    else\n        go to x: (-174) y: (-76)\n        set [ghost v] effect to (50)\n        set [gravity v] to [0]\n        set [xac v] to [0]\n        set [sliding? v] to [0]\n        set [leftground v] to [9999]\n    end\nend\n\ndefine Ground\nchange [gravity v] by ((FPSdivide) * (-0.7))\nchange y by (gravity)\nif <(gravity) > [0]> then\n    repeat until <not <touching color (#ffffff)?>>\n        change y by (-1)\n        set [gravity v] to [0]\n        set [sliding? v] to ([abs v] of (Xac) )\n    end\nelse\n    repeat until <not <touching color (#ffffff)?>>\n        if <(gravity) < [-8]> then\n            start sound [pop3 v]\n            add (x position) to [particlex v]\n            add [2] to [particletype v]\n            add (y position) to [particley v]\n            add [3] to [particlecount v]\n        end\n        change y by (1)\n        set [gravity v] to [0]\n        set [leftground v] to [0]\n        if <(jumptimer) < [3]> then\n            set [leftground v] to [9999]\n            set [gravity v] to ((((FPSdivide) + (1)) / (2)) * (9))\n            start sound [pop2 v]\n            set [leftground v] to [9999]\n            add (x position) to [particlex v]\n            add [2] to [particletype v]\n            add (y position) to [particley v]\n            add [3] to [particlecount v]\n        end\n    end\nend\nchange y by (-5)\nset [sliding? v] to [0]\nif <touching color (#ffffff)?> then\n    set [sliding? v] to ([abs v] of (Xac) )\n    if <([abs v] of (Xac) ) > [0.2]> then\n        add (x position) to [particlex v]\n        add [1] to [particletype v]\n        add (y position) to [particley v]\n        add [1] to [particlecount v]\n    end\nend\nchange y by (5)\n\ndefine Move (x)\nchange x by (x)\nset [slope v] to [0]\nrepeat until <<not <touching color (#ffffff)?>> or <(slope) = [8]>>\n    change y by (1)\n    change [slope v] by (1)\nend\nif <(slope) = [8]> then\n    change y by ((slope) * (-1))\n    change x by ((x) * (-1))\n    set [xac v] to [0]\nend\n\nif <(Selection) > [0]> then\n\nwhen I receive [backtostart v]\nset [sliding? v] to [0]\nstop [other scripts in sprite v]\nhide\ngo to x: (-174) y: (-76)\n\nbroadcast (BackToStart v)\n\n@Sprite3\n\nwhen flag clicked\nforever\n    start sound [Sliding v]\n    wait (1) seconds\n    start sound [Sliding2 v]\n    wait (1) seconds\n    start sound [Sliding3 v]\n    wait (1) seconds\n    start sound [Sliding4 v]\n    wait (1) seconds\nend\n\nwhen flag clicked\nforever\n    set volume to ((Sliding?) * (25)) %\nend\n\n@Sprite4\n\nwhen I receive [loadlevel v]\nforever\n    show\n    if <key (q v) pressed?> then\n        hide\n    end\n    go to [back v] layer\nend\n\nwhen I receive [backtostart v]\nstop [other scripts in sprite v]\nhide\n\nbroadcast (BackToStart v)\n\n@Level Previews\n\ndefine Render (lvl)\nset [x v] to (x position)\nset [y v] to (y position)\nset [level v] to (lvl)\nset [num v] to [0]\ndelete all of [renderdec v]\nrepeat (length of (Level))\n    change [num v] by (1)\n    if <[amounts v] contains (letter (num) of (Level))?> then\n        repeat (item # of (letter (num) of (Level)) in [amounts v])\n            add [f] to [renderdec v]\n        end\n    else\n        add (letter (num) of (Level)) to [renderdec v]\n    end\nend\nset [width v] to ([width v] of [sprite2 v])\nset [height v] to ([height v] of [sprite2 v])\nset [num v] to [0]\nset y to (y)\nset pen size to (5)\nrepeat ((height) - (1))\n    switch costume to (costume1 v)\n    set x to (x)\n    change y by (-3)\n    repeat (width)\n        change x by (3)\n        change [num v] by (1)\n        if <not <(item (num) of [renderdec v]) = [f]>> then\n            set pen color to (#ffffff)\n            switch costume to (costume2 v)\n            if <(item (num) of [renderdec v]) = [a]> then\n                switch costume to (costume4 v)\n            end\n        else\n            set pen color to (#1f1f1f)\n            switch costume to (costume3 v)\n        end\n        stamp\n        switch costume to (costume1 v)\n    end\nend\n\nwhen I receive [renderlevels v]\nerase all\nList\n\ndefine List\nset [i v] to [0]\nrepeat (length of [xs v])\n    change [i v] by (1)\n    set [ylevel v] to (((((i) - (1)) * (-50)) + (120)) + ((SmoothScroll) * (-30)))\n    go to x: (120) y: (YLevel)\n    change y by (25)\n    Render (item (i) of [comments v])\nend\n\nwhen flag clicked\nhide\n\npen down\npen up\n\nif <<<<(item # of (item (num) of [renderdec v]) in [letters v]) = [16]> or <(item # of (item (num) of [renderdec v]) in [letters v]) = [15]>> or <(item # of (item (num) of [renderdec v]) in [letters v]) = [14]>> or <(item # of (item (num) of [renderdec v]) in [letters v]) = [2]>> then\n    switch costume to (costume3 v)\nend\n\n@Jingle\n\nwhen I receive [playnote v]\nchange [note v] by (pick random (1) to (3))\nif <(Note) > [22]> then\n    set [note v] to [1]\nend\nstart sound (join [Note] (Note))\nbroadcast (Note2 v)\n\nwhen flag clicked\nset volume to (40) %\nforever\n    if <<<(Uneditable) = [0]> and <mouse down?>> and <<(Playing) = [0]> and <(Loaded) = [1]>>> then\n        broadcast (PlayNote v)\n    end\n    wait until <not <mouse down?>>\nend\n\nwhen flag clicked\nforever\n    set [pitch v] effect to (0)\nend\n\nwhen I receive [loadlevel v]\nset [loaded v] to [1]\n\nwhen I receive [backtostart v]\nset [loaded v] to [0]\n\n@Hum\n\nwhen flag clicked\nforever\n    start sound [PlatformerHumm v]\n    wait (6) seconds\n    start sound [PlatformerHumm2 v]\n    wait (6) seconds\n    start sound [PlatformerHumm3 v]\n    wait (6) seconds\nend\n\nset volume to (100) %\n\nwhen flag clicked\nforever\n    change volume by (((((25) + ((([abs v] of ((Playing) - (1)) ) * (((Loaded) / (2)) + (0.5))) * (75))) / (3)) - (volume)) / (5))\nend\n\n@Sprite6\n\nwhen flag clicked\nforever\n    go to [front v] layer\n    set [ghost v] effect to (100)\nend\n\n@Sprite7\n\nwhen flag clicked\nforever\n    set [ghost v] effect to (50)\nend\n\nwhen I receive [loadlevel v]\nhide\n\nwhen I receive [backtostart v]\nshow\n\n@Echo\n\nwhen I receive [note2 v]\nif <(clonetype) = [0]> then\n    set [note v] to ([note v] of [jingle v])\n    create clone of (_myself_ v)\nend\n\nwhen flag clicked\nforever\n    set [clonetype v] to [0]\nend\n\nwhen I start as a clone\nset volume to (25) %\nset [clonetype v] to [1]\nrepeat (2)\n    wait (2) seconds\n    start sound (join [Note] (Note))\n    change volume by (((0) - (volume)) / (1.5))\nend\ndelete this clone\n\n@Sprite5\n\nwhen flag clicked\nwait (0.1) seconds\nforever\n    start sound [PlatformerDrums v]\n    wait (4) seconds\n    start sound [PlatformerDrums2 v]\n    wait (4) seconds\n    start sound [PlatformerDrums3 v]\n    wait (4) seconds\nend\n\nwhen flag clicked\nforever\n    change volume by ((((Playing) * (50)) - (volume)) / (5))\nend\n\n@Particles\n\ndefine Particles\nrepeat until <<(length of [particley v]) = [0]> and <(length of [particlex v]) = [0]>>\n    set [clonetype v] to (item (1) of [particletype v])\n    go to x: (item (1) of [particlex v]) y: (item (1) of [particley v])\n    repeat (item (1) of [particlecount v])\n        create clone of (_myself_ v)\n    end\n    delete (1) of [particley v]\n    delete (1) of [particlex v]\n    delete (1) of [particletype v]\n    delete (1) of [particlecount v]\nend\n\nwhen flag clicked\nforever\n    hide\n    Particles\nend\n\nwhen I start as a clone\nif <(CloneType) = [0]> then\n    switch costume to (costume1 v)\n    show\n    set size to (pick random (50) to (150)) %\n    set [g v] to (pick random (1) to (10))\n    point in direction (pick random (0) to (360))\n    repeat (10)\n        move (g) steps\n        change [g v] by (((0) - (g)) / (5))\n        change [ghost v] effect by (10)\n    end\n    delete this clone\nend\nif <(CloneType) = [1]> then\n    change y by (-3)\n    switch costume to (costume2 v)\n    show\n    set size to (pick random (150) to (500)) %\n    set [g v] to (round (Sliding?))\n    set [ghost v] effect to (50)\n    point in direction (pick random (0) to (360))\n    repeat (10)\n        move ((g) / (2)) steps\n        change [g v] by (((0) - (g)) / (4))\n        change [ghost v] effect by (5)\n        change size by (10)\n    end\n    delete this clone\nend\nif <(CloneType) = [2]> then\n    change y by (-3)\n    switch costume to (costume2 v)\n    show\n    set size to (pick random (500) to (3000)) %\n    set [g v] to [3]\n    set [ghost v] effect to (90)\n    point in direction (pick random (0) to (360))\n    repeat (25)\n        move ((g) / (3)) steps\n        change y by (g)\n        change [g v] by (((0) - (g)) / (15))\n        change [ghost v] effect by (0.5)\n        change size by (10)\n    end\n    delete this clone\nend\n\nif <(item (1) of [particletype v]) = [3]> then\n    repeat (3)\n        create clone of (_myself_ v)\n    end\nend\n\n@Menu Music\n\nwhen flag clicked\nforever\n    start sound [PlatformerJingle v]\n    wait (16) seconds\n    start sound [PlatformerJingle2 v]\n    wait (16) seconds\n    start sound [PlatformerJingle3 v]\n    wait (16) seconds\nend\n\nwhen flag clicked\nforever\n    change volume by (((([abs v] of ((Loaded) - (1)) ) * (80)) - (volume)) / (5))\nend\n\n