Sunlight: A Platformer
@Stage\n\n@Platformer Guy\n\nwhen flag clicked\nhide\ngo to [front v] layer\nset [wall jump v] to [0]\nset [jumping v] to [0]\nset [y velocity v] to [0]\nset [up jump v] to [0]\n\ndefine Tick\nchange y by (Y velocity)\nif <not <<<key (right arrow v) pressed?> or <key (left arrow v) pressed?>> or <<key (a v) pressed?> or <key (d v) pressed?>>>> then\n    if <touching (levels v)?> then\n        set [x velocity v] to ((X velocity) * (0.95))\n        set [x acceleraion v] to ((X acceleraion) * (0.25))\n    end\n    if <touching (levels 2 v)?> then\n        set [x velocity v] to ((X velocity) * (0.5))\n        set [x acceleraion v] to ((X acceleraion) * (0.25))\n    end\nend\nif <not <<touching (levels v)?> or <touching (levels 2 v)?>>> then\n    change [y velocity v] by (-1)\nend\nif <(Y velocity) < [-40]> then\n    set [y velocity v] to [-40]\nend\nif <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n    switch costume to (costume1 v)\n    if <(Jumping) = [0]> then\n        change [x velocity v] by (0.25)\n    end\n    if <(Jumping) = [0]> then\n        set [x velocity v] to [4]\n    end\nend\nif <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n    switch costume to (costume2 v)\n    if <(Jumping) = [0]> then\n        change [x velocity v] by (-0.25)\n    end\n    if <(Jumping) = [0]> then\n        set [x velocity v] to [-4]\n    end\nend\nif <<touching (levels v)?> or <touching (levels 2 v)?>> then\n    if <(Y velocity) < [0]> then\n        set [jumping v] to [0]\n        set [y velocity v] to [0]\n        if <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n            set [y velocity v] to [12]\n        end\n    else\n        change y by ((Y velocity) * (-1))\n        set [y velocity v] to ((Y velocity) * (-1))\n    end\nend\nif <<touching (levels v)?> or <touching (levels 2 v)?>> then\n    change y by (1)\n    if <<touching (levels v)?> or <touching (levels 2 v)?>> then\n        change y by (1)\n        if <<touching (levels v)?> or <touching (levels 2 v)?>> then\n            change y by (1)\n            if <<touching (levels v)?> or <touching (levels 2 v)?>> then\n                change y by (1)\n                if <<touching (levels v)?> or <touching (levels 2 v)?>> then\n                    change y by (1)\n                    if <<touching (levels v)?> or <touching (levels 2 v)?>> then\n                        change y by (1)\n                        if <<touching (levels v)?> or <touching (levels 2 v)?>> then\n                            change y by (1)\n                            if <<touching (levels v)?> or <touching (levels 2 v)?>> then\n                                change y by (1)\n                                if <<touching (levels v)?> or <touching (levels 2 v)?>> then\n                                    change y by (1)\n                                    if <<touching (levels v)?> or <touching (levels 2 v)?>> then\n                                        change y by (1)\n                                        if <<touching (levels v)?> or <touching (levels 2 v)?>> then\n                                            change y by (1)\n                                            if <<touching (levels v)?> or <touching (levels 2 v)?>> then\n                                                change y by (1)\n                                                if <<touching (levels v)?> or <touching (levels 2 v)?>> then\n                                                    change y by (1)\n                                                    if <<touching (levels v)?> or <touching (levels 2 v)?>> then\n                                                        change y by (1)\n                                                        if <<touching (levels v)?> or <touching (levels 2 v)?>> then\n                                                            change y by (1)\n                                                            if <<touching (levels v)?> or <touching (levels 2 v)?>> then\n                                                                change y by (1)\n                                                                if <<touching (levels v)?> or <touching (levels 2 v)?>> then\n                                                                    change y by (1)\n                                                                    if <<touching (levels v)?> or <touching (levels 2 v)?>> then\n                                                                        change y by (1)\n                                                                        if <<touching (levels v)?> or <touching (levels 2 v)?>> then\n                                                                            change y by (1)\n                                                                            if <<touching (levels v)?> or <touching (levels 2 v)?>> then\n                                                                                change y by (1)\n                                                                                if <<touching (levels v)?> or <touching (levels 2 v)?>> then\n                                                                                    change y by (1)\n                                                                                    if <<touching (levels v)?> or <touching (levels 2 v)?>> then\n                                                                                        change y by (1)\n                                                                                        if <<touching (levels v)?> or <touching (levels 2 v)?>> then\n                                                                                            change y by (1)\n                                                                                        end\n                                                                                    end\n                                                                                end\n                                                                            end\n                                                                        end\n                                                                    end\n                                                                end\n                                                            end\n                                                        end\n                                                    end\n                                                end\n                                            end\n                                        end\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\nchange [x velocity v] by (X acceleraion)\nchange x by (X velocity)\nif <<touching (levels v)?> or <touching (levels 2 v)?>> then\n    change y by (1)\n    if <<touching (levels v)?> or <touching (levels 2 v)?>> then\n        change y by (1)\n        if <<touching (levels v)?> or <touching (levels 2 v)?>> then\n            change y by (1)\n            if <<touching (levels v)?> or <touching (levels 2 v)?>> then\n                change y by (1)\n                if <<touching (levels v)?> or <touching (levels 2 v)?>> then\n                    change y by (1)\n                    if <<touching (levels v)?> or <touching (levels 2 v)?>> then\n                        change y by (-5)\n                    end\n                end\n            end\n        end\n    end\nend\nif <<touching (levels v)?> or <touching (levels 2 v)?>> then\n    if <(X velocity) > [0]> then\n        set [x velocity v] to [0]\n        if <<touching (levels v)?> or <touching (levels 2 v)?>> then\n            if <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n                set [jumping v] to [1]\n                set [y velocity v] to [8]\n                set [x velocity v] to [-8]\n                if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n                    set [x acceleraion v] to [2]\n                else\n                    set [x acceleraion v] to [0]\n                end\n            end\n            change x by (-1)\n            if <<touching (levels v)?> or <touching (levels 2 v)?>> then\n                change x by (-1)\n                if <<touching (levels v)?> or <touching (levels 2 v)?>> then\n                    change x by (-1)\n                    if <<touching (levels v)?> or <touching (levels 2 v)?>> then\n                        change x by (-1)\n                        if <<touching (levels v)?> or <touching (levels 2 v)?>> then\n                            change x by (-1)\n                            if <<touching (levels v)?> or <touching (levels 2 v)?>> then\n                                change x by (-1)\n                                if <<touching (levels v)?> or <touching (levels 2 v)?>> then\n                                    change x by (-1)\n                                    if <<touching (levels v)?> or <touching (levels 2 v)?>> then\n                                        change x by (-1)\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    else\n        set [x velocity v] to [0]\n        if <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n            set [jumping v] to [1]\n            set [y velocity v] to [8]\n            set [x velocity v] to [8]\n            if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n                set [x acceleraion v] to [-2]\n            else\n                set [x acceleraion v] to [0]\n            end\n        end\n        if <<touching (levels v)?> or <touching (levels 2 v)?>> then\n            change x by (1)\n            if <<touching (levels v)?> or <touching (levels 2 v)?>> then\n                change x by (1)\n                if <<touching (levels v)?> or <touching (levels 2 v)?>> then\n                    change x by (1)\n                    if <<touching (levels v)?> or <touching (levels 2 v)?>> then\n                        change x by (1)\n                        if <<touching (levels v)?> or <touching (levels 2 v)?>> then\n                            change x by (1)\n                            if <<touching (levels v)?> or <touching (levels 2 v)?>> then\n                                change x by (1)\n                                if <<touching (levels v)?> or <touching (levels 2 v)?>> then\n                                    change x by (1)\n                                    if <<touching (levels v)?> or <touching (levels 2 v)?>> then\n                                        change x by (1)\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\nif <(X acceleraion) < [-4]> then\n    if <(Jumping) = [0]> then\n        set [x acceleraion v] to [-4]\n    end\nend\nif <(X acceleraion) > [4]> then\n    if <(Jumping) = [0]> then\n        set [x acceleraion v] to [4]\n    end\nend\nif <(X velocity) > [6]> then\n    if <(Jumping) = [0]> then\n        set [x velocity v] to [6]\n    end\nend\nif <(X velocity) < [-6]> then\n    if <(Jumping) = [0]> then\n        set [x velocity v] to [-6]\n    end\nend\nif <(Jumping) = [1]> then\n    if <(X acceleraion) < [-4]> then\n        if <(Jumping) = [1]> then\n            set [x acceleraion v] to [-4]\n        end\n    end\n    if <(X acceleraion) > [4]> then\n        if <(Jumping) = [1]> then\n            set [x acceleraion v] to [4]\n        end\n    end\n    if <(X velocity) > [10]> then\n        if <(Jumping) = [1]> then\n            set [x velocity v] to [10]\n        end\n    end\n    if <(X velocity) < [-10]> then\n        if <(Jumping) = [1]> then\n            set [x velocity v] to [-10]\n        end\n    end\nend\nif <(Jumping) = [1]> then\n    change [wall time v] by (1)\nend\nif <<(Wall time) > [8]> or <(Wall time) = [8]>> then\n    set [wall time v] to [0]\n    set [jumping v] to [0]\nend\nif <(Jumping) = [0]> then\n    set [x acceleraion v] to ((X acceleraion) * (0.25))\nend\nif <key (r v) pressed?> then\n    go to x: (-200) y: (-130)\n    set [wall jump v] to [0]\n    set [jumping v] to [0]\n    set [y velocity v] to [0]\n    set [up jump v] to [0]\n    set [x acceleraion v] to [0]\n    set [x velocity v] to [0]\nend\nif <<(y position) < [-178]> or <touching (death v)?>> then\n    go to x: (-200) y: (-130)\n    set [wall jump v] to [0]\n    set [jumping v] to [0]\n    set [y velocity v] to [0]\n    set [up jump v] to [0]\n    set [x acceleraion v] to [0]\n    set [x velocity v] to [0]\n    if <(Difficulty) = [.5]> then\n        change [light v] by (-.05)\n    end\n    if <(Difficulty) = [1]> then\n        change [light v] by (-.03)\n    end\nend\nif <key (g v) pressed?> then\n    broadcast (Next Level v)\n    change [light v] by (-.20)\n    go to x: (-200) y: (-130)\n    set [wall jump v] to [0]\n    set [jumping v] to [0]\n    set [y velocity v] to [0]\n    set [up jump v] to [0]\n    set [x acceleraion v] to [0]\n    set [x velocity v] to [0]\n    change [level # v] by (1)\n    wait until <not <key (g v) pressed?>>\nend\nif <(x position) > [228]> then\n    go to x: (-200) y: (-130)\n    broadcast (Next Level v)\n    change [level # v] by (1)\n    set [wall jump v] to [0]\n    set [jumping v] to [0]\n    set [y velocity v] to [0]\n    set [up jump v] to [0]\n    set [x acceleraion v] to [0]\n    set [x velocity v] to [0]\nend\n\nwhen flag clicked\nset [level # v] to [1]\nset size to (100) %\ngo to [front v] layer\n\nwhen I receive [start v]\ngo to [front v] layer\ngo to x: (-200) y: (-130)\nshow\nforever\n    if <(Pause) = [0 ]> then\n        Tick\n    end\nend\n\nforever\n    set [light v] to [1]\nend\n\n@Sunlight Engine\n\nset pen (color v) to (15)\nset pen (brightness v) to (0)\nset pen (saturation v) to (100)\npen down\n\nchange pen size by (-5)\n\nwhen flag clicked\nhide variable [sun light level v]\nerase all\nset [light v] to [1]\ngo to x: (800) y: (800)\n\nwhen flag clicked\ngo to x: (800) y: (800)\nforever\n    Tick\nend\n\nwhen I receive [start v]\nforever\n    if <(Pause) = [1]> then\nend\n\ndefine Tick\nerase all\npen down\nset pen size to (1200)\nset pen (color v) to (15)\nset pen (brightness v) to (0)\nset [count v] to [0]\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\nchange pen size by (-5)\npen down\nchange pen (brightness v) by (Light)\nchange pen size by (-5)\npen down\n\nTick\n\n\n\nchange [light v] by (1)\n\nwhen flag clicked\nforever\n    play sound [They Might Be Giants - Jessica v] until done\nend\n\nset [light v] to [1]\n\nchange volume by (-10)\n\nwhen flag clicked\nforever\n    set volume to ((Light) * (25)) %\nend\n\nset volume to () %\n\nwhen I receive [win v]\nshow variable [sun light level v]\nset [sun light level v] to ((Light) * (100))\nforever\n    set [light v] to ((Sun Light Level) / (100))\nend\n\n@Text\n\nwhen flag clicked\ngo to x: (0) y: (0)\ngo to [front v] layer\nshow\n\nwhen I receive [start v]\nhide\n\n@Play Button\n\nwhen flag clicked\nshow\ngo to x: (100) y: (-59)\nforever\n    if <touching (mouse-pointer v)?> then\n        set size to (120) %\n        if <<touching (mouse-pointer v)?> and <mouse down?>> then\n            broadcast (Start v)\n            hide\n        end\n    else\n        set size to (100) %\n    end\nend\n\n@Difficulty\n\nwhen flag clicked\nshow\nswitch costume to (normal v)\ngo to x: (-110) y: (-117)\nforever\n    if <touching (mouse-pointer v)?> then\n        set size to (120) %\n        if <<touching (mouse-pointer v)?> and <mouse down?>> then\n            next costume\n            wait until <not <mouse down?>>\n        end\n    else\n        set size to (100) %\n    end\n    if <(costume [name v]) = [Easy]> then\n        set [difficulty v] to [1.5]\n    end\n    if <(costume [name v]) = [Normal]> then\n        set [difficulty v] to [1]\n    end\n    if <(costume [name v]) = [Hard]> then\n        set [difficulty v] to [.5]\n    end\nend\n\nwhen I receive [start v]\nhide\nforever\n    if <(Pause) = [1]> then\n        show\n        go to [front v] layer\n    end\n    if <(Pause) = [0]> then\n        hide\n    end\nend\n\n@Pause Screen\n\nwhen flag clicked\nset [pause v] to [0]\ngo to x: (0) y: (0)\nhide\n\nwhen I receive [start v]\nforever\n    if <key (space v) pressed?> then\n        show\n        go to [front v] layer\n        set [ghost v] effect to (35)\n        set [pause v] to [1]\n        wait until <not <key (space v) pressed?>>\n        wait until <key (space v) pressed?>\n        set [pause v] to [0]\n        hide\n        wait until <not <key (space v) pressed?>>\n    end\nend\n\n@levels 2\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\nswitch costume to (1 v)\n\nwhen I receive [start v]\nshow\n\nwhen I receive [next level v]\nnext costume\ngo to [front v] layer\nif <(costume [number v]) = [15]> then\n    broadcast (Win v)\nend\n\nforever\n\n@Light Orb\n\nwhen flag clicked\nhide\nset [color v] effect to (0)\ngo to x: (40) y: (-60)\nforever\n    go to [front v] layer\n    set [ghost v] effect to (40)\nend\n\nwhen I receive [start v]\nshow\nwait until <<not <(costume [number v]) = [1]>> or <touching (platformer guy v)?>>\nif <touching (platformer guy v)?> then\n    hide\n    change [light v] by (.10)\n    if <(Light) > [1]> then\n        set [light v] to [1]\n    end\nend\n\nchange [brightness v] effect by (25)\n\nwhen I receive [next level v]\nif <(Level #) = [2]> then\n    go to x: (-44) y: (151)\n    broadcast (Tick v)\nend\nif <(Level #) = [3]> then\n    go to x: (0) y: (-160)\n    broadcast (Tick v)\nend\nif <(Level #) = [4]> then\n    go to x: (32) y: (-125)\n    broadcast (Tick v)\nend\nif <(Level #) = [5]> then\n    go to x: (130) y: (-60)\n    broadcast (Tick v)\nend\nif <(Level #) = [6]> then\n    go to x: (78) y: (-60)\n    broadcast (Tick v)\nend\nif <<<(Level #) = [7]> and <<(Light) < [.5]> or <(Light) = [.5]>>> and <<(Difficulty) = [1.5]> or <(Difficulty) = [1]>>> then\n    go to x: (-130) y: (-142)\n    broadcast (Tick v)\nelse\n    if <(Level #) = [7]> then\n        hide\n    end\nend\nif <(Level #) = [8]> then\n    go to x: (-130) y: (145)\n    broadcast (Tick v)\nend\nif <(Level #) = [9]> then\n    go to x: (-77) y: (151)\n    broadcast (Tick v)\nend\nif <(Level #) = [10]> then\n    go to x: (-61) y: (-53)\n    broadcast (Tick v)\nend\nif <(Level #) = [11]> then\n    go to x: (-16) y: (-148)\n    broadcast (Tick v)\nend\nif <(Level #) = [12]> then\n    go to x: (96) y: (-129)\n    broadcast (Tick v)\nend\nif <(Level #) = [13]> then\n    go to x: (96) y: (-129)\n    broadcast (Tick v)\nend\n\n\n\n\n\n\n\n\n\ndefine Tick\nshow\nwait until <<not <(costume [number v]) = [1]>> or <touching (platformer guy v)?>>\nif <touching (platformer guy v)?> then\n    hide\n    change [light v] by (.10)\n    if <(Light) > [1]> then\n        set [light v] to [1]\n    end\nend\n\nTick\n\nwhen I receive [tick v]\nTick\n\nforever\n    set [light v] to [1]\nend\n\nbroadcast (Next Level v)\n\nwhen I receive [fail v]\nforever\n    hide\nend\n\n@Death\n\nwhen flag clicked\nhide\ngo to x: (0) y: (0)\nswitch costume to (1 v)\n\nwhen I receive [start v]\nshow\ngo to [front v] layer\n\nwhen I receive [next level v]\nnext costume\n\nforever\n    set [light v] to [1]\nend\n\n@Flashlight\n\nwhen flag clicked\ngo to [front v] layer\nhide\n\nwhen I receive [start v]\nforever\n    go to (platformer guy v)\n    if <<(Light) = [.5]> or <(Light) < [.5]>> then\n        show\n    else\n        hide\n    end\nend\n\n@Death Screen\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\nwait (1) seconds\nforever\n    go to [front v] layer\n    if <(Light) < [0]> then\n        show\n        broadcast (Fail v)\n    end\nend\n\n
Welcome to Sunlight: A Platformer\n\nTo play Press the button that says play\n\nIn Sunlight your goal is to make it to the end of game without the sunlight running out. \n\nThere are three different modes: Easy, Normal and Hard. The Mode changes how quickly the sunlight disappears.\n\nOn most levels there will be one light orb that restores some sunlight. Once 50% of the sunlight is gone your flashlight will turn on and give you some light to see by.\n\nUse WASD or arrow keys to move.\nRestart a Level by pressing R.\nSkip a Level with G but it will cost you!\nSpacebar to Pause and change game mode in game.