Candy Valley || A Platformer || Mobile 
@Stage\n\nwhen flag clicked\nswitch backdrop to (backdrop1 v)\n\nwhen I receive [next v]\nnext costume\n\n@Ground\n\nwhen flag clicked\ngo to x: (0) y: (0)\nswitch costume to (costume1 v)\nshow\ngo to [front v] layer\ngo [backward v] (1) layers\n\nforever\n\nwhen I receive [next v]\nnext costume\n\n@Mover\n\nwhen flag clicked\nset [jump v] to [0]\nset [hold it! v] to [0]\nset size to (35) %\nset rotation style [left-right v]\ngo to [front v] layer\nforever\n    animation\nend\n\nwhen flag clicked\nforever\n    go to (hitbox v)\n    if <(left) = [1]> then\n        point in direction (-90)\n    end\n    if <(right) = [1]> then\n        point in direction (90)\n    end\nend\n\ndefine animation\nif <<key (d v) pressed?> or <<key (a v) pressed?> or <<key (right arrow v) pressed?> or <key (left arrow v) pressed?>>>> then\n    repeat (12)\n        next costume\n        if <not <<key (d v) pressed?> or <<key (a v) pressed?> or <<key (right arrow v) pressed?> or <key (left arrow v) pressed?>>>>> then\n            switch costume to (jump 1 v)\n        end\n        if <<key (w v) pressed?> or <key (up arrow v) pressed?>> then\n            set [jump fall or jump stand v] to [0]\n            set [jump fall or jump stand v] to (pick random (1) to (5))\n            set [jump anti v] to [1]\n            switch costume to (jumping! v)\n            wait (0.025) seconds\n            if <(jump fall or jump stand) = [5]> then\n                repeat until <(costume [number v]) = [29]>\n                    next costume\n                    wait (0.025) seconds\n                end\n                broadcast (hold it! v)\n                switch costume to (costume27 v)\n                wait until <(ground yes) = [0]>\n                wait (0.1) seconds\n                switch costume to (costume27 v)\n                repeat (6)\n                    next costume\n                end\n                switch costume to (jump 1 v)\n                set [jump anti v] to [0]\n            else\n                repeat until <(costume [number v]) = [24]>\n                    next costume\n                    wait (0.025) seconds\n                end\n                switch costume to (costume22 v)\n                wait until <(ground yes) = [0]>\n                wait (0.1) seconds\n                switch costume to (costume35 v)\n                repeat (7)\n                    next costume\n                end\n                switch costume to (jump 1 v)\n            end\n        end\n        wait (0.025) seconds\n    end\n    switch costume to (jump 1 v)\nend\nset [jump anti v] to [0]\nif <<key (w v) pressed?> or <key (up arrow v) pressed?>> then\n    set [jump fall or jump stand v] to [0]\n    set [jump fall or jump stand v] to (pick random (1) to (5))\n    switch costume to (jumping! v)\n    wait (0.025) seconds\n    if <(jump fall or jump stand) = [5]> then\n        repeat until <(costume [number v]) = [29]>\n            next costume\n            wait (0.025) seconds\n        end\n        broadcast (hold it! v)\n        switch costume to (costume27 v)\n        wait until <(ground yes) = [0]>\n        wait (0.1) seconds\n        switch costume to (costume27 v)\n        repeat (6)\n            next costume\n        end\n        switch costume to (jump 1 v)\n        set [jump anti v] to [0]\n    else\n        repeat until <(costume [number v]) = [24]>\n            next costume\n            wait (0.025) seconds\n        end\n        switch costume to (costume22 v)\n        wait until <(ground yes) = [0]>\n        wait (0.1) seconds\n        switch costume to (costume35 v)\n        repeat (7)\n            next costume\n        end\n        switch costume to (jump 1 v)\n        set [jump anti v] to [0]\n    end\nend\nset [jump anti v] to [0]\n\nset size to (50) %\n\nif <touching (bouncey2 v)?> then\n    broadcast (jump 2 v)\n    set [jumpingness v] to [18]\n    set [fallspeed v] to (jumpingness)\n    set [jumpingness v] to [12]\nend\n\nwhen I receive [hold it! v]\nset [hold it! v] to [1]\nwait (0.2) seconds\nset [hold it! v] to [0]\n\nwhen flag clicked\nforever\n    if <(costume [number v]) = [1]> then\n        set [jump anti v] to [0]\n    end\nend\n\n\n\nif <(costume [number v]) = [29]> then\n\nbroadcast (hold it! v)\n\n@hitbox\n\nwhen flag clicked\nset [yes trap v] to [0]\ngo to x: (0) y: (0)\nset [ghost v] effect to (100)\nset [jump anti v] to [0]\nset rotation style [left-right v]\nset [gravity v] to [-1]\nset [movement v] to [3]\nset [fallspeed v] to [0]\nset [jumpingness v] to [12]\nforever\n    controls\n    jump control\n    simulation gravity\n    if <(x position) > [230]> then\n        start\n        broadcast (next v)\n        wait (0.2) seconds\n    end\n    if <(y position) < [-189]> then\n        start\n    end\n    if <touching (bouncey v)?> then\n        broadcast (jump v)\n        set [jumpingness v] to [18]\n        set [fallspeed v] to (jumpingness)\n        set [jumpingness v] to [12]\n    end\n    if <touching (bouncey2 v)?> then\n        broadcast (jump 2 v)\n        set [jumpingness v] to [18]\n        set [fallspeed v] to (jumpingness)\n        set [jumpingness v] to [12]\n    end\n    if <touching (spikes2 v)?> then\n        start\n        change [☁ world wide deaths v] by (1)\n    end\n    if <touching (anvil v)?> then\n        start\n        change [☁ world wide deaths v] by (1)\n    end\nend\n\ndefine controls\nset rotation style [left-right v]\nif <(hold it!) = [0]> then\n    if <<key (a v) pressed?> or <key (left arrow v) pressed?>> then\n        point in direction (-90)\n        set [right v] to [0]\n        set [left v] to [1]\n        change x by ((0) - (movement))\n        if <touching (ground v)?> then\n            change x by (movement)\n        end\n    end\n    if <<key (d v) pressed?> or <key (right arrow v) pressed?>> then\n        point in direction (90)\n        set [left v] to [0]\n        set [right v] to [1]\n        change x by (movement)\n        if <touching (ground v)?> then\n            change x by ((0) - (movement))\n        end\n    end\nend\n\ndefine jump control\nif <(hold it!) = [0]> then\n    change y by (-1)\n    if <<key (w v) pressed?> or <key (up arrow v) pressed?>> then\n        if <touching (ground v)?> then\n            set [fallspeed v] to (jumpingness)\n        end\n    end\n    change y by (1)\nend\n\nwhen flag clicked\nset size to (50) %\nforever\n    if <touching (ground v)?> then\n        set [ground yes v] to [1]\n    else\n        set [ground yes v] to [0]\n    end\nend\n\ndefine simulation gravity\nchange y by (fallspeed)\nif <touching (ground v)?> then\n    if <(fallspeed) < [0]> then\n        set [step back v] to [1]\n    else\n        set [step back v] to [-1]\n    end\n    repeat until <not <touching (ground v)?>>\n        change y by (step back)\n    end\n    set [fallspeed v] to [0]\nelse\n    change [fallspeed v] by (gravity)\nend\n\ndefine start\ngo to x: (-230) y: (-50)\n\nset [ghost v] effect to (0)\n\nset [jump anti v] to [1]\n\nwhen I receive [kill v]\nstart\nchange [☁ world wide deaths v] by (1)\nwait (0.3) seconds\n\nwhen flag clicked\nforever\n    if <key (n v) pressed?> then\n        broadcast (next v)\n        start\n        wait (0.2) seconds\n    end\nend\n\n@Sprite1\n\nwhen flag clicked\nhide\nforever\n    create clone of (_myself_ v)\n    wait (pick random (0.025) to (0.05)) seconds\nend\n\nwhen I start as a clone\nshow\ngo [backward v] (pick random (1) to (2)) layers\ngo to x: (271) y: (153)\nset size to (pick random (10) to (100)) %\nset [ghost v] effect to (pick random (25) to (70))\nset [x v] to [-3]\nset [y v] to (pick random (0) to (1))\nrepeat (10)\n    change x by (x)\n    if <(y) = [0]> then\n        change y by (-0.03)\n    end\n    if <(y) = [1]> then\n        change y by (0.03)\n    end\nend\nrepeat (200)\n    change x by (x)\n    if <(y) = [0]> then\n        change y by (-0.3)\n    end\n    if <(y) = [1]> then\n        change y by (0.3)\n    end\nend\ndelete this clone\n\n@Sprite2\n\nwhen flag clicked\nhide\nforever\n    create clone of (_myself_ v)\n    wait (pick random (0.025) to (0.05)) seconds\nend\n\nwhen I start as a clone\nshow\ngo [backward v] (pick random (1) to (2)) layers\ngo to x: (-271) y: (153)\nset size to (pick random (10) to (100)) %\nset [ghost v] effect to (pick random (25) to (70))\nset [x v] to [3]\nset [y v] to (pick random (0) to (1))\nrepeat (10)\n    change x by (x)\n    if <(y) = [0]> then\n        change y by (-0.03)\n    end\n    if <(y) = [1]> then\n        change y by (0.03)\n    end\nend\nrepeat (200)\n    change x by (x)\n    if <(y) = [0]> then\n        change y by (-0.3)\n    end\n    if <(y) = [1]> then\n        change y by (0.3)\n    end\nend\ndelete this clone\n\n@Rain\n\nwhen flag clicked\nhide\nforever\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\ngo to [back v] layer\nshow\ngo to x: (pick random (-232) to (232)) y: (140)\nrepeat until <touching (_edge_ v)?>\n    point in direction (direction rain)\n    move (10) steps\nend\ndelete this clone\n\nwhen flag clicked\nhide\nforever\n    set [direction rain v] to [175]\n    wait (pick random (5) to (10)) seconds\n    set [direction rain v] to [180]\n    wait (pick random (5) to (10)) seconds\n    set [direction rain v] to [170]\n    wait (pick random (5) to (10)) seconds\n    set [direction rain v] to [-176]\n    wait (pick random (5) to (10)) seconds\n    set [direction rain v] to [-174]\n    wait (pick random (5) to (10)) seconds\n    set [direction rain v] to [-170]\n    wait (pick random (5) to (10)) seconds\n    set [direction rain v] to [171]\n    wait (pick random (5) to (10)) seconds\nend\n\nwhen flag clicked\nforever\n    start sound [Rain v]\n    wait (7.5) seconds\nend\n\n@Lightning\n\nwhen flag clicked\nhide\nset [ghost v] effect to (0)\nforever\n    wait (pick random (7) to (20)) seconds\n    repeat (pick random (1) to (3))\n        show\n        wait (0.1) seconds\n        hide\n        start sound [thunder1 copy v]\n    end\nend\n\n@Sprite3\n\nwhen flag clicked\nhide\ngo to x: (0) y: (0)\nswitch costume to (costume1 v)\nshow\nforever\n    go to [front v] layer\n    go [backward v] (1) layers\nend\n\nwhen I receive [next v]\nnext costume\n\n@Spikes\n\n@Bouncey\n\nwhen flag clicked\nhide\nforever\n    if <(backdrop [number v]) = [1]> then\n        hide\n    end\n    if <(backdrop [number v]) = [2]> then\n        hide\n    end\n    if <(backdrop [number v]) = [3]> then\n        show\n        go to x: (56) y: (-134)\n    end\n    if <(backdrop [number v]) = [4]> then\n        hide\n    end\n    if <(backdrop [number v]) = [5]> then\n        show\n        go to x: (56) y: (-121)\n    end\n    if <(backdrop [number v]) = [6]> then\n        hide\n    end\n    if <(backdrop [number v]) = [7]> then\n        hide\n    end\n    if <(backdrop [number v]) = [8]> then\n        show\n        go to x: (148) y: (-132)\n    end\n    if <(backdrop [number v]) = [9]> then\n        show\n        go to x: (-150) y: (-128)\n    end\n    if <(backdrop [number v]) = [10]> then\n        show\n        go to x: (-100) y: (-112)\n    end\n    if <(backdrop [number v]) = [11]> then\n        hide\n    end\n    if <(backdrop [number v]) = [12]> then\n        show\n        go to x: (-180) y: (-123)\n    end\n    if <(backdrop [number v]) = [13]> then\n        hide\n    end\n    if <(backdrop [number v]) = [14]> then\n        hide\n    end\n    if <(backdrop [number v]) = [15]> then\n        show\n        go to x: (0) y: (-130)\n    end\n    if <(backdrop [number v]) = [16]> then\n        hide\n    end\n    if <(backdrop [number v]) = [17]> then\n        hide\n    end\n    if <(backdrop [number v]) = [18]> then\n        show\n        go to x: (37) y: (-133)\n    end\n    if <(backdrop [number v]) = [19]> then\n        go to x: (47) y: (-113)\n    end\nend\n\nwhen I receive [jump v]\nswitch costume to (costume1 v)\nrepeat (15)\n    next costume\nend\nswitch costume to (costume1 v)\n\nwhen flag clicked\npoint in direction (90)\npoint in direction (90)\ngo to [front v] layer\n\n@Bouncey2\n\nwhen flag clicked\nhide\nforever\n    if <(backdrop [number v]) = [1]> then\n        hide\n    end\n    if <(backdrop [number v]) = [2]> then\n        hide\n    end\n    if <(backdrop [number v]) = [3]> then\n        hide\n    end\n    if <(backdrop [number v]) = [4]> then\n        hide\n    end\n    if <(backdrop [number v]) = [5]> then\n        show\n        go to x: (-56) y: (-121)\n    end\n    if <(backdrop [number v]) = [6]> then\n        hide\n    end\n    if <(backdrop [number v]) = [7]> then\n        hide\n    end\n    if <(backdrop [number v]) = [8]> then\n        hide\n    end\n    if <(backdrop [number v]) = [9]> then\n        hide\n    end\n    if <(backdrop [number v]) = [10]> then\n        hide\n    end\n    if <(backdrop [number v]) = [11]> then\n        hide\n    end\n    if <(backdrop [number v]) = [12]> then\n        show\n        go to x: (-43) y: (-121)\n    end\n    if <(backdrop [number v]) = [13]> then\n        hide\n    end\n    if <(backdrop [number v]) = [14]> then\n    if <(backdrop [number v]) = [15]> then\n    if <(backdrop [number v]) = [16]> then\n    if <(backdrop [number v]) = [17]> then\n    if <(backdrop [number v]) = [18]> then\n    if <(backdrop [number v]) = [19]> then\nend\n\nwhen I receive [jump 2 v]\nswitch costume to (costume1 v)\nrepeat (15)\n    next costume\nend\nswitch costume to (costume1 v)\n\nwhen flag clicked\nforever\n    go to [front v] layer\nend\n\n@Spikes2\n\nwhen flag clicked\nshow variable [☁ world wide deaths v]\nswitch costume to (costume1 v)\nshow\ngo to x: (0) y: (0)\ngo to [front v] layer\n\nwhen I receive [next v]\nnext costume\n\n@Default Spike\n\nwhen flag clicked\nhide\n\n@Thumbnail\n\nwhen flag clicked\nforever\n    go to [front v] layer\n    set [ghost v] effect to (100)\nend\n\n@ANVIL Trap\n\nwhen flag clicked\nshow\ngo to [front v] layer\nforever\n    if <(backdrop [number v]) = [1]> then\n        hide\n    end\n    if <(backdrop [number v]) = [2]> then\n        hide\n    end\n    if <(backdrop [number v]) = [3]> then\n        hide\n    end\n    if <(backdrop [number v]) = [4]> then\n        show\n        go to x: (57) y: (-145)\n    end\n    if <(backdrop [number v]) = [5]> then\n        show\n        go to x: (119) y: (-125)\n    end\n    if <(backdrop [number v]) = [6]> then\n        show\n        go to x: (160) y: (14)\n    end\n    if <(backdrop [number v]) = [7]> then\n        show\n        go to x: (0) y: (-130)\n    end\n    if <(backdrop [number v]) = [8]> then\n        hide\n    end\n    if <(backdrop [number v]) = [9]> then\n        hide\n    end\n    if <(backdrop [number v]) = [10]> then\n        show\n        go to x: (-30) y: (14)\n    end\n    if <(backdrop [number v]) = [11]> then\n        show\n        go to x: (22) y: (-140)\n    end\n    if <(backdrop [number v]) = [12]> then\n        show\n        go to x: (75) y: (-124)\n    end\n    if <(backdrop [number v]) = [13]> then\n        hide\n    end\n    if <(backdrop [number v]) = [14]> then\n        show\n        go to x: (83) y: (-96)\n    end\n    if <(backdrop [number v]) = [15]> then\n        hide\n    end\n    if <(backdrop [number v]) = [16]> then\n        show\n        go to x: (184) y: (-126)\n    end\n    if <(backdrop [number v]) = [17]> then\n        hide\n    end\n    if <(backdrop [number v]) = [18]> then\n        show\n        go to x: (102) y: (-8)\n    end\n    if <(backdrop [number v]) = [19]> then\n        go to x: (-133) y: (-115)\n    end\nend\n\nwhen flag clicked\nforever\n    set [x trap v] to (x position)\nend\n\nwhen flag clicked\nswitch costume to (costume1 v)\nforever\n    if <(yes trap) = [0]> then\n        if <<touching (mover v)?> or <touching (trap doer v)?>> then\n            switch costume to (costume1 v)\n            broadcast (trap its a! v)\n            repeat (13)\n                next costume\n            end\n            switch costume to (costume1 v)\n        end\n        wait until <not <touching (mover v)?>>\n    end\nend\n\n@Anvil\n\nwhen flag clicked\nhide\n\nwhen I receive [trap its a! v]\nnext costume\nset [yes trap v] to [1]\nshow\nset [ghost v] effect to (0)\nif <(backdrop [number v]) = [5]> then\n    switch costume to (costume2 v)\nend\nif <(costume [number v]) = [1]> then\n    point in direction (90)\n    go to x: (X TRAP) y: (180)\n    repeat until <touching (ground v)?>\n        change y by (-25)\n    end\n    up\nend\nif <(costume [number v]) = [2]> then\n    go to x: (-170) y: (150)\n    point towards (mover v)\n    repeat until <<touching (hitbox v)?> or <touching (_edge_ v)?>>\n        move (25) steps\n    end\n    down\nend\nrepeat (100)\n    change [ghost v] effect by (1)\nend\nhide\nset [yes trap v] to [0]\n\ndefine up\nrepeat until <not <touching (ground v)?>>\n    change y by (1)\nend\n\nwhen I receive [next v]\nhide\n\ndefine down\nrepeat until <<touching (ground v)?> or <touching (_edge_ v)?>>\n    change y by (-1)\nend\nif <touching (_edge_ v)?> then\n    hide\nend\n\n@Chain Trap\n\nwhen flag clicked\nswitch costume to (costume1 v)\nhide\ngo to [front v] layer\nforever\n    if <(backdrop [number v]) = [1]> then\n        hide\n    end\n    if <(backdrop [number v]) = [2]> then\n        hide\n    end\n    if <(backdrop [number v]) = [3]> then\n        hide\n    end\n    if <(backdrop [number v]) = [4]> then\n        hide\n    end\n    if <(backdrop [number v]) = [5]> then\n        hide\n    end\n    if <(backdrop [number v]) = [6]> then\n        hide\n    end\n    if <(backdrop [number v]) = [7]> then\n        hide\n    end\n    if <(backdrop [number v]) = [8]> then\n        hide\n    end\n    if <(backdrop [number v]) = [9]> then\n        hide\n    end\n    if <(backdrop [number v]) = [10]> then\n        hide\n    end\n    if <(backdrop [number v]) = [11]> then\n        hide\n    end\n    if <(backdrop [number v]) = [12]> then\n        hide\n    end\n    if <(backdrop [number v]) = [13]> then\n        show\n        go to x: (-70) y: (-120)\n    end\n    if <(backdrop [number v]) = [14]> then\n        show\n        go to x: (192) y: (-123)\n    end\n    if <(backdrop [number v]) = [15]> then\n        hide\n    end\n    if <(backdrop [number v]) = [16]> then\n        show\n        go to x: (-171) y: (-130)\n    end\n    if <(backdrop [number v]) = [17]> then\n        go to x: (30) y: (-90)\n    end\n    if <(backdrop [number v]) = [18]> then\n        go to x: (203) y: (-58)\n    end\n    if <(backdrop [number v]) = [19]> then\n        go to x: (-42) y: (-120)\n    end\nend\n\nshow\ngo to x: (160) y: (14)\nshow\ngo to x: (-30) y: (14)\n\nshow\ngo to x: (0) y: (-130)\n\nwhen flag clicked\ngo to [front v] layer\nforever\n    if <touching (mover v)?> then\n        broadcast (KILL v)\n        broadcast (hold it! v)\n        switch costume to (costume1 v)\n        repeat (6)\n            next costume\n        end\n        wait (0.3) seconds\n        switch costume to (costume1 v)\n    end\nend\n\nset [hold it! v] to [0]\n\nset [hold it! v] to [1]\n\ngo to x: (119) y: (-125)\n\nif <touching (mover v)?> then\n    show\n    show\n    go to x: (57) y: (-145)\nend\n\n@trap doer\n\nwhen flag clicked\nshow\nset [ghost v] effect to (100)\nforever\n    set size to (30) %\n    go to (mover v)\nend\n\nset [ghost v] effect to (0)\n\n@Sprite4\n\nwhen flag clicked\ngo to x: (0) y: (0)\nshow\ngo to [front v] layer\n\nwhen I receive [next v]\nshow\ngo to [front v] layer\n\n
    -------------------- Pixel Ninja --------------------\n                        by JC_ProGold\n\nSkip the intro by pressing the space bar or clicking on the mouse.\n\nA ninja is on a quest to find his friends. 10 years ago, monsters took over his village and only 5 ninjas survived, including him... Play as he goes on an amazing adventure, including flying a plane!!!!!\n\nControls:\n\n~ MAIN THINGS ~\n# These also work in the boss fight\n➜ Move and Jump - Arrow keys, WASD or use the mouse pointer.\n➜ Wall jump - Jump onto a wall and switch between arrow keys every time you hit the opposite wall otherwise you won't go up.\n➜ Throw ninja star (when you have it) - Press the space bar or press the throw button.\n\n~ PLANE FLIGHT ~\n# You only have 5 lives, so don't touch bombs (clouds are fine to touch)\n➜ Move - Arrow keys, WASD or use the mouse pointer.\n\n~ BOSS FIGHT ~\n# Don't reset all the time, just when all the monsters are underneath you and you can't move\n➜ Reset boss fight - Press the 'r' key.