Candyland - A Scrolling Platformer

Instructions: Welcome to Candyland - A Platformer\n---------------------------------------------------------------\nMy first scrolling platformer and I spent 20-24 hours working on it.\n---------------------------------------------------------------\nInstructions\n-W,A,D, Arrow keys, or Tap screen to move\n-Don't touch spikes\n-Touch checkpoints to equip them\n-Love, Fav, and Follow\n-Try getting to the end\n-Try finding the secret

@Stage\n\n@Sprite1\n\nwhen flag clicked\nhide\n\ngo to [front v] layer\n\n@Bad\n\nwhen I receive [bad v]\nset [brightness v] effect to (100)\nwait (0.1) seconds\nset [brightness v] effect to (0)\n\nwhen I start as a clone\nswitch costume to (costume2 v)\nset size to (600) %\nswitch costume to (costume3 v)\ngo to x: (0) y: (0)\nshow\nbroadcast (levelStartSwitch v)\nforever\n    go to (ground v)\nend\n\nwhen I start as a clone\nforever\n    if <touching (player v)?> then\n        broadcast (bad v)\n    end\nend\n\nwhen I receive [start v]\ncreate clone of (_myself_ v)\nhide\n\nwhen flag clicked\nhide\n\n@Screen\n\nwhen I receive [bad v]\nset [brightness v] effect to (100)\nwait (0.1) seconds\nset [brightness v] effect to (0)\nforever\n    go to [front v] layer\nend\n\nwhen I receive [start v]\ngo to x: (0) y: (0)\ngo to [front v] layer\nshow\n\nwhen flag clicked\nhide\n\n@Player\n\nwhen I receive [bad v]\nset [brightness v] effect to (100)\nwait (0.1) seconds\nset [brightness v] effect to (0)\n\nwhen I receive [start v]\nset rotation style [left-right v]\ngo to x: (0) y: (0)\nshow\nforever\n    if <<key (right arrow v) pressed?> or <<mouse down?> and <(mouse x) > [0]>>> then\n        point in direction (90)\n    end\n    if <<key (left arrow v) pressed?> or <<mouse down?> and <(mouse x) < [0]>>> then\n        point in direction (-90)\n    end\nend\n\nwhen flag clicked\nhide\n\n@Ground\n\nwhen I receive [start v]\nset [spawn y v] to [650]\nset [spawn x v] to [1308]\nset [xv v] to [0]\nset [yv v] to [0]\nswitch costume to (costume2 v)\nset size to (600) %\nswitch costume to (costume1 v)\ngo to x: (Spawn y) y: (Spawn y)\nshow\nbroadcast (levelStartSwitch v)\nforever\n    set [ghost v] effect to (0)\n    if <<key (right arrow v) pressed?> or <<mouse down?> and <(mouse x) > [0]>>> then\n        if <not <<key (left arrow v) pressed?> or <<mouse down?> and <(mouse x) < [0]>>>> then\n            set [xv v] to [6]\n            change x by ((-1) * (XV))\n        end\n    end\n    if <<key (left arrow v) pressed?> or <<mouse down?> and <(mouse x) < [0]>>> then\n        set [xv v] to [-6]\n        change x by ((-1) * (XV))\n    end\n    if <not <<<key (right arrow v) pressed?> or <<mouse down?> and <(mouse x) > [0]>>> or <<<key (left arrow v) pressed?> or <<mouse down?> and <(mouse x) < [0]>>> or <<key (up arrow v) pressed?> or <<mouse down?> and <(mouse y) > [0]>>>>>> then\n        set [xv v] to [0]\n    end\n    if <touching (player v)?> then\n        change y by (-1)\n        if <touching (player v)?> then\n            change y by (-1)\n            if <touching (player v)?> then\n                change y by (-1)\n                if <touching (player v)?> then\n                    change y by (-1)\n                    if <touching (player v)?> then\n                        change y by (-1)\n                        if <touching (player v)?> then\n                            change x by (XV)\n                            set [xv v] to [0]\n                            change y by (5)\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change [yv v] by (1)\n    change y by (YV)\n    change [inair v] by (1)\n    if <touching (player v)?> then\n        set [inair v] to [0]\n        change y by ((YV) * (-1))\n        set [yv v] to [0]\n    end\n    change y by (1)\n    if <<touching (player v)?> and <<key (up arrow v) pressed?> or <<mouse down?> and <(mouse y) > [0]>>>> then\n        set [yv v] to [-20]\n    end\n    change y by (-1)\nend\n\nwhen I receive [bad v]\nset [brightness v] effect to (100)\nwait (0.1) seconds\nset [brightness v] effect to (0)\n\nwhen I receive [bad v]\ngo to x: (Spawn x) y: (Spawn y)\n\nwhen flag clicked\nhide\n\nwhen I receive [start v]\nforever\n    if <(y position) > [670]> then\n        go to x: (Spawn x) y: (Spawn y)\n    end\nend\n\nif <<key (right arrow v) pressed?> or <<mouse down?> and <(mouse x) > [0]>>> then\n    if <not <<key (left arrow v) pressed?> or <<mouse down?> and <(mouse x) < [0]>>>> then\n        set [xv v] to [6]\n        change x by ((-1) * (XV))\n    end\nend\nif <<key (left arrow v) pressed?> or <<mouse down?> and <(mouse x) < [0]>>> then\n    set [xv v] to [-6]\n    change x by ((-1) * (XV))\nend\nif <not <<<key (right arrow v) pressed?> or <<mouse down?> and <(mouse x) > [0]>>> or <<<key (left arrow v) pressed?> or <<mouse down?> and <(mouse x) < [0]>>> or <<key (up arrow v) pressed?> or <<mouse down?> and <(mouse y) > [0]>>>>>> then\n    set [xv v] to [0]\nend\nif <touching (player v)?> then\n    change y by (-1)\n    if <touching (player v)?> then\n        change y by (-1)\n        if <touching (player v)?> then\n            change y by (-1)\n            if <touching (player v)?> then\n                change y by (-1)\n                if <touching (player v)?> then\n                    change y by (-1)\n                    if <touching (player v)?> then\n                        change x by (XV)\n                        set [xv v] to [0]\n                        change y by (5)\n                    end\n                end\n            end\n        end\n    end\nend\nchange [yv v] by (1)\nchange y by (YV)\nchange [inair v] by (1)\nif <touching (player v)?> then\n    set [inair v] to [0]\n    change y by ((YV) * (-1))\n    set [yv v] to [0]\nend\nchange y by (1)\nif <<touching (player v)?> and <<key (up arrow v) pressed?> or <<mouse down?> and <(mouse y) > [0]>>>> then\n    set [yv v] to [-20]\nend\nchange y by (-1)\n\n@Sprite2\n\nwhen I receive [fade v]\ndelete this clone\n\nwhen I start as a clone\nif <(id) = [0]> then\n    go to x: (0) y: (0)\n    point in direction (90)\n    show\n    switch costume to (background v)\n    go to [back v] layer\n    forever\n        if <(uservanish) = [0]> then\n            set [ghost v] effect to (0)\n            switch costume to (background v)\n            go to [back v] layer\n            go [backward v] (1) layers\n            show\n            go to x: (0) y: (0)\n        else\n            wait (0.4) seconds\n            repeat (20)\n                change [ghost v] effect by (5)\n            end\n            delete this clone\n        end\n    end\nend\nif <(id) = [1]> then\n    go to x: (700) y: (0)\n    show\n    point in direction (90)\n    go to [front v] layer\n    Smooth Glide to x [0] y [0] Speed [4]\n    hide\n    delete this clone\nend\nif <(id) = [2]> then\n    set size to (0) %\n    show\n    switch costume to (untitled design \(10\) v)\n    go to [front v] layer\n    go to x: (0) y: (35)\n    repeat (16)\n        turn right (22.5) degrees\n        change size by (6.25)\n    end\n    point in direction (90)\n    set size to (100) %\n    forever\n        if <(end?) = [0]> then\n            point in direction ((([cos v] of ((sine) * (18)) ) * (10)) + (90))\n            change [sine v] by (1)\n        else\n            repeat (24)\n                turn right (-16.875) degrees\n                change size by (-4.6875)\n            end\n            broadcast (fade v)\n            delete this clone\n        end\n    end\nend\nif <(id) = [3]> then\n    point in direction (90)\n    wait (0.5) seconds\n    set [ghost v] effect to (0)\n    switch costume to (username v)\n    go to [front v] layer\n    go [backward v] (1) layers\n    show\n    go to x: (700) y: (0)\n    Smooth Glide to x [0] y [0] Speed [4]\n    forever\n        if <(uservanish) = [0]> then\n            set [ghost v] effect to (0)\n            switch costume to (username v)\n            go to [front v] layer\n            go [backward v] (1) layers\n            show\n            go to x: (0) y: (0)\n        else\n            Smooth Glide to x [0] y [25] Speed [3]\n            Smooth Glide to x [0] y [-99] Speed [3]\n            delete this clone\n        end\n    end\nend\n\nwhen flag clicked\nset [end? v] to [0]\nstart sound [Inferno4 v]\nhide\nset [uservanish v] to [0]\nset [sine v] to [0]\nset [id v] to [0]\ncreate clone of (_myself_ v)\nwait (0.1) seconds\nchange [id v] by (1)\nrepeat (3)\n    switch costume to (slide v)\n    create clone of (_myself_ v)\n    wait (0.1) seconds\n    switch costume to (slide2 v)\n    create clone of (_myself_ v)\n    wait (0.1) seconds\nend\nswitch costume to (background v)\ncreate clone of (_myself_ v)\nwait (0.8) seconds\nchange [id v] by (1)\ncreate clone of (_myself_ v)\nwait (0.1) seconds\nchange [id v] by (1)\ncreate clone of (_myself_ v)\n\nwhen flag clicked\nset volume to (100) %\nwait (7) seconds\nset [end? v] to [1]\nset [uservanish v] to [1]\n\nwhen I receive [fade v]\nrepeat (10)\n    change volume by (-10)\nend\nstop all sounds\nbroadcast (START v)\n\ndefine Smooth Glide to x (x) y (y) Speed (s)\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))\nend\ngo to x: (x) y: (y)\n\nwhen I receive [start v]\nset volume to (100) %\nforever\n    play sound [Tobu - Candyland v] until done\nend\n\n@Checkpoint 1\n\nwhen I receive [start v]\ncreate clone of (_myself_ v)\nhide\n\nwhen I start as a clone\ngo to [front v] layer\nswitch costume to (costume1 v)\nset size to (600) %\nswitch costume to (costume2 v)\ngo to x: (0) y: (0)\nshow\nbroadcast (levelStartSwitch v)\nforever\n    go to (ground v)\nend\n\nwhen I receive [bad v]\nset [brightness v] effect to (100)\nwait (0.1) seconds\nset [brightness v] effect to (0)\n\nwhen flag clicked\nhide\n\nwhen I start as a clone\nforever\n    if <touching (player v)?> then\n        set [spawn x v] to [-1300]\n        set [spawn y v] to [286]\n        hide\n    end\nend\n\n@Checkpoint 2\n\nwhen I receive [start v]\ncreate clone of (_myself_ v)\nhide\n\nwhen I start as a clone\ngo to [front v] layer\nswitch costume to (costume1 v)\nset size to (600) %\nswitch costume to (costume2 v)\ngo to x: (0) y: (0)\nshow\nbroadcast (levelStartSwitch v)\nforever\n    go to (ground v)\nend\n\nwhen I receive [bad v]\nset [brightness v] effect to (100)\nwait (0.1) seconds\nset [brightness v] effect to (0)\n\nwhen flag clicked\nhide\n\nwhen I start as a clone\nforever\n    if <touching (player v)?> then\n        set [spawn x v] to [1075]\n        set [spawn y v] to [150]\n        hide\n    end\nend\n\n