Duck Platformer

Instructions: Edit: Thanks for giving this project so much attention. I'm really grateful! -Duckie\n\n\n▶️ Move with WASD or Arrow Keys. Press space to dash. Run towards a wall to wall jump! \n\nYESS FINALLY I FIXED IT!!! You can finally jump on the green platforms. The hitboxes for the duck are pretty wild, expect minor bugs!\n\n@NORMANTHEGAMER VIEWED + LOVED! (check the cloud variables to see that he viewed)\n\nComment QUACK!\n\nClick the duck for a surprise :D\n\n❤️ + ⭐ if you liked this game!\nFollow me for more games!\n\nMore Controls:\nPress Q + R to reset\n\nTry to get 3 stars! You have to collect all coins, blue coins, and beat the platformer in less than 50 seconds.\n\n▶️ Credits\nInspired by @Animator180\nOriginal by @Normanthegamer\n\nMusic:\nTobu - Candyland\n\n#games #all #art #music

@Stage\n\nwhen I receive [tick v]\ndelete all of [data v]\nadd (join [mouse x: ] (round ((SCROLL X) + (mouse x)))) to [data v]\nadd (join [mouse y: ] (round ((SCROLL Y) + (mouse y)))) to [data v]\nadd (join [x: ] (round ([x v] of [player v]))) to [data v]\nadd (join [y: ] (round ([y v] of [player v]))) to [data v]\n\nwhen flag clicked\nshow list [data v]\nforever\n    wait until <not <key (e v) pressed?>>\n    wait until <key (e v) pressed?>\n    hide list [data v]\n    wait until <not <key (e v) pressed?>>\n    wait until <key (e v) pressed?>\n    show list [data v]\nend\n\nwhen flag clicked\nset [fly v] to [0]\nset [infinite timer v] to [0]\nif <<(username) = [NormanTheGamer]> or <(username) = [-DuckieGames-]>> then\n    if <(username) = [NormanTheGamer]> then\n        set [☁ norman viewed? v] to [1]\n    end\n    forever\n        if <key (f v) pressed?> then\n            set [fly v] to ((1) - (Fly))\n            wait until <not <key (f v) pressed?>>\n        end\n    end\nend\n\nwhen I receive [tick v]\nchange [infinite timer v] by (1)\n\n@Blank\n\nwhen flag clicked\nif <(first time) = [0]> then\n    broadcast (Reset All Data v)\n    set [first time v] to [1]\nend\n\nset [first time v] to [0]\n\nwhen I receive [reset all data v]\nset [__personal record v] to [99999]\n\n@Player\n\nwhen I receive [grenn flag v]\nhide\n\nwhen I receive [play game v]\nset [level v] to [1]\nforever\n    broadcast (Reset v) and wait\n    broadcast (Set up v) and wait\n    Game On\n    set [_move v] to [1]\n    repeat until <(EXIT) > []>\n        Tick\n        broadcast (Tick v) and wait\n        if <<key (q v) pressed?> and <key (r v) pressed?>> then\n            set [exit v] to [reset]\n        end\n    end\n    if <(EXIT) = [Win]> then\n        broadcast (Win v)\n        stop [this script v]\n    else\n        if <(EXIT) = [reset]> then\n            broadcast (Timer v)\n        else\n            Death\n        end\n    end\nend\n\ndefine Game On\nif <(Checkpoint) = [1]> then\n    set [x v] to [4026]\n    set [y v] to [-100]\nelse\n    set [x v] to [-180]\n    set [y v] to [-80]\nend\nset [scroll x v] to (SCROLL X)\nset [scroll y v] to [0]\nset [sx v] to [0]\nset [sy v] to [0]\nset [in air v] to [0]\nset [exit v] to []\nset [dash ability v] to [0]\nset [resistance v] to [0]\nset volume to (100) %\npoint in direction (90)\nset size to (65) %\nclear graphic effects\nshow\n\ndefine Tick\nControls\nswitch costume to (1 v)\nif <(Fly) = [1]> then\n    set [sx v] to (((-right) - (-left)) * (10))\n    set [sy v] to ((<<key (up arrow v) pressed?> or <key (w v) pressed?>> - <<key (down arrow v) pressed?> or <key (s v) pressed?>>) * (10))\n    if <(-space) > [0]> then\n        set [sx v] to ((sx) * (3))\n        set [sy v] to ((sy) * (3))\n    end\nelse\n    if <(resistance) = [0]> then\n        if <not <<(dash ability) > [1]> and <(dash ability) < [6]>>> then\n            if <(-right) = [1]> then\n                change [sx v] by (2.1)\n                point in direction (90)\n            end\n            if <(-left) = [1]> then\n                change [sx v] by (-2.1)\n                point in direction (-90)\n            end\n            set [sx v] to ((sx) * (0.8))\n        end\n    else\n        if <(sx) > [0]> then\n            point in direction (90)\n        else\n            point in direction (-90)\n        end\n    end\nend\nif <([abs v] of (sx) ) > [0.9]> then\n    Change Player x by (round (sx))\nend\nif <(-up) > [0]> then\n    if <(in air) < [1]> then\n        set [sy v] to [18]\n    end\n    if <(in air) < [1]> then\n        start sound [Roblox New Jumping Sound Effect v]\n    end\nend\nif <<(sy) > [-20]> and <<(Fly) = [0]> and <(_move) = [1]>>> then\n    change [sy v] by (-1.5)\nend\nChange player y by (sy)\nPosition\nTest - Die\nset [scroll x v] to (x)\nset [scroll y v] to (y)\nif <(SCROLL X) < [0]> then\n    set [scroll x v] to [0]\nend\nif <(SCROLL X) > [6720]> then\n    set [scroll x v] to [6720]\nend\nif <(SCROLL Y) < [0]> then\n    set [scroll y v] to [0]\nend\nif <(x) < [-240]> then\n    set [x v] to [-240]\nend\nif <(x) > [6960]> then\n    set [x v] to [6960]\nend\nif <(y) < [-181]> then\n    set [y v] to [-181]\nend\nset rotation style [left-right v]\nPosition\nif <<<(y) < [-180]> or <touching (danger v)?>> and <(Fly) = [0]>> then\n    set [exit v] to [Die]\nend\nif <<(-space) > [0]> and <<(dash ability) = [0]> and <(Fly) = [0]>>> then\n    set [dash ability v] to [1]\n    set [dash v] to (<(in air) > [0]> + ())\n    start sound [High Whoosh v]\n    set [brightness v] effect to (100)\nend\nif <<(dash ability) > [1]> and <(dash ability) < [6]>> then\n    set [sx v] to ((direction) / (3))\n    if <(dash) = [1]> then\n        set [sy v] to [0]\n    end\nend\nif <(dash ability) > [0]> then\n    change [dash ability v] by (1)\n    if <(dash ability) < [12]> then\n        change [brightness v] effect by (-10)\n        if <((dash ability) mod (2)) = [1]> then\n            create clone of (trail v)\n        end\n    else\n        set [brightness v] effect to (-10)\n    end\n    if <(dash ability) > [30]> then\n        set [dash ability v] to [0]\n    end\nelse\n    set [brightness v] effect to (0)\nend\nif <(resistance) > [0]> then\n    change [resistance v] by (1)\n    if <(resistance) > [10]> then\n        set [resistance v] to [0]\n    end\nend\nAnimate\n\ndefine Change player y by (sy)\nchange [y v] by (sy)\nchange [in air v] by (1)\nPosition\nrepeat until <not <<touching (level v)?> or <touching (semisolids v)?>>>\n    if <(sy) > [0]> then\n        change [y v] by (-1)\n    else\n        change [y v] by (1)\n        set [in air v] to [0]\n    end\n    Position\n    set [sy v] to ((sy) * (0.9))\nend\n\ndefine Position\ngo to x: ((x) - (SCROLL X)) y: ((y) - (SCROLL Y))\n\ndefine Change Player x by (sx)\nchange [x v] by (sx)\nPosition\nif <<touching (level v)?> or <touching (semisolids v)?>> then\n    repeat (12)\n        change [y v] by (1)\n        Position\n        if <not <<touching (level v)?> or <touching (semisolids v)?>>> then\n            stop [this script v]\n        end\n    end\n    change [y v] by (-12)\n    if <<(-up) = [1]> and <<(in air) > [5]> and <<([abs v] of (sx) ) > [7]> and <not <<(dash ability) > [1]> and <(dash ability) < [6]>>>>>> then\n        set [sx v] to ((direction) / (-12))\n        set [resistance v] to [1]\n        set [sy v] to [17]\n        start sound [Roblox New Jumping Sound Effect v]\n    end\n    repeat until <not <<touching (level v)?> or <touching (semisolids v)?>>>\n        if <(sx) > [0]> then\n            change [x v] by (-1)\n        else\n            change [x v] by (1)\n        end\n        Position\n    end\nend\n\ndefine Test - Die\nif <touching (lava v)?> then\n    set [exit v] to [Die]\nend\n\ndefine Animate\nif <(in air) > [0]> then\n    if <(sy) > [0]> then\n        switch costume to (run_j1 v)\n    else\n        switch costume to (run_j2 v)\n    end\nelse\n    if <([abs v] of (sx) ) > [0.2]> then\n        switch costume to ((([floor v] of (((Infinite Timer) / (30)) * (15)) ) mod (13)) + (5))\n    else\n        switch costume to (2 v)\n    end\nend\nif <(Fly) = [1]> then\n    switch costume to (stand v)\nend\n\ndefine Controls\nset [-right v] to (<<key (right arrow v) pressed?> or <key (d v) pressed?>> + ())\nset [-left v] to (<<key (left arrow v) pressed?> or <key (a v) pressed?>> + ())\nset [-space v] to (<<key (space v) pressed?> or <<key (f v) pressed?> or <key (j v) pressed?>>> + ())\nif <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n    change [-up v] by (1)\nelse\n    set [-up v] to [0]\nend\nif <(_move) = [0]> then\n    set [-right v] to [0]\n    set [-left v] to [0]\n    set [-up v] to [0]\n    set [-space v] to [0]\nend\nchange [movement v] by <<(-left) = [1]> or <<(-up) = [1]> or <<(-right) = [1]> or <(-space) > [0]>>>>\n\nwhen I receive [start game? v]\nset [checkpoint v] to [0]\nset [__coins v] to [0]\nset [__blue coins v] to [0]\nset [_move v] to [1]\nset [movement v] to [0]\nbroadcast (Reset All Objects v) and wait\nbroadcast (Play Game v) and wait\n\nwhen flag clicked\nhide\nbroadcast (grenn flag v) and wait\n\ndefine Death\nset [death tick v] to [0]\nset [ghost v] to [0]\nrepeat (50)\n    set [sx v] to [0]\n    set [sy v] to [0]\n    set [_move v] to [0]\n    Tick\n    broadcast (Tick v) and wait\n    change [death tick v] by (1)\n    if <((Death Tick) mod (10)) = [1]> then\n        set [ghost v] to ((1) - (ghost))\n        set [ghost v] effect to ((ghost) * (100))\n    end\nend\nset [ghost v] effect to (0)\n\nwhen I receive [title screen v]\nhide\n\nwhen I receive [play game v]\nforever\n    if <<(distance to [mouse-pointer v]) < [30]> and <mouse down?>> then\n        start sound [duck v]\n        set [vel v] to [3]\n        set size to (66) %\n        repeat until <(round (size)) < [65]>\n            change [vel v] by (-1)\n            change size by (vel)\n        end\n        wait until <not <mouse down?>>\n    end\nend\n\n@Level\n\nwhen I receive [grenn flag v]\nhide\n\nwhen I receive [tick v]\nswitch costume to (bypass v)\nset size to ((1) / ()) %\ngo to x: ((x) - (SCROLL X)) y: ((y) - (SCROLL Y))\nswitch costume to (costume)\nset size to (100) %\nshow\nset [ghost v] effect to (100)\n\nwhen I receive [set up v]\nhide\nset [x v] to [0]\nset [y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (() + ())\n    set [i v] to [0]\n    repeat (costume [number v])\n        Clone at x: ((i) * (480)) y: [0] costume: ((i) + (1))\n        change [i v] by (1)\n    end\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Clone at x: (x) y: (y) costume: (costume)\nset [x v] to (x)\nset [y v] to (y)\nset [costume v] to (costume)\ncreate clone of (_myself_ v)\n\nwhen I receive [title screen v]\nhide\ndelete this clone\n\n@Trail\n\nwhen I receive [tick v]\nswitch costume to (1 v)\nset size to ((1) / ()) %\ngo to x: ((x) - (SCROLL X)) y: ((y) - (SCROLL Y))\nswitch costume to (costume)\nset size to ([size v] of [player v]) %\npoint in direction ([direction v] of [player v])\nset rotation style [left-right v]\nchange [ghost v] effect by (10)\nif <(tick) > [1]> then\n    show\nend\nchange [tick v] by (1)\nif <(tick) > [9]> then\n    delete this clone\nend\n\nwhen I start as a clone\nset [x v] to ([x v] of [player v])\nset [y v] to ([y v] of [player v])\nset [costume v] to ([costume # v] of [player v])\nset [tick v] to [0]\nset [ghost v] effect to (0)\nhide\n\nwhen flag clicked\nset [ghost v] effect to (100)\nset [tick v] to [0]\nhide\n\nwhen I receive [title screen v]\nhide\ndelete this clone\n\n@Game Objects\n\nwhen I receive [grenn flag v]\nhide\n\nwhen I receive [tick v]\nswitch costume to (bypass v)\nset size to ((1) / ()) %\ngo to x: ((x) - (SCROLL X)) y: ((y) - (SCROLL Y))\nset size to (100) %\nMovement\n\ndefine Clone at x: (x) y: (y) type: (type)\nset [x v] to (x)\nset [y v] to (y)\nset [type v] to (type)\ncreate clone of (_myself_ v)\n\ndefine Movement\nif <<(type) = [1]> or <(type) = [2]>> then\n    switch costume to ((([floor v] of (((Infinite Timer) / (20)) * (10)) ) mod (4)) + (1))\nend\nif <(type) = [1]> then\n    if <touching (player v)?> then\n        start sound [Coin v]\n        change [__coins v] by (1)\n        delete this clone\n    end\nend\nif <(type) = [2]> then\n    set [color v] effect to (100)\n    if <touching (player v)?> then\n        start sound [Collect v]\n        change [__blue coins v] by (1)\n        delete this clone\n    end\nend\nif <(type) = [3]> then\n    switch costume to ((5) + (Checkpoint))\n    if <<touching (player v)?> and <(Checkpoint) = [0]>> then\n        set [checkpoint v] to [1]\n        start sound [Collect v]\n    end\nend\nif <(type) = [4]> then\n    switch costume to (7 v)\n    if <touching (player v)?> then\n        set [exit v] to [Win]\n    end\nend\n\nwhen I start as a clone\nshow\n\nwhen I receive [reset all objects v]\nhide\nset [x v] to [0]\nset [y v] to [0]\nset [type v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (1 v)\n    Clone at x: [0] y: [-80] type: [1]\n    Clone at x: [35] y: [-80] type: [1]\n    Clone at x: [70] y: [-80] type: [1]\n    Clone at x: [310] y: [0] type: [1]\n    Clone at x: [655] y: [0] type: [1]\n    Clone at x: [1042] y: [65] type: [1]\n    Clone at x: [1682] y: [-100] type: [1]\n    Clone at x: [1635] y: [130] type: [1]\n    Clone at x: [1600] y: [130] type: [1]\n    Clone at x: [1880] y: [13] type: [1]\n    Clone at x: [1920] y: [13] type: [1]\n    Clone at x: [1880] y: [-33] type: [1]\n    Clone at x: [1920] y: [-33] type: [1]\n    Clone at x: [2300] y: [20] type: [1]\n    Clone at x: [2670] y: [135] type: [1]\n    Clone at x: [2918] y: [135] type: [1]\n    Clone at x: [3511] y: [162] type: [1]\n    Clone at x: [3351] y: [162] type: [1]\n    Clone at x: [2440] y: [293] type: [2]\n    Clone at x: [3068] y: [-40] type: [2]\n    Clone at x: [4270] y: [240] type: [2]\n    Clone at x: [3251] y: [-20] type: [1]\n    Clone at x: [4220] y: [240] type: [1]\n    Clone at x: [4320] y: [240] type: [1]\n    Clone at x: [4029] y: [-108] type: [3]\n    Clone at x: [3880] y: [-30] type: [1]\n    Clone at x: [3915] y: [-30] type: [1]\n    Clone at x: [4133] y: [52] type: [1]\n    Clone at x: [4295] y: [-28] type: [1]\n    Clone at x: [4645] y: [10] type: [1]\n    Clone at x: [4680] y: [10] type: [1]\n    Clone at x: [4816] y: [264] type: [1]\n    Clone at x: [5188] y: [182] type: [1]\n    Clone at x: [5223] y: [182] type: [1]\n    Clone at x: [5294] y: [16] type: [1]\n    Clone at x: [5154] y: [16] type: [1]\n    Clone at x: [5220] y: [-101] type: [1]\n    Clone at x: [5360] y: [-101] type: [1]\n    Clone at x: [5524] y: [-35] type: [1]\n    Clone at x: [5624] y: [-35] type: [1]\n    Clone at x: [5988] y: [-35] type: [1]\n    Clone at x: [5888] y: [-35] type: [1]\n    Clone at x: [6276] y: [8] type: [1]\n    Clone at x: [6311] y: [8] type: [1]\n    Clone at x: [6898] y: [114] type: [4]\nend\n\nwhen I receive [title screen v]\nhide\ndelete this clone\n\n@Danger\n\nwhen I receive [grenn flag v]\nhide\n\nwhen I receive [tick v]\nswitch costume to (bypass v)\nset size to ((1) / ()) %\ngo to x: ((x) - (SCROLL X)) y: ((y) - (SCROLL Y))\nswitch costume to (costume)\nset size to (100) %\nshow\n\nwhen I receive [set up v]\nhide\nset [x v] to [0]\nset [y v] to [0]\nif <(LEVEL) = [1]> then\n    Clone at x: [960] y: [0] costume: [1]\n    Clone at x: [2880] y: [0] costume: [2]\n    Clone at x: [4800] y: [0] costume: [3]\n    Clone at x: [5280] y: [0] costume: [4]\n    Clone at x: [6240] y: [0] costume: [5]\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Clone at x: (x) y: (y) costume: (costume)\nset [x v] to (x)\nset [y v] to (y)\nset [costume v] to (costume)\ncreate clone of (_myself_ v)\n\n@Semisolids\n\nwhen I receive [grenn flag v]\nhide\n\nwhen I receive [tick v]\nswitch costume to (bypass v)\nset size to ((1) / ()) %\ngo to x: ((x) - (SCROLL X)) y: ((y) - (SCROLL Y))\nswitch costume to (costume)\nset size to (100) %\nif <(y) > (([y v] of [player v]) + (-35))> then\n    hide\nelse\n    show\nend\nset [ghost v] effect to (100)\n\nwhen I receive [set up v]\nhide\nset [x v] to [0]\nset [y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (() + ())\n    set [i v] to [0]\n    Clone at x: [1615] y: [40] costume: [1]\n    Clone at x: [1720] y: [-30] costume: [1]\n    Clone at x: [2070] y: [13] costume: [1]\n    Clone at x: [3255] y: [-50] costume: [2]\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Clone at x: (x) y: (y) costume: (costume)\nset [x v] to (x)\nset [y v] to (y)\nset [costume v] to (costume)\ncreate clone of (_myself_ v)\n\n@Semisolid  Art\n\nwhen I receive [grenn flag v]\nhide\n\nwhen I receive [tick v]\nswitch costume to (bypass v)\nset size to ((1) / ()) %\ngo to x: ((x) - (SCROLL X)) y: ((y) - (SCROLL Y))\nswitch costume to (costume)\nset size to (100) %\nshow\n\nwhen I receive [set up v]\nhide\nset [x v] to [0]\nset [y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (() + ())\n    set [i v] to [0]\n    Clone at x: [1615] y: [40] costume: [1]\n    Clone at x: [1720] y: [-30] costume: [1]\n    Clone at x: [2070] y: [13] costume: [1]\n    Clone at x: [3255] y: [-50] costume: [2]\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Clone at x: (x) y: (y) costume: (costume)\nset [x v] to (x)\nset [y v] to (y)\nset [costume v] to (costume)\ncreate clone of (_myself_ v)\n\nwhen flag clicked\nhide\n\n@Text\n\nwhen I receive [tick v]\nif  then\n    delete this clone\nend\nshow\ngo to x: (-206) y: (150)\nswitch costume to (coins v)\ncreate clone of (_myself_ v)\ngo to x: (-175) y: (150)\nText (__Coins)\ngo to x: ((length of (timer)) * ((15) / (-2))) y: (150)\nText (timer)\nhide\n\ndefine Text (text)\nset [i v] to [1]\nrepeat (length of (text))\n    switch costume to (letter (i) of (text))\n    create clone of (_myself_ v)\n    change x by (15)\n    change [i v] by (1)\nend\n\nwhen I receive [start game? v]\nclear graphic effects\nbroadcast (Timer v)\n\nwhen I receive [win v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [timer v]\nset [movement v] to [0]\nrepeat until <(movement) > [0]>\n    reset timer\nend\n\n@Title\n\nwhen flag clicked\nshow\nset [-use buttons v] to [1]\nshow list [fastest times v]\nbroadcast (Title Screen v)\nforever\n    if <mouse down?> then\n        change [-mouse v] by (1)\n    else\n        set [-mouse v] to [0]\n    end\nend\n\nwhen flag clicked\nset volume to (30) %\n\nforever\n    play sound [Dance Around v] until done\nend\n\nwhen I start as a clone\ngo to [front v] layer\nforever\n    if <(costume [number v]) = [2]> then\n        go to x: (0) y: (-100)\n        change size by (((120) - (size)) / (5))\n        if <<touching (mouse-pointer v)?> and <(-mouse) = [1]>> then\n            start sound [click xdxdxdxd v]\n            broadcast (Intro v)\n            set [-use buttons v] to [0]\n        end\n    end\n    if <(costume [number v]) = [3]> then\n        go to x: (120) y: (-100)\n        change size by (((120) - (size)) / (5))\n        if <<touching (mouse-pointer v)?> and <(-mouse) = [1]>> then\n            Make Fastest Times\n            start sound [click xdxdxdxd v]\n            hide list [fastest times v]\n            set [-use buttons v] to [2]\n        end\n    end\n    if <(costume [number v]) = [4]> then\n        go to x: (180) y: (70)\n        if <<touching (mouse-pointer v)?> and <(-mouse) = [1]>> then\n            show list [fastest times v]\n            start sound [click xdxdxdxd v]\n            set [-use buttons v] to [1]\n        end\n        if <<(-use buttons) = [1]> or <(-use buttons) = [0]>> then\n            hide\n        else\n            show\n        end\n    end\n    if <<(-use buttons) = [1]> or <(costume [number v]) = [4]>> then\n        set [brightness v] effect to (<touching (mouse-pointer v)?> * (-10))\n    else\n        set [brightness v] effect to (0)\n    end\nend\n\nwhen I receive [start game? v]\nhide\ndelete this clone\n\ndefine Title\nset size to (100) %\nswitch costume to (6 v)\nwait (0.5) seconds\nset size to (0) %\nswitch costume to (2 v)\ncreate clone of (_myself_ v)\nset size to (100) %\nswitch costume to (4 v)\ncreate clone of (_myself_ v)\nswitch costume to (6 v)\n\nswitch costume to (3 v)\ncreate clone of (_myself_ v)\n\ndefine Make Fastest Times\ndelete all of [fastest times v]\nrepeat (50)\n    add (join [Username] (join [ - ] [Score])) to [fastest times v]\nend\n\nwhen I receive [title screen v]\nshow\nset [-use buttons v] to [1]\nTitle\n\n@Background\n\nwhen flag clicked\nshow\n\nwhen I receive [title screen v]\nshow\nclear graphic effects\ngo to x: (0) y: (0)\nswitch costume to (1 v)\n\nwhen I receive [tick v]\ngo to x: ((((0) - ((SCROLL X) / (1.3))) mod (480)) - (480)) y: ((0) - ((SCROLL Y) / (1.3)))\nswitch costume to (3 v)\nset [ghost v] effect to (70)\n\n@Win Screen\n\nwhen I receive [win v]\ngo to x: (0) y: (0)\nshow\nswitch costume to (end screen v)\nstart sound [Win v]\nset [game time v] to (timer)\nif <(timer) < (__Personal Record)> then\n    set [__personal record v] to (timer)\n    set [leaderboard time v] to ((__Personal Record) * (1000))\nend\ngo to [front v] layer\nset [ghost v] effect to (100)\nrepeat (10)\n    change [ghost v] effect by (-5)\nend\nwait (2) seconds\nstart sound [Magic Spell v]\ngo to x: (-88) y: (39)\nWrite Text (join (__Coins) [/40])\nif <(__Coins) = [40]> then\n    replace item (1) of [stars v] with [1]\nend\ngo to x: (-14) y: (2)\nWrite Text (join (__Blue Coins) [/3])\nif <(__Blue Coins) = [3]> then\n    replace item (2) of [stars v] with [1]\nend\ngo to x: (-100) y: (-37)\nWrite Text (join (Game Time) [<50])\nif <(Game Time) < [50]> then\n    replace item (3) of [stars v] with [1]\nend\ngo to x: (70) y: (-73)\nWrite Text (__Personal Record)\ngo to x: (-50) y: (140)\nswitch costume to ((17) + (item (1) of [stars v]))\ncreate clone of (_myself_ v)\ngo to x: (0) y: (140)\nswitch costume to ((17) + (item (2) of [stars v]))\ncreate clone of (_myself_ v)\ngo to x: (50) y: (140)\nswitch costume to ((17) + (item (3) of [stars v]))\ncreate clone of (_myself_ v)\ngo to x: (0) y: (0)\nshow\nswitch costume to (results v)\ncreate clone of (_myself_ v)\nswitch costume to (end screen v)\nwait (1) seconds\nswitch costume to (click v)\ncreate clone of (_myself_ v)\nswitch costume to (end screen v)\nwait until <mouse down?>\nstart sound [click xdxdxdxd v]\nbroadcast (Fade v) and wait\n\nset [exit v] to [win]\n\nwhen flag clicked\nhide\n\nwhen I start as a clone\nshow\ngo to [front v] layer\nset [ghost v] effect to (100)\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\n\ndefine Write Text (text)\nset [i v] to [1]\nrepeat (length of (text))\n    switch costume to (letter (i) of (text))\n    create clone of (_myself_ v)\n    change x by (18)\n    change [i v] by (1)\nend\nhide\n\nwhen I receive [reset all data v]\nAdd\n\ndefine Add\ndelete all of [stars v]\nrepeat (3)\n    add [0] to [stars v]\nend\n\nwhen I receive [title screen v]\nhide\ndelete this clone\n\n@Intro\n\nwhen I receive [intro v]\nswitch costume to (1 v)\nshow\ngo to [front v] layer\nset [ghost v] effect to (100)\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nbroadcast (Start Game? v)\nwait (0.5) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\n\nwhen flag clicked\nhide\n\nwhen I receive [fade v]\nswitch costume to (fade v)\nshow\ngo to [front v] layer\nset [ghost v] effect to (100)\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nwait (1) seconds\nswitch costume to (2 v)\nset [brightness v] effect to (-100)\nrepeat (10)\n    change [brightness v] effect by (10)\nend\nwait (0.5) seconds\nwait until <not <<key (any v) pressed?> or <mouse down?>>>\nwait until <<key (any v) pressed?> or <mouse down?>>\nrepeat (10)\n    change [brightness v] effect by (-10)\nend\nbroadcast (Title Screen v)\nwait (0.5) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\n\n@Thumbnail\n\nwhen flag clicked\nset [ghost v] effect to (100)\nforever\n    go to [front v] layer\nend\n\n@Level Art\n\nwhen I receive [grenn flag v]\nhide\n\nwhen I receive [tick v]\nswitch costume to (bypass v)\nset size to ((1) / ()) %\ngo to x: ((x) - (SCROLL X)) y: ((y) - (SCROLL Y))\nswitch costume to (costume)\nset size to (100) %\nshow\n\nwhen I receive [set up v]\nhide\nset [x v] to [0]\nset [y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (() + ())\n    set [i v] to [0]\n    repeat (costume [number v])\n        Clone at x: ((i) * (480)) y: [0] costume: ((i) + (1))\n        change [i v] by (1)\n    end\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Clone at x: (x) y: (y) costume: (costume)\nset [x v] to (x)\nset [y v] to (y)\nset [costume v] to (costume)\ncreate clone of (_myself_ v)\n\nwhen I receive [title screen v]\nhide\ndelete this clone\n\n@Wall\n\nwhen I receive [tick v]\nswitch costume to (blank v)\nset size to ((1) / ()) %\ngo to x: ((2877) - (SCROLL X)) y: (() - (SCROLL Y))\nswitch costume to (wall v)\nset size to (100) %\nif <touching (player v)?> then\n    change [ghost v] effect by (10)\nelse\n    change [ghost v] effect by (-10)\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [start game? v]\nshow\n\n@Music\n\nwhen I receive [start game? v]\nwait (0.5) seconds\nset volume to (30) %\nforever\n    play sound [Tobu - Candyland v] until done\nend\n\nwhen I receive [win v]\nstop [other scripts in sprite v]\n\n@How To Play\n\nwhen I receive [start game? v]\nif <(How To Play) = [0]> then\n    show\n    wait (0.1) seconds\n    wait until <(timer) > [1]>\n    set [how to play v] to [1]\nend\n\nwhen flag clicked\nhide\nclear graphic effects\n\nwhen I receive [reset all objects v]\nset [how to play v] to [0]\n\nwhen I receive [tick v]\nif <(How To Play) = [0]> then\n    change [ghost v] effect by (-10)\nelse\n    change [ghost v] effect by (10)\nend\n\n