A Touch of Color [Demo: Puzzle Platformer]


@Stage\n\nwhen flag clicked\nforever\n    play sound [nature v] until done\nend\n\nwhen I receive [play v]\nforever\n    play sound [Dark Music - Fatal Lullaby.mp3 v] until done\nend\n\n@Sprite6\n\n@WPlayer\n\nmove (-5) steps\n\nwhen flag clicked\nforever\n    if <color (#ffe9cc) is touching (#82c8ff)?> then\n        change [yv v] by (0.4)\n        change y by (-1)\n        if <<touching (white v)?> or <touching (bplayer v)?>> then\n            set [yv v] to [0]\n        end\n        if <key (w v) pressed?> then\n            if <<touching (white v)?> or <touching (bplayer v)?>> then\n                set [yv v] to [7]\n            else\n                change [yv v] by (0.6)\n            end\n        end\n        change y by (1)\n        set [yv v] to ((Yv) * (0.9))\n        change [xv v] by ((<key (d v) pressed?> - <key (a v) pressed?>) * (0.1))\n    end\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [refresh level v]\nhide\nset [yv v] to [0]\nset [xv v] to [0]\nif <(Stage) = [1]> then\n    Placement [1] [-215] [-110]\nend\nif <(Stage) = [2]> then\n    Placement [2] [-155] [-50]\nend\nif <(Stage) = [4]> then\n    Placement [3] [-115] [-100]\nend\nif <(Stage) = [5]> then\n    Placement [4] [-215] [-110]\nend\nif <(Stage) = [6]> then\n    Placement [2] [-215] [-110]\nend\nif <(Stage) = [3]> then\n    Placement [1] [-200] [-57]\nend\nif <(Stage) = [7]> then\n    Placement [7] [-220] [12]\nend\nif <(Stage) = [8]> then\n    Placement [8] [95] [23]\nend\nshow\nwait (0.05) seconds\n\nwhen backdrop switches to [backdrop31 v]\nstop [other scripts in sprite v]\nhide\n\n\n\n    change [yv v] by (0.1)\nend\nif <key (s v) pressed?> then\n    change [yv v] by (-0.4)\nend\n\ndefine Placement (level) (x) (y)\ngo to x: (x) y: (y)\n\nif <(Stage) = [1]> then\n\nforever\n\nwhen I receive [play v]\nset [level v] to [1]\nPlacement [1] [-215] [-110]\nset [weapon amount v] to [0]\nshow\nforever\n    set [nusdna nblkc dfv lkjasdvb lkajdsfvlkjb v] to (direction)\n    switch costume to (the ninja2 v)\n    point in direction (90)\n    if <(y position) < [-170]> then\n        broadcast (refresh level v) and wait\n    end\n    if <(x position) > [235]> then\n        change [level v] by (1)\n        broadcast (refresh level v) and wait\n    end\n    change [yv v] by (-0.5)\n    if <key (d v) pressed?> then\n        change [xv v] by (0.4)\n    end\n    if <key (a v) pressed?> then\n        change [xv v] by (-0.4)\n    end\n    set [xv v] to ((Xv) * (0.9))\n    change x by (Xv)\n    if <<touching (white v)?> or <touching (bplayer v)?>> then\n        change y by (1)\n        if <<touching (white v)?> or <touching (bplayer v)?>> then\n            change y by (1)\n            if <<touching (white v)?> or <touching (bplayer v)?>> then\n                change y by (1)\n                if <<touching (white v)?> or <touching (bplayer v)?>> then\n                    change y by (1)\n                    if <<touching (white v)?> or <touching (bplayer v)?>> then\n                        change y by (1)\n                        if <<touching (white v)?> or <touching (bplayer v)?>> then\n                            change x by ((Xv) * (-1))\n                            change x by (-1)\n                            change y by (-5)\n                            change x by (1)\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change y by (Yv)\n    if <<touching (white v)?> or <touching (bplayer v)?>> then\n        change y by ((Yv) * (-1))\n        set [yv v] to [0]\n    end\n    change y by (-1)\n    if <<touching (white v)?> or <touching (bplayer v)?>> then\n        if <key (w v) pressed?> then\n            set [yv v] to [7.5]\n        end\n    end\n    change y by (1)\n    point in direction (nusdna nblkc dfv lkjasdvb lkajdsfvLKJB)\n    switch costume to (the ninja v)\n    if <(Stage) = [5]> then\n        go to [front v] layer\n        go [backward v] (2) layers\n    else\n        go to [front v] layer\n    end\nend\n\n@BPlayer\n\nwhen flag clicked\nforever\n    if <color (#ffe9cc) is touching (#82c8ff)?> then\n        change [yv v] by (0.4)\n        change y by (-1)\n        if <<touching (black v)?> or <touching (wplayer v)?>> then\n            set [yv v] to [0]\n        end\n        if <key (up arrow v) pressed?> then\n            if <<touching (black v)?> or <touching (wplayer v)?>> then\n                set [yv v] to [7]\n            else\n                change [yv v] by (0.6)\n            end\n        end\n        change y by (1)\n        set [yv v] to ((Yv) * (0.9))\n        change [xv v] by ((<key (right arrow v) pressed?> - <key (left arrow v) pressed?>) * (0.1))\n    end\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [refresh level v]\nhide\nset [yv v] to [0]\nset [xv v] to [0]\nif <(Stage) = [1]> then\n    Position [6] [-215] [28]\nend\nif <(Stage) = [2]> then\n    Position [2] [-155] [-101]\nend\nif <(Stage) = [4]> then\n    Position [3] [-200] [-100]\nend\nif <(Stage) = [5]> then\n    Position [4] [-210] [32]\nend\nif <(Stage) = [6]> then\n    Position [5] [-215] [28]\nend\nif <(Stage) = [3]> then\n    Position [1] [-200] [-133]\nend\nif <(Stage) = [7]> then\n    Position [7] [-220] [-115]\nend\nif <(Stage) = [8]> then\n    Position [8] [-95] [23]\nend\nshow\nwait (0.05) seconds\n\nwhen backdrop switches to [backdrop31 v]\nstop [other scripts in sprite v]\nhide\n\ndefine Position (level) (x) (y)\ngo to x: (x) y: (y)\n\nif <(Level) = [1]> then\n    Position [1] [-200] [-133]\nend\n\nwhen I receive [play v]\nshow\nset [level v] to [1]\nPosition [1] [-215] [28]\nset [weapon amount v] to [0]\nshow\nforever\n    go to [front v] layer\n    switch costume to (the ninja2 v)\n    point in direction (90)\n    if <(y position) < [-170]> then\n        broadcast (refresh level v) and wait\n    end\n    if <(x position) > [235]> then\n        change [level v] by (1)\n        broadcast (refresh level v) and wait\n    end\n    change [yv v] by (-0.5)\n    if <key (right arrow v) pressed?> then\n        change [xv v] by (0.4)\n    end\n    if <key (left arrow v) pressed?> then\n        change [xv v] by (-0.4)\n    end\n    set [xv v] to ((Xv) * (0.9))\n    change x by (Xv)\n    if <<touching (black v)?> or <touching (wplayer v)?>> then\n        change y by (1)\n        if <<touching (black v)?> or <touching (wplayer v)?>> then\n            change y by (1)\n            if <<touching (black v)?> or <touching (wplayer v)?>> then\n                change y by (1)\n                if <<touching (black v)?> or <touching (wplayer v)?>> then\n                    change y by (1)\n                    if <<touching (black v)?> or <touching (wplayer v)?>> then\n                        change y by (1)\n                        if <<touching (black v)?> or <touching (wplayer v)?>> then\n                            change x by ((Xv) * (-1))\n                            change x by (-1)\n                            change y by (-5)\n                            change x by (1)\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change y by (Yv)\n    if <<touching (black v)?> or <touching (wplayer v)?>> then\n        change y by ((Yv) * (-1))\n        set [yv v] to [0]\n    end\n    change y by (-1)\n    if <<touching (black v)?> or <touching (wplayer v)?>> then\n        if <key (up arrow v) pressed?> then\n            set [yv v] to [7.5]\n        end\n    end\n    change y by (1)\n    point in direction (direction)\nend\n\n@BGround\n\nwhen flag clicked\nhide\nset [stage v] to [1]\ngo to x: (0) y: (2)\nforever\n    switch costume to (Stage)\nend\n\nwhen I receive [play v]\nshow\n\n@bakcground\n\nchange [color v] effect by (25)\n\nwhen flag clicked\n\nset size to (100) %\n\nwhen I start as a clone\nswitch costume to (costume1 v)\ngo to x: (0) y: (0)\ngo [backward v] (12000) layers\nforever\n    change [sine1 v] by (1)\n    set y to ((.8) * ((0) + (([sin v] of ((sine1) * (3)) ) * (4))))\nend\n\ncreate clone of (_myself_ v)\n\nswitch costume to (costume5 v)\nset [sine1 v] to [0]\nshow\ngo to x: (0) y: (0)\ngo [backward v] (1000) layers\ncreate clone of (_myself_ v)\nforever\n    change [sine1 v] by (1)\n    set y to ((0) + (([sin v] of ((sine1) * (3)) ) * (4)))\nend\n\n@WGround\n\nwhen I receive [play v]\nshow\n\nwhen flag clicked\nhide\ngo to x: (0) y: (2)\nforever\n    switch costume to (Stage)\nend\n\n@Black\n\nwhen I receive [play v]\nshow\n\nwhen flag clicked\nhide\ngo to x: (0) y: (0)\nforever\n    switch costume to (Stage)\n    set [ghost v] effect to (95)\nend\n\n@White\n\nwhen I receive [play v]\nshow\n\nwhen flag clicked\nhide\ngo to x: (0) y: (0)\nforever\n    switch costume to (Stage)\n    set [ghost v] effect to (95)\nend\n\n@portal\n\nwhen I start as a clone\ngo to x: (portalX) y: (PortalY)\nchange y by (pick random (-5) to (5))\nchange x by (pick random (-5) to (5))\npoint in direction (pick random (1) to (360))\nswitch costume to (pick random (1) to (2))\nclear graphic effects\nset size to (pick random (15) to (30)) %\nshow\nrepeat (20)\n    go to [front v] layer\n    go [backward v] (2) layers\n    move ((size) / (16)) steps\n    change [ghost v] effect by (5)\nend\ndelete this clone\n\nwhen flag clicked\nhide\n\ndefine Create Portal\ncreate clone of (_myself_ v)\n\nturn right (5) degrees\n\ngo to (mouse-pointer v)\n\ncreate clone of (_myself_ v)\ncreate clone of (_myself_ v)\ncreate clone of (_myself_ v)\n\nwhen I receive [play v]\nshow\nset [ghost v] effect to (50)\nforever\n    go to [front v] layer\n    go to x: (portalX) y: (PortalY)\n    Create Portal\n    if <(Stage) = [1]> then\n        set [portalx v] to [215]\n        set [portaly v] to [-100]\n    end\n    if <(Stage) = [3]> then\n        set [portalx v] to [220]\n        set [portaly v] to [-133]\n    end\n    if <(Stage) = [2]> then\n        set [portalx v] to [215]\n        set [portaly v] to [-100]\n    end\n    if <(Stage) = [6]> then\n        set [portalx v] to [215]\n        set [portaly v] to [-100]\n    end\n    if <(Stage) = [4]> then\n        set [portalx v] to [215]\n        set [portaly v] to [-100]\n    end\n    if <(Stage) = [5]> then\n        set [portalx v] to [215]\n        set [portaly v] to [-100]\n    end\n    if <(Stage) = [7]> then\n        set [portalx v] to [215]\n        set [portaly v] to [-21]\n    end\n    if <(Stage) = [8]> then\n        hide\n        stop [other scripts in sprite v]\n    end\nend\n\nwhen I start as a clone\nforever\n    if <(Stage) = [8]> then\n        delete this clone\n    end\nend\n\n@portal2\n\nwhen flag clicked\nshow\nset [ghost v] effect to (99)\nforever\n    go to x: (portalX) y: (PortalY)\n    if <<touching (wplayer v)?> and <touching (bplayer v)?>> then\n        change [stage v] by (1)\n        broadcast (refresh level v)\n    end\nend\n\nbroadcast (BlackScreen v)\nwait (1) seconds\n\n@Sprite1\n\nwhen I receive [blackscreen v]\nset [ghost v] effect to (100)\nshow\nrepeat (20)\n    change [ghost v] effect by (-5)\nend\nwait (1) seconds\nrepeat (20)\n    change [ghost v] effect by (5)\nend\n\nwhen flag clicked\nset [ghost v] effect to (100)\nhide\n\n@BGround2\n\nwhen flag clicked\nhide\nforever\n    go to x: (0) y: (0)\n    go to [front v] layer\n    if <(Stage) = [6]> then\n        go to [front v] layer\n        show\n    else\n        hide\n    end\nend\n\n@Sprite2\n\nwhen flag clicked\ngo to x: (0) y: (0)\ngo to [front v] layer\nhide\n\n@Sprite3\n\nwhen flag clicked\ngo to x: (0) y: (0)\ngo to [front v] layer\nshow\nforever\n    change [sine1 v] by (1)\n    set y to ((90) + (([sin v] of ((sine1) * (5)) ) * (4)))\nend\n\nwhen I receive [play v]\nhide\n\n@Sprite4\n\nwhen flag clicked\nshow\ngo to x: (0) y: (-90)\nforever\n    if <touching (mouse-pointer v)?> then\n        set [brightness v] effect to (10)\n    else\n        set [brightness v] effect to (0)\n    end\nend\n\nwhen this sprite clicked\nbroadcast (play v)\nhide\n\n@Sprite5\n\ngo to x: (0) y: (0)\n\nwhen flag clicked\nforever\n    set y to ((0) + (([sin v] of ((sine1) * (5)) ) * (4)))\n    if <(Stage) = [8]> then\n        show\n    else\n        hide\n    end\nend\n\n