Night | Platformer

Instructions: Part 2 is out!\n- https://scratch.mit.edu/projects/625465495/\nPart 3 - https://scratch.mit.edu/projects/628351618\n\nHi, welcome to my new platformer, night!\n\nConsider leaving a like and love. Also, please follow me.\n\nIf you propose this to be featured, I will be very appreciated. :)\n\nYou can also put this project to whatever studio you want!\n\n✅How to play?\nWAD or arrows key to move! (No mobile control sorry)\nAvoid spikes!\nIt contains a parallax too!\nPress skip to skip!\nPress space to activate sword (No use at part 1)\nOthers are in-game!

@Stage\n\nwhen I receive [start v]\nforever\n    play sound [Nebula v] until done\nend\n\n@Player\n\nwhen I receive [reset v]\nshow\ngo [forward v] (1) layers\ngo to x: (-199) y: (0)\n\nwhen I receive [start v]\nforever\n    Codes\n    if <[] = [2]> then\n        stop [this script v]\n    end\nend\n\nwhen I start as a clone\nswitch costume to (clone v)\nrepeat (10)\n    change [ghost v] effect by (7.3)\n    change [color v] effect by (7)\n    change size by (-3)\nend\ndelete this clone\n\nwhen flag clicked\nswitch costume to (player v)\nset [level v] to [1]\nbroadcast (Reset v)\n\ndefine Codes\nforever\n    create clone of (_myself_ v)\n    if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n        change [x speed v] by (-1)\n        switch costume to (left v)\n    else\n        IDK\n    end\n    if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n        change [x speed v] by (1)\n        switch costume to (right v)\n    else\n        IDK\n    end\n    if <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n        switch costume to (up v)\n    else\n        IDK\n    end\n    if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> and <<key (left arrow v) pressed?> or <key (a v) pressed?>>> then\n        switch costume to (left2 v)\n    else\n        IDK\n    end\n    if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> and <<key (right arrow v) pressed?> or <key (d v) pressed?>>> then\n        switch costume to (right2 v)\n    else\n        IDK\n    end\n    set [x speed v] to ((x speed) * (0.85))\n    change x by (x speed)\n    if <touching (ground v)?> then\n        change y by (1)\n    end\n    if <touching (ground v)?> then\n        change y by (1)\n    end\n    if <touching (ground v)?> then\n        change y by (1)\n    end\n    if <touching (ground v)?> then\n        change y by (1)\n    end\n    if <touching (ground v)?> then\n        change y by (-4)\n        change x by ((x speed) * (-1))\n        if <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n            if <(x speed) > [0]> then\n                set [x speed v] to [-7]\n            else\n                set [x speed v] to [7]\n            end\n            set [y speed v] to [9]\n        else\n            set [x speed v] to [0]\n        end\n    end\n    change [y speed v] by (-0.5)\n    change y by (y speed)\n    if <touching (ground v)?> then\n        change y by ((y speed) - ((y speed) * (2)))\n        set [y speed v] to [0]\n    end\n    change y by (-1)\n    if <<touching (ground v)?> and <<key (up arrow v) pressed?> or <key (w v) pressed?>>> then\n        set [y speed v] to [8]\n    end\n    change y by (1)\n    change y by ((y speed) * (0.1))\n    if <<(x position) > [239]> and <<(Level) > [0]> and <(Level) < [14]>>> then\n        change [level v] by (1)\n        go to x: (-220) y: (-95)\n    end\n    if <touching (spikes v)?> then\n        switch costume to (player2 v)\n        play sound [Rip v] until done\n        go to x: (-220) y: (-95)\n        wait (0.01) seconds\n        switch costume to (player v)\n    end\n    if <touching (spikes2 v)?> then\n        switch costume to (player2 v)\n        play sound [Rip v] until done\n        go to x: (-220) y: (-95)\n        wait (0.01) seconds\n        switch costume to (player v)\n    end\n    if <touching (enemy v)?> then\n        switch costume to (player2 v)\n        play sound [Rip v] until done\n        go to x: (-220) y: (-95)\n        wait (0.01) seconds\n        switch costume to (player v)\n    end\n    if <touching (speed up v)?> then\n        change [x speed v] by (6)\n    end\n    if <touching (trampoline v)?> then\n        change [y speed v] by (8)\n    end\n    if <(y position) < [-180]> then\n        switch costume to (player2 v)\n        play sound [Rip v] until done\n        go to x: (-220) y: (-95)\n        wait (0.01) seconds\n        switch costume to (player v)\n    end\nend\n\ndefine IDK\nif <<<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<key (up arrow v) pressed?> or <key (w v) pressed?>>> or <<key (left arrow v) pressed?> or <key (a v) pressed?>>> then\n\nwhen flag clicked\nbroadcast (start v)\n\nwhen I receive [n v]\ngo to x: (-220) y: (-95)\n\n@Ground\n\nwhen I receive [start v]\nforever\n    switch costume to (Level)\nend\n\n@light\n\nwhen I receive [start v]\nforever\n    go to (player v)\nend\n\n@light2\n\nwhen I receive [start v]\nforever\n    go to (player v)\nend\n\n@SPikes\n\nwhen I receive [start v]\nforever\n    switch costume to (Level)\nend\n\n@words\n\nwhen I receive [start v]\nforever\n    switch costume to (Level)\nend\n\n@Thumbnail\n\nwhen flag clicked\ngo [forward v] (3) layers\ngo to x: (0) y: (0)\ngo to [front v] layer\nshow\nclear graphic effects\nset [ghost v] effect to (100)\n\n@Speed up\n\nwhen I receive [start v]\nforever\n    switch costume to (Level)\nend\n\n@Trampoline\n\nwhen I receive [start v]\nforever\n    switch costume to (Level)\n    go to [front v] layer\nend\n\nset [level v] to [013]\n\n@SPikes2\n\nwhen I receive [start v]\ngo to x: (0) y: (0)\nhide\nset [guess v] to [0]\nforever\n    switch costume to (Level)\n    if <(Level) = [9]> then\n        show\n    end\n    if <(Level) = [11]> then\n        show\n        wait (pick random (0.5) to (0.8777)) seconds\n        set [guess v] to (pick random (1) to (5))\n    end\n    if <(Level) = [12]> then\n        hide\n    end\n    if <(guess) = [1]> then\n        go to x: (0) y: (0)\n    end\n    if <(guess) = [2]> then\n        go to x: (-107) y: (-11)\n    end\n    if <(guess) = [3]> then\n        go to x: (-210) y: (-14)\n    end\n    if <(guess) = [4]> then\n        go to x: (128) y: (-15)\n    end\n    if <(guess) = [5]> then\n        go to x: (235) y: (-13)\n    end\nend\n\nset [level v] to [9]\n\n@sword\n\nwhen flag clicked\nset [level v] to [1]\nset [enemy v] to [0]\nset [x speed v] to [0]\nset [y speed v] to [0]\nhide\npoint in direction (90)\nswitch costume to (sword v)\ngo [forward v] (1) layers\nset [s v] to [0]\ngo to x: (-1) y: (46)\nif <(S) = [1]> then\n    switch costume to (sword2 v)\nend\nforever\n    if <(Level) = [13]> then\n        show\n    end\n    if <<(Level) = [14]> and <(S) = [0]>> then\n        hide\n    end\nend\n\nwhen flag clicked\nforever\n    if <(S) = [1]> then\n        go to (player v)\n        if <key (space v) pressed?> then\n            if <touching (enemy v)?> then\n                set [enemy v] to [1]\n                set [enemy v] to [0]\n            end\n            if <(costume [number v]) = [2]> then\n                repeat (6)\n                    -360\n                end\n            else\n                repeat (6)\n                    360\n                end\n            end\n        end\n        if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n            switch costume to (sword2 v)\n            point in direction (49)\n        end\n        if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n            switch costume to (sword3 v)\n            point in direction (131)\n        end\n    end\nend\n\ndefine 360\nturn right (60) degrees\n\ndefine -360\nturn left (60) degrees\n\nwhen flag clicked\nforever\n    if <touching (player v)?> then\n        set [s v] to [1]\n        switch costume to (sword2 v)\n        point in direction (49)\n        stop [this script v]\n    end\nend\n\n@Fake\n\nwhen I receive [start v]\nforever\n    switch costume to (Level)\nend\n\n@Sprite1\n\nwhen flag clicked\nshow\ngo to x: (193) y: (-148)\nforever\n    if <(Level) = [14]> then\n        hide\n    end\nend\n\nwhen this sprite clicked\nif <(Level) = [14]> then\nelse\n    go to x: (193) y: (-148)\n    change [level v] by (1)\n    broadcast (n v)\nend\n\nwhen flag clicked\nshow\ngo to [front v] layer\n\n@Sprite2\n\nwhen flag clicked\ngo to [back v] layer\nforever\n    go to x: ((mouse x) / (15)) y: ((mouse y) / (15))\nend\n\n