Red Ninja(discontinued) Platformer

Instructions: Arrow keys or WASD to move. Do not touch spikes, cacti, or lava. currently there are 2 complete stages, grasslands and desert, Adding more soon. comment any bugs if you find any. Plz read all the way down :)\n\nOct 13 2020: Lava islands in progress!\n\nOct 15 2020: reshared to add ninja stars! working on monsters. mouse to aim, space to fire.\n\nOct 16 2020: Monsters don't take damage from ninja stars yet.\n\nOct 23 2020: Will still update every once in a while(sorry for the reshare you can kill monsters now). Check out @AstronautJogi’s blue ninja master!\n\nJun 19 2021: I am back on scratch guys! It’s been a while

@Stage\n\n@Ninja\n\ndefine Spin off screen\nset [dead? v] to [1]\nchange [player death v] by (1)\nrepeat (20)\n    change [ghost v] effect by (5)\nend\n\ndefine reset\nclear graphic effects\ngo to x: (-200) y: (-50)\npoint in direction (90)\nset [dead? v] to [0]\nset [x v v] to [0]\nset [y v v] to [0]\nset size to (100) %\nshow\n\nwhen I receive [next level v]\nset [change? v] to [1]\nreset\nset [change? v] to [0]\n\nwhen flag clicked\nbroadcast (start game v)\n\nwhen I receive [start game v]\nset [level v] to [1]\nset [dead? v] to [0]\nset size to (100) %\nreset\nforever\n    go to [front v] layer\n    if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n        switch costume to (right v)\n        change [x v v] by (.9)\n    end\n    if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n        switch costume to (left v)\n        change [x v v] by (-.9)\n    end\n    set [x v v] to ((X v) * (0.9))\n    change x by (X v)\n    if <touching (ground v)?> then\n        change y by (2)\n        if <touching (ground v)?> then\n            change y by (2)\n            if <touching (ground v)?> then\n                change y by (2)\n                if <touching (ground v)?> then\n                    change y by (2)\n                    if <touching (ground v)?> then\n                        change y by (2)\n                        if <touching (ground v)?> then\n                            change x by ((X v) * (-2))\n                            change y by (-5)\n                            if <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n                                if <(X v) > [0]> then\n                                    set [x v v] to [-5]\n                                else\n                                    set [x v v] to [5]\n                                end\n                                set [y v v] to [13]\n                            else\n                                set [x v v] to [0]\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change [y v v] by (-0.8)\n    change y by (Y v)\n    if <touching (ground v)?> then\n        change y by ((Y v) * (-1))\n        set [y v v] to [0]\n    end\n    change y by (-1)\n    if <touching (ground v)?> then\n        if <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n            set [y v v] to [12]\n        end\n    end\n    change y by (1)\n    if <touching (spikes v)?> then\n        Spin off screen\n        reset\n    end\n    if <touching (bouncy pads v)?> then\n        set [y v v] to [20]\n    end\nend\n\nwhen I receive [start game v]\nforever\n    set [direction v] to (direction)\nend\n\nwhen I receive [start game v]\nset [change? v] to [0]\nforever\n    if <<(x position) = [241]> and <(dead?) = [0]>> then\n        broadcast (NEXT LEVEL v)\n        change [level v] by (1)\n    end\nend\n\nwhen I receive [start game v]\nforever\n    if <(y position) = [-179]> then\n        Spin off screen\n    end\nend\n\nwhen [f v] key pressed\nif <(dead?) = [0]> then\n    reset\nend\n\nwhen flag clicked\nhide\ngo to [back v] layer\n\nwhen I receive [start game v]\nshow\n\nwhen I receive [start game v]\nforever\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nswitch costume to (blur v)\nrepeat (20)\n    change [ghost v] effect by (5)\nend\ndelete this clone\n\n@Ground\n\nwhen flag clicked\nswitch costume to (lev1 v)\ngo to x: (29) y: (16)\n\nwhen I receive [next level v]\nnext costume\n\n@Spikes\n\nwhen I receive [start game v]\nswitch costume to (spikes v)\ngo to x: (-53) y: (-94)\nforever\n    if <([costume # v] of [ground v]) = [2]> then\n        go to [back v] layer\n        switch costume to (spikes2 v)\n        go to x: (-27) y: (-97)\n    else\n        if <([costume # v] of [ground v]) = [3]> then\n            go to [back v] layer\n            switch costume to (lev3 v)\n        else\n            if <([costume # v] of [ground v]) = [4]> then\n                go to [back v] layer\n                switch costume to (lev4 v)\n            else\n                if <([costume # v] of [ground v]) = [5]> then\n                    go to [back v] layer\n                    switch costume to (lev5 v)\n                else\n                    if <([costume # v] of [ground v]) = [6]> then\n                        go to [back v] layer\n                        switch costume to (lev6 v)\n                    else\n                        if <([costume # v] of [ground v]) = [7]> then\n                            go to [back v] layer\n                            switch costume to (lev7 v)\n                        else\n                            if <([costume # v] of [ground v]) = [8]> then\n                                go to [back v] layer\n                                switch costume to (lev8 v)\n                            else\n                                if <([costume # v] of [ground v]) = [9]> then\n                                    go to [back v] layer\n                                    switch costume to (lev9 v)\n                                else\n                                    if <([costume # v] of [ground v]) = [10]> then\n                                        go to [back v] layer\n                                        switch costume to (lev10 v)\n                                    else\n                                        if <([costume # v] of [ground v]) = [11]> then\n                                            go to [back v] layer\n                                            switch costume to (lev11 v)\n                                        else\n                                            if <([costume # v] of [ground v]) = [12]> then\n                                                go to [back v] layer\n                                                switch costume to (costume1 v)\n                                            else\n                                                if <([costume # v] of [ground v]) = [13]> then\n                                                    go to [back v] layer\n                                                    switch costume to (lev13 v)\n                                                else\n                                                    if <([costume # v] of [ground v]) = [14]> then\n                                                        go to [back v] layer\n                                                        switch costume to (lev14 v)\n                                                    else\n                                                        if <([costume # v] of [ground v]) = [15]> then\n                                                            go to [back v] layer\n                                                            switch costume to (lev15 v)\n                                                        else\n                                                            if <([costume # v] of [ground v]) = [16]> then\n                                                                go to [back v] layer\n                                                                switch costume to (costume2 v)\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\n\ngo to x: (-33) y: (-93)\ncreate clone of (_myself_ v)\ngo to x: (45) y: (-93)\n\n@Bouncy Pads\n\nwhen flag clicked\nhide\nswitch costume to (costume2 v)\ngo to x: (-24) y: (-72)\nforever\n    go to x: (-24) y: (-72)\n    hide\n    if <([costume # v] of [ground v]) = [9]> then\n        go to x: (-24) y: (-72)\n        show\n    else\n        if <([costume # v] of [ground v]) = [10]> then\n            switch costume to (costume1 v)\n            show\n        else\n            if <([costume # v] of [ground v]) = [14]> then\n                switch costume to (costume3 v)\n                show\n            end\n        end\n    end\nend\n\n@Thumbnail\n\nwhen I receive [start game v]\nhide\n\nwhen flag clicked\nshow\n\n@Monsters\n\nwhen I receive [next level v]\nset [health v] to [10]\ndelete this clone\n\nwhen I receive [start game v]\ngo to x: (173) y: (-93)\ngo to [back v] layer\nhide\nforever\n    if <([costume # v] of [ground v]) = [17]> then\n        show\n        repeat (100)\n            move (-2) steps\n        end\n        repeat (100)\n            move (2) steps\n        end\n    else\n        if <([costume # v] of [ground v]) = [20]> then\n            show\n            repeat (100)\n                move (-2) steps\n            end\n            repeat (100)\n                move (2) steps\n            end\n        end\n    end\nend\n\nwhen I receive [monster dead v]\nchange [ghost v] effect by (25)\nhide\ndelete this clone\n\nwhen flag clicked\nforever\n    if <touching (ninja stars v)?> then\n        change [health v] by (-1)\n        if <(health) = [0]> then\n            repeat (10)\n                change [ghost v] effect by (10)\n            end\n            delete this clone\n        end\n    end\nend\n\n@ninja stars\n\nwhen I receive [start game v]\nforever\n    go to [back v] layer\n    go to (ninja v)\n    point in direction ([direction v] of [ninja v])\n    point towards (mouse-pointer v)\n    if <<key (space v) pressed?> or <mouse down?>> then\n        create clone of (_myself_ v)\n        wait until <not <<key (space v) pressed?> or <mouse down?>>>\n    end\n    if <touching (monsters v)?> then\n        change [health v] by (-1)\n        if <(health) = [0]> then\n            broadcast (Monster dead v)\n        end\n    end\nend\n\nwhen I receive [next level v]\ndelete this clone\n\nwhen I start as a clone\nrepeat until <<touching (_edge_ v)?> or <<touching (ground v)?> or <<touching (spikes v)?> or <touching (monsters v)?>>>>\n    move (10) steps\n    if <touching (_edge_ v)?> then\n        delete this clone\n    end\n    if <touching (monsters v)?> then\n        wait until <not <touching (monsters v)?>>\n        delete this clone\n    end\nend\n\n