Darkness II A Platformer II

Instructions:   Yay!!! 100+ Loves and Faves                     \n\n\n\nHello Guys. HeroOfWar here . This platformer is based on Diwali . It is also called as the the festival of lights . Plz like , fav and follow me\n-------------------------     Storyline -----------------------------\n\nYou are very happy o the eve of Diwali . Suddenly , The darkness spread everywhere . Now , you should save the world by escaping from different levels.

@Stage\n\nwhen flag clicked\nswitch backdrop to (1 v)\nforever\n    if <(Level) = [10]> then\n        switch backdrop to (2 v)\n    end\nend\n\nwhen flag clicked\nforever\n    play sound [The Score - Unstoppable v] until done\nend\n\n@Player\n\nwhen flag clicked\nhide\n\nwhen I receive [next level v]\nbroadcast (Restart v)\n\nwhen I receive [restart v]\ngo to x: (-219) y: (62)\n\nwhen I receive [story done v]\nbroadcast (Restart v)\nset [level v] to [1]\nshow\nswitch costume to (costume2 v)\nset [x vel v] to [0]\nforever\n    if <key (left arrow v) pressed?> then\n        switch costume to (costume1 v)\n        change [x vel v] by (-1)\n    end\n    if <key (right arrow v) pressed?> then\n        switch costume to (costume2 v)\n        change [x vel v] by (1)\n    end\n    set [x vel v] to ((x vel) * (0.9))\n    change x by (x vel)\n    if <touching (level v)?> then\n        change y by (1)\n    end\n    if <touching (level v)?> then\n        change y by (1)\n    end\n    if <touching (level v)?> then\n        change y by (1)\n    end\n    if <touching (level v)?> then\n        change y by (1)\n    end\n    if <touching (level v)?> then\n        change y by (-4)\n        change x by ((x vel) * (-1))\n        if <key (up arrow v) pressed?> then\n            if <(x vel) > [0]> then\n                set [x vel v] to [-10]\n            else\n                set [x vel v] to [10]\n            end\n            set [y vel v] to [15]\n        else\n            set [x vel v] to [0]\n        end\n    end\n    change [y vel v] by (-1)\n    change y by (y vel)\n    if <touching (level v)?> then\n        change y by ((y vel) - ((y vel) * (2)))\n        set [y vel v] to [0]\n    end\n    change y by (-1)\n    if <<touching (level v)?> and <key (up arrow v) pressed?>> then\n        set [y vel v] to [15]\n    end\n    change y by (1)\n    if <(x position) > [239]> then\n        change [level v] by (1)\n        broadcast (Next Level v)\n    end\n    if <touching (spikes v)?> then\n        broadcast (Restart v)\n    end\n    if <touching (bounce v)?> then\n        set [y vel v] to [19]\n    end\n    if <touching (lava v)?> then\n        broadcast (Restart v)\n    end\nend\n\n@Level\n\nwhen flag clicked\nhide\n\nwhen I receive [story done v]\nshow\nforever\n    switch costume to (Level)\nend\n\n@Sprite1\n\nwhen flag clicked\nhide\n\nwhen flag clicked\nforever\n    if <(Level) = [10]> then\n        hide\n    end\nend\n\nwhen I receive [story done v]\nshow\nforever\n    go to [back v] layer\n    go to (player v)\nend\n\n@Spikes\n\nwhen flag clicked\nhide\n\nwhen I receive [story done v]\nshow\nforever\n    switch costume to (Level)\nend\n\n@Lava\n\nwhen flag clicked\nforever\n    go to [back v] layer\n    set [tide v] to [0]\n    repeat (10)\n        change [tide v] by (1)\n    end\n    repeat (20)\n        change [tide v] by (-1)\n    end\n    repeat (10)\n        change [tide v] by (1)\n    end\nend\n\nwhen flag clicked\nforever\n    set y to (Tide)\n    switch costume to (Level)\nend\n\n@Enemy\n\nwhen flag clicked\nset [x v] to (x position)\nset [y v] to (y position)\nforever\n    if <touching (level v)?> then\n        go to x: (X) y: (Y)\n    else\n        set [x v] to (x position)\n        set [y v] to (y position)\n    end\nend\n\nwhen flag clicked\nforever\n    switch costume to (Level)\nend\n\nwhen flag clicked\nhide\nforever\n    if <touching (level v)?> then\n        change y by (1)\n    end\n    if <touching (level v)?> then\n        change y by (1)\n    end\n    if <touching (level v)?> then\n        change y by (1)\n    end\n    if <touching (levels v)?> then\n        change y by (1)\n    end\n    if <touching (level v)?> then\n        change y by (-4)\n        change x by ((x-vel) * (-4))\n    end\nend\n\nwhen flag clicked\nforever\n    if <touching (spikes v)?> then\n        broadcast (reset ai v)\n    end\nend\n\nwhen I receive [restart v]\ngo to x: (223) y: (94)\n\nwhen flag clicked\nforever\n    if <(Level) = [4]> then\n        show\n    end\nend\n\nwhen I receive [reset ai v]\ngo to x: (223) y: (94)\n\ndefine Phisyics\nif <(x position) < ([x position v] of [player v])> then\n    switch costume to (costume2 v)\n    change [x v] by (1)\nend\nif <([x position v] of [player v]) < (x position)> then\n    switch costume to (costume1 v)\n    change [x v] by (-1)\nend\nchange x by (x)\nif <touching (level v)?> then\n    change x by ((x) * (-1))\n    if <((y position) - (25)) < ([x position v] of [player v])> then\n        if <(x) > [0]> then\n            set [x v] to [-10]\n            set [y v] to [10]\n        else\n            set [x v] to [10]\n            set [y v] to [10]\n        end\n    else\n        set [x v] to [0]\n    end\nelse\n    set [x v] to ((x) * (0.8))\nend\nchange y by (y)\nif <touching (level v)?> then\n    change y by ((y) * (-1))\n    set [y v] to [0]\n    if <key (up arrow v) pressed?> then\n        if <(Jumping?) = [y]> then\n            set [y v] to [12]\n            set [jumping? v] to [n]\n        end\n    end\nelse\n    change [y v] by (-1)\n    set [jumping? v] to [y]\nend\n\ndefine Restart\nset [x v] to [0]\nset [y v] to [0]\ngo to x: (223) y: (94)\n\nwhen flag clicked\nRestart\nset [level v] to [1]\n\nwhen I receive [restart danger! v]\nRestart\n\nwhen flag clicked\nhide\nforever\n    if <(Level) = [4]> then\n        Phisyics\n        show\n    else\n        hide\n    end\nend\n\nwhen flag clicked\nforever\n    if <touching (player v)?> then\n        broadcast (Restart v)\n    end\nend\n\nwhen I receive [restart v]\ngo to x: (223) y: (94)\n\n@Text\n\nwhen flag clicked\nhide\n\nwhen flag clicked\nhide\n\nwhen I receive [story done v]\nshow\nforever\n    go [forward v] (9999) layers\n    go [forward v] (9999) layers\nend\n\nwhen I receive [story done v]\nshow\nforever\n    switch costume to (Level)\nend\n\n@Sprite3\n\nwhen flag clicked\nhide\n\nwhen flag clicked\nforever\n    if <(Level) = [10]> then\n        hide\n    end\nend\n\nwhen this sprite clicked\nchange [level v] by (1)\nbroadcast (Restart v)\n\nwhen flag clicked\nhide\n\nwhen flag clicked\nhide\n\nwhen I receive [story done v]\nshow\nforever\n    go [forward v] (9999999999999999999999999999999) layers\nend\n\nwhen I receive [story done v]\nshow\nforever\n    go [forward v] (9999999999999999999999999999999) layers\nend\n\nwhen I receive [story done v]\nshow\nforever\n    go [forward v] (9999999999999999999999999999999) layers\nend\n\n@Sprite2\n\nwhen flag clicked\nhide\n\nwhen I receive [story done v]\nhide\n\nwhen I receive [intro done v]\nshow\ngo to [back v] layer\n\n@Sprite4\n\nwhen flag clicked\nhide\n\nwhen I receive [intro done v]\nhide\ngo to x: (-446) y: (0)\nshow\nswitch costume to (costume1 v)\nrepeat (80)\n    go to [front v] layer\n    change x by (5)\nend\nwait (5) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nwait (1) seconds\ngo to x: (-446) y: (0)\nswitch costume to (costume2 v)\nrepeat (80)\n    go to [front v] layer\n    change x by (5)\nend\nwait (1) seconds\ngo to x: (-446) y: (0)\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nrepeat (80)\n    go to [front v] layer\n    change x by (5)\nend\nwait (3) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\nbroadcast (story done v)\n\n@Sprite5\n\nwhen flag clicked\nhide\nwait (4) seconds\nrepeat (10)\n    go to [front v] layer\n    hide\n    wait (0.05) seconds\n    show\nend\nshow\n\nwhen flag clicked\nwait (5) seconds\nrepeat (6)\n    go to [front v] layer\n    repeat (10)\n        go to [front v] layer\n        change [mosaic v] effect by (5)\n    end\n    wait (0.05) seconds\n    repeat (10)\n        change [mosaic v] effect by (-5)\n    end\nend\n\nwhen I receive [intro done v]\nhide\n\nwhen I receive [intro done v]\nhide\n\n@Sprite6\n\nwhen flag clicked\nhide\nwait (4) seconds\nrepeat (10)\n    go to [front v] layer\n    hide\n    wait (0.05) seconds\n    show\nend\nshow\n\nwhen flag clicked\nwait (5) seconds\nrepeat (6)\n    go to [front v] layer\n    repeat (10)\n        change [mosaic v] effect by (5)\n    end\n    wait (0.05) seconds\n    repeat (10)\n        change [mosaic v] effect by (-5)\n    end\nend\n\nwhen I receive [intro done v]\nhide\n\nwhen I receive [intro done v]\nhide\n\n@Sprite7\n\nwhen flag clicked\nhide\nwait (4) seconds\nrepeat (10)\n    go to [front v] layer\n    hide\n    wait (0.05) seconds\n    show\nend\nshow\n\nwhen flag clicked\nwait (5) seconds\nrepeat (6)\n    go to [front v] layer\n    repeat (10)\n        change [mosaic v] effect by (5)\n    end\n    wait (0.05) seconds\n    repeat (10)\n        change [mosaic v] effect by (-5)\n    end\nend\n\nwhen I receive [intro done v]\nhide\n\nwhen I receive [intro done v]\nhide\n\n@Sprite8\n\nwhen I receive [intro done v]\nhide\n\nwhen flag clicked\nhide\nwait (4) seconds\nrepeat (10)\n    go to [front v] layer\n    hide\n    wait (0.05) seconds\n    show\nend\nshow\n\nwhen flag clicked\nwait (5) seconds\nrepeat (6)\n    go to [front v] layer\n    repeat (10)\n        change [mosaic v] effect by (5)\n    end\n    wait (0.05) seconds\n    repeat (10)\n        change [mosaic v] effect by (-5)\n    end\nend\n\nwhen I receive [intro done v]\nhide\n\n@Sprite9\n\nwhen flag clicked\nshow\n\nwhen I receive [intro done v]\nhide\n\n@HeroOfWar\n\nwhen flag clicked\npoint in direction (90)\nhide\ngo to [front v] layer\ngo to x: (-350) y: (9)\nwait (1) seconds\nshow\nrepeat (48)\n    change x by (7)\nend\n\nwhen flag clicked\nwait (4) seconds\nrepeat (4)\n    repeat (25)\n        change [ghost v] effect by (10)\n    end\n    wait (0.5) seconds\n    repeat (25)\n        change [ghost v] effect by (-10)\n    end\nend\nhide\nbroadcast (Intro done v)\n\n@Confetti\n\nwhen flag clicked\nhide\n\nwhen I start as a clone\nshow\nclear graphic effects\npoint in direction (90)\nswitch costume to (pick random (1) to (6))\nset size to (pick random (50) to (150)) %\nset [brightness v] effect to (pick random (-25) to (25))\ngo to [front v] layer\nshow\nset [s v] to (pick random (1) to (2))\nif <(S) = [1]> then\n    go to x: (-240) y: (-1000)\n    set [v v] to (pick random (5) to (10))\n    set [d v] to [5]\nelse\n    if <(S) = [2]> then\n        set [v v] to (pick random (-5) to (-10))\n        go to x: (240) y: (-1000)\n        set [d v] to [-5]\n    end\nend\nset [i v] to (pick random (15) to (30))\nchange y by (I)\nrepeat until <(y position) < [-179]>\n    turn right (D) degrees\n    change [ghost v] effect by (2)\n    change y by (I)\n    change [i v] by (-1)\n    change x by (V)\n    set [v v] to ((V) * (.995))\nend\ndelete this clone\n\nwhen flag clicked\nforever\n    if <(Level) = [10]> then\n        hide\n        create clone of (_myself_ v)\n    end\nend\n\n@Notification\n\nwhen flag clicked\nhide\ngo to x: (0) y: (50)\nforever\n    wait (pick random (4) to (10)) seconds\n    show\n    repeat (6)\n        change y by (-10)\n    end\n    wait (1) seconds\n    repeat (6)\n        change y by (10)\n    end\n    hide\nend\n\n@Sprite10\n\nwhen flag clicked\nhide\nhide\nforever\n    if <(Level) = [10]> then\n        show\n    end\n    if <touching (player v)?> then\n        hide\n    end\nend\n\n@Sprite11\n\nwhen flag clicked\nhide\nhide\nforever\n    if <(Level) = [10]> then\n        show\n    end\n    if <touching (player v)?> then\n        hide\n    end\nend\n\n@Thumbnail\n\nwhen flag clicked\nforever\n    go to [front v] layer\n    go [forward v] (99999999999999999999999999999999999999999999999) layers\n    go [forward v] (99999999999999999999999999999999999999999999999) layers\n    go [forward v] (99999999999999999999999999999999999999999999999) layers\n    go [forward v] (99999999999999999999999999999999999999999999999) layers\n    set [ghost v] effect to (100)\n    go to x: (0) y: (0)\nend\n\nwhen flag clicked\nforever\n    go to [front v] layer\n    go [forward v] (99999999999999999999999999999999999999999999999) layers\n    go [forward v] (99999999999999999999999999999999999999999999999) layers\n    go [forward v] (99999999999999999999999999999999999999999999999) layers\n    go [forward v] (99999999999999999999999999999999999999999999999) layers\n    set [ghost v] effect to (100)\n    go to x: (0) y: (0)\nend\n\n