Adventure || A platformer
@Stage\n\nwhen I receive [next level v]\nif <(Level) = [13]> then\n    next backdrop\nend\n\nwhen flag clicked\nswitch backdrop to (backdrop3 v)\n\nwhen I receive [redo v]\ndelete all of [enemy x v]\ndelete all of [enemy y v]\nset [clones out v] to [0]\nset [delete clones v] to [1]\nwait (0.1) seconds\nset [delete clones v] to [0]\n\nwhen I receive [intro v]\nnext backdrop\n\n@Guy\n\nwhen I start as a clone\nshow\nif <[1] = (costume [number v])> then\n    switch costume to (costume2 v)\n    repeat (10)\n        change [color v] effect by (5)\n        change [ghost v] effect by (5)\n        change size by (-2)\n    end\n    delete this clone\nelse\n    switch costume to (costume4 v)\n    repeat (10)\n        change [color v] effect by (5)\n        change [ghost v] effect by (5)\n        change size by (-2)\n    end\n    delete this clone\nend\n\nwhen I receive [next level v]\nif <(Level) = [11]> then\n    go to x: (150) y: (150)\nelse\n    go to x: (-220) y: (0)\nend\n\nwhen flag clicked\nforever\n    if <<(y position) < [-172]> or <touching (spikes v)?>> then\n        broadcast (Redo v)\n    end\nend\n\nwhen I receive [redo v]\nset [speed y v] to [0]\nif <(Level) = [11]> then\n    go to x: (150) y: (150)\nelse\n    go to x: (-220) y: (0)\nend\n\ncreate clone of (_myself_ v)\n\nwhen flag clicked\nforever\n    if <touching color (#ffffff)?> then\n        broadcast (Redo v)\n    end\n    if <<key (s v) pressed?> or <key (down arrow v) pressed?>> then\n        repeat until <not <<key (s v) pressed?> or <key (down arrow v) pressed?>>>\n            if <touching color (#ffffff)?> then\n                broadcast (Redo v)\n            end\n            switch costume to (costume3 v)\n        end\n    end\n    switch costume to (costume1 v)\nend\n\nset [sword showing v] to [0]\npoint in direction (-135)\nwait until <not <key (space v) pressed?>>\nhide\n\nwhen I receive [next level v]\nwait (0.1) seconds\nif <<(Swing) = [0]> and <(Level) = [9]>> then\n    say [⚠️ WARNING: you have not collected the lightsaber. Please press the GO BACK button to get the lightsaber] for (10) seconds\nend\n\nwhen I receive [go back v]\nbroadcast (Redo v)\n\nwhen I receive [intro v]\nshow\nswitch costume to (costume1 v)\nforever\n    create clone of (_myself_ v)\nend\n\nwhen I receive [intro v]\ngo to [back v] layer\nswitch costume to (costume1 v)\nset [speed x v] to [0]\nset [speed y v] to [0]\ngo to x: (-220) y: (0)\nset size to (50) %\nMove\n\nwhen flag clicked\nhide\n\ndefine Move\nforever\n    change [speed y v] by (-0.5)\n    set rotation style [left-right v]\n    if <<key (a v) pressed?> or <key (left arrow v) pressed?>> then\n        point in direction (-90)\n        change [speed x v] by (-2)\n    end\n    if <<key (d v) pressed?> or <key (right arrow v) pressed?>> then\n        point in direction (90)\n        change [speed x v] by (2)\n    end\n    set [speed x v] to ((Speed x) * (0.7))\n    change x by (Speed x)\n    if <<touching (ground v)?> or <touching (moving platform v)?>> then\n        change y by (1)\n        if <<touching (ground v)?> or <touching (moving platform v)?>> then\n            change y by (1)\n            if <<touching (ground v)?> or <touching (moving platform v)?>> then\n                change y by (1)\n                if <<touching (ground v)?> or <touching (moving platform v)?>> then\n                    change y by (1)\n                    if <<touching (ground v)?> or <touching (moving platform v)?>> then\n                        change y by (1)\n                        if <<touching (ground v)?> or <touching (moving platform v)?>> then\n                            change y by (1)\n                            if <<touching (ground v)?> or <touching (moving platform v)?>> then\n                                change y by (-6)\n                                change x by ((Speed x) * (-1))\n                                if <<key (w v) pressed?> or <key (up arrow v) pressed?>> then\n                                    set [speed y v] to [10]\n                                    if <(Speed x) > [0]> then\n                                        set [speed x v] to [-10]\n                                    else\n                                        set [speed x v] to [10]\n                                    end\n                                else\n                                    set [speed x v] to [0]\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change y by (Speed y)\n    if <<touching (ground v)?> or <touching (moving platform v)?>> then\n        change y by ((-1) * (Speed y))\n        set [speed y v] to [0]\n    end\n    change y by (-0.5)\n    if <<<touching (ground v)?> or <touching (moving platform v)?>> and <<key (w v) pressed?> or <key (up arrow v) pressed?>>> then\n        set [speed y v] to [10]\n    end\n    change y by (0.5)\nend\n\nwhen flag clicked\nforever\n    play sound [Xenogenesis v] until done\nend\n\n@Ground\n\nwhen flag clicked\ngo to [back v] layer\nswitch costume to (costume2 v)\nforever\n    if <<[237] = ([x position v] of [guy v])> or <[237] < ([x position v] of [guy v])>> then\n        broadcast (Next level v)\n    end\nend\n\nwhen I receive [next level v]\nnext costume\n\ngo to x: (([x position v] of [guy v]) + (5)) y: ([y position v] of [guy v])\n\nwhen I receive [intro v]\nshow\n\nwhen I receive [next level v]\nif <(Level) = [17]> then\n    stop [other scripts in sprite v]\nend\n\nwhen I receive [go back v]\nswitch costume to ((costume [number v]) - (1))\n\nwhen flag clicked\nhide\n\n@Spikes\n\nwhen flag clicked\nset [level v] to [1]\nhide\n\nwhen I receive [next level v]\nchange [level v] by (1)\nif <(Level) = [3]> then\n    switch costume to (costume2 v)\n    show\nelse\n    if <(Level) > [3]> then\n        next costume\n    else\n        hide\n    end\nend\n\nwhen I receive [go back v]\nswitch costume to ((costume [number v]) - (1))\n\n@Moving platform\n\nwhen flag clicked\nset [delete clones v] to [0]\nhide\n\nwhen I receive [next level v]\nset [delete clones v] to [1]\nwait (0.1) seconds\nset [delete clones v] to [0]\nif <(Level) = [5]> then\n    go to x: (36) y: (28)\n    create clone of (_myself_ v)\nend\nif <(Level) = [7]> then\n    go to x: (-12) y: (50)\n    create clone of (_myself_ v)\nend\nif <(Level) = [16]> then\n    go to x: (-12) y: (50)\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nshow\nforever\n    repeat until <<[100] < (y position)> or <<touching (ground v)?> or <<touching (spikes v)?> or <touching (_edge_ v)?>>>>\n        change y by (5)\n    end\n    wait (0.5) seconds\n    change y by (-4)\n    repeat until <<(y position) < [-100]> or <<touching (ground v)?> or <<touching (spikes v)?> or <<touching (enemy v)?> or <touching (_edge_ v)?>>>>>\n        change y by (-5)\n    end\n    wait (0.5) seconds\n    change y by (4)\nend\n\nwhen I receive [redo v]\nwait (0.1) seconds\nif <(Level) = [5]> then\n    go to x: (36) y: (28)\n    create clone of (_myself_ v)\nend\nif <(Level) = [7]> then\n    go to x: (-12) y: (50)\n    create clone of (_myself_ v)\nend\nif <(Level) = [16]> then\n    go to x: (-12) y: (50)\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nforever\n    if <(Delete clones) = [1]> then\n        delete this clone\n    end\nend\n\n@Skip\n\nwhen this sprite clicked\nbroadcast (Next level v)\n\nwhen I receive [intro v]\ngo to [back v] layer\nshow\n\nwhen I receive [next level v]\nif <(Level) = [17]> then\n    hide\n    stop [other scripts in sprite v]\nend\n\nwhen flag clicked\nhide\n\n@Redo\n\nwhen this sprite clicked\nbroadcast (Redo v)\n\nwhen I receive [intro v]\ngo to [back v] layer\nshow\n\nwhen I receive [next level v]\nif <(Level) = [17]> then\n    hide\n    stop [other scripts in sprite v]\nend\n\nwhen flag clicked\nhide\n\n@Sprite1\n\nwhen flag clicked\nhide\n\nwhen I receive [next level v]\nset size to (100) %\nwait (0.1) seconds\nif <<(Swing) = [0]> and <(Level) = [9]>> then\n    show\nend\nforever\n    change size by (20)\n    change [color v] effect by (25)\n    wait (1) seconds\n    change size by (-20)\n    change [color v] effect by (25)\nend\n\nwhen this sprite clicked\nbroadcast (Go back v)\nhide\n\nwhen I receive [go back v]\nchange [level v] by (-1)\n\nwhen I receive [next level v]\nif <(Level) = [17]> then\n    hide\n    stop [other scripts in sprite v]\nend\n\n@Enemy\n\nwhen flag clicked\ndelete all of [enemy x v]\ndelete all of [enemy y v]\nforever\n    hide\nend\n\nwhen I receive [next level v]\ndelete all of [enemy x v]\ndelete all of [enemy y v]\nset [clones out v] to [0]\nwait (0.1) seconds\nif <(Level) = [6]> then\n    go to x: (180) y: (78)\n    create clone of (_myself_ v)\nend\nif <(Level) = [7]> then\n    go to x: (0) y: (-150)\n    create clone of (_myself_ v)\nend\nif <(Level) = [9]> then\n    go to x: (120) y: (-67)\n    create clone of (_myself_ v)\nend\nif <(Level) = [11]> then\n    go to x: (130) y: (-87)\n    create clone of (_myself_ v)\n    go to x: (-122) y: (6)\n    create clone of (_myself_ v)\nend\nif <(Level) = [15]> then\n    go to x: (130) y: (120)\n    create clone of (_myself_ v)\nend\nif <(Level) = [16]> then\n    go to x: (170) y: (120)\n    create clone of (_myself_ v)\n    go to x: (170) y: (0)\n    create clone of (_myself_ v)\n    go to x: (170) y: (-100)\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nshow\nset rotation style [left-right v]\npoint towards (guy v)\nchange [clones out v] by (1)\nadd (x position) to [enemy x v]\nadd (y position) to [enemy y v]\nclear graphic effects\nwait (0.1) seconds\nrepeat until <[1] = (Delete clones)>\n    set rotation style [left-right v]\n    point towards (guy v)\n    if <<touching color (#00ff67)?> or <touching (sword v)?>> then\n        if <[enemy x v] contains (x position)?> then\n            set [enemy v] to (item # of (x position) in [enemy x v])\n        end\n        set [which one? v] to [0]\n        wait (0.01) seconds\n        delete (Enemy) of [enemy x v]\n        delete (Enemy) of [enemy y v]\n        change [clones out v] by (-1)\n        broadcast (Delete cop v)\n        delete this clone\n    end\nend\n\nwhen I start as a clone\nforever\n    if <(Delete clones) = [1]> then\n        delete this clone\n    end\nend\n\nwhen I start as a clone\nif <<[1] = (costume [number v])> and <[6] = (Level)>> then\n    say [STOP!] for (2) seconds\nend\nif <<[1] = (costume [number v])> and <[14] = (Level)>> then\n    say [IT’S YOU AGAIN!] for (3) seconds\nend\n\nwhen I receive [redo v]\nwait (0.1) seconds\nif <(Level) = [6]> then\n    go to x: (180) y: (78)\n    create clone of (_myself_ v)\nend\nif <(Level) = [7]> then\n    go to x: (0) y: (-150)\n    create clone of (_myself_ v)\nend\nif <(Level) = [9]> then\n    go to x: (120) y: (-67)\n    create clone of (_myself_ v)\nend\nif <(Level) = [11]> then\n    go to x: (130) y: (-87)\n    create clone of (_myself_ v)\n    go to x: (-122) y: (6)\n    create clone of (_myself_ v)\nend\nif <(Level) = [15]> then\n    go to x: (130) y: (120)\n    create clone of (_myself_ v)\nend\nif <(Level) = [16]> then\n    go to x: (170) y: (120)\n    create clone of (_myself_ v)\n    go to x: (170) y: (0)\n    create clone of (_myself_ v)\n    go to x: (170) y: (-100)\n    create clone of (_myself_ v)\nend\n\nwhen I receive [next level v]\nif <(Level) = [17]> then\n    hide\n    stop [other scripts in sprite v]\nend\n\n@Bullet\n\nwhen flag clicked\nhide\nwait until <(Level) > [5]>\n\nwhen I start as a clone\ngo to [back v] layer\nswitch costume to (costume1 v)\nshow\nset rotation style [all around v]\npoint towards (guy v)\nrepeat until \n    move (5) steps\n    if <<touching (sword v)?> and <touching color (#5a5a5a)?>> then\n        switch costume to (costume2 v)\n        turn right (180) degrees\n        wait (0.01) seconds\n        repeat until <touching (_edge_ v)?>\n            move (5) steps\n        end\n    end\nend\ndelete this clone\n\nwhen I receive [next level v]\ndelete this clone\n\nwait (0.1) seconds\nif <(Level) = [6]> then\n    Shoot\nend\nif <(Level) = [7]> then\n    Shoot\nend\nif <(Level) = [9]> then\n    Shoot\nend\nif <(Level) = [11]> then\n    Shoot\nend\n\ndefine Shoot\n\nwhen flag clicked\nwait (0.1) seconds\nset [which one? v] to [0]\nforever\n    if <[0] < (length of [enemy x v])> then\n        repeat until <[1] = (Delete clones)>\n            set [which one? v] to [1]\n            repeat (length of [enemy x v])\n                go to x: (item (Which one?) of [enemy x v]) y: (item (Which one?) of [enemy y v])\n                create clone of (_myself_ v)\n                change [which one? v] by (1)\n            end\n            wait (0.5) seconds\n        end\n    end\nend\n\nwhen I receive [redo v]\ndelete this clone\n\nwhen I receive [next level v]\nif <(Level) = [17]> then\n    hide\n    stop [other scripts in sprite v]\nend\n\n@Sword\n\nwhen flag clicked\nset [sword showing v] to [0]\nhide\n\nwhen I receive [next level v]\nwait (0.1) seconds\nif <[8] = (Level)> then\n    set [swing v] to [0]\n    broadcast (Able to use v)\n    point in direction (-90)\n    go to x: (-20) y: (-40)\n    show\n    wait until <not <touching (guy v)?>>\n    clear graphic effects\n    set rotation style [all around v]\n    set size to (100) %\n    show\n    forever\n        repeat (20)\n            if <touching (guy v)?> then\n                set [swing v] to [1]\n                repeat (10)\n                    change y by (3)\n                    change [ghost v] effect by (10)\n                end\n                stop [this script v]\n            end\n        end\n    end\nend\nhide\n\nwhen I receive [able to use v]\nforever\n    if <key (space v) pressed?> then\n        if <[1] = (Swing)> then\n            set [sword showing v] to [1]\n            clear graphic effects\n            set size to (100) %\n            show\n            if <([direction v] of [guy v]) = [90]> then\n                point in direction (90)\n                go to x: (([x position v] of [guy v]) + (0)) y: ([y position v] of [guy v])\n            else\n                point in direction (-90)\n                go to x: (([x position v] of [guy v]) + (0)) y: ([y position v] of [guy v])\n            end\n            repeat (9)\n                if <([direction v] of [guy v]) = [90]> then\n                    turn right (40) degrees\n                    go to x: (([x position v] of [guy v]) + (0)) y: ([y position v] of [guy v])\n                else\n                    turn left (40) degrees\n                    go to (guy v)\n                    go to x: (([x position v] of [guy v]) + (0)) y: ([y position v] of [guy v])\n                end\n            end\n            point in direction (-135)\n            hide\n            wait until <not <key (space v) pressed?>>\n            set [sword showing v] to [0]\n        end\n    end\nend\n\nwhen I receive [go back v]\nset [delete clones v] to [1]\nwait (0.1) seconds\nset [delete clones v] to [0]\nif <[8] = (Level)> then\n    set [swing v] to [0]\n    broadcast (Able to use v)\n    point in direction (-90)\n    go to x: (-20) y: (-40)\n    show\n    wait until <not <touching (guy v)?>>\n    clear graphic effects\n    set rotation style [all around v]\n    set size to (100) %\n    show\n    forever\n        repeat (20)\n            if <touching (guy v)?> then\n                set [swing v] to [1]\n                repeat (10)\n                    change y by (3)\n                    change [ghost v] effect by (10)\n                end\n                stop [this script v]\n            end\n        end\n    end\nend\nhide\n\n@Text\n\nwhen flag clicked\nswitch costume to (costume1 v)\n\nwhen I receive [next level v]\nnext costume\n\nwhen flag clicked\nhide\n\nwhen I receive [intro v]\ngo to [front v] layer\nshow\n\nwhen I receive [go back v]\nswitch costume to ((costume [number v]) - (1))\n\nwhen I receive [next level v]\nif <(Level) = [17]> then\n    switch costume to (costume16 v)\n    stop [other scripts in sprite v]\nend\n\n@Bounce pad\n\nwhen flag clicked\nhide\n\nwhen I receive [next level v]\nwait (0.1) seconds\nif <(Level) = [9]> then\n    go to x: (-28) y: (-90)\n    create clone of (_myself_ v)\nend\nif <(Level) = [10]> then\n    go to x: (25) y: (-160)\n    create clone of (_myself_ v)\nend\nif <(Level) = [14]> then\n    go to x: (-20) y: (-87)\n    create clone of (_myself_ v)\nend\nif <(Level) = [16]> then\n    go to x: (-210) y: (-100)\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nshow\nforever\n    if <touching (guy v)?> then\n        set [speed y v] to [15]\n        switch costume to (costume2 v)\n        wait (0.37) seconds\n        switch costume to (costume1 v)\n    end\nend\n\nwhen I start as a clone\nforever\n    if <(Delete clones) = [1]> then\n        delete this clone\n    end\nend\n\nwhen I receive [redo v]\nwait (0.1) seconds\nif <(Level) = [9]> then\n    go to x: (-28) y: (-90)\n    create clone of (_myself_ v)\nend\nif <(Level) = [10]> then\n    go to x: (25) y: (-160)\n    create clone of (_myself_ v)\nend\nif <(Level) = [14]> then\n    go to x: (-20) y: (-87)\n    create clone of (_myself_ v)\nend\nif <(Level) = [16]> then\n    go to x: (-210) y: (-100)\n    create clone of (_myself_ v)\nend\n\n@Sprite2\n\nwhen I start as a clone\nshow\ngo to x: (pick random (-220) to (220)) y: (180)\nglide (2) secs to x: (pick random (-220) to (220)) y: (-150)\ndelete this clone\n\nwhen flag clicked\nhide\nwait until <(Level) = [13]>\nforever\n    switch costume to (bat v)\n    create clone of (_myself_ v)\n    wait (pick random (1) to (3)) seconds\nend\n\nwhen I start as a clone\nforever\n    if <touching (guy v)?> then\n        broadcast (Redo v)\n        delete this clone\n    end\n    if <touching (sword v)?> then\n        delete this clone\n    end\nend\n\nwhen I receive [next level v]\nwait (0.1) seconds\nif <[17] = (Level)> then\n    stop [other scripts in sprite v]\nend\n\n@Sprite3\n\nwhen flag clicked\nhide\n\nwhen I receive [next level v]\nwait (0.1) seconds\nif <(Level) = [17]> then\n    show\nend\n\n@Sprite4\n\nwhen flag clicked\nhide\npoint in direction (90)\nswitch costume to (245106a0-a793-4bb0-a9bb-893178b8f939 v)\ncreate clone of (_myself_ v)\nwait (2) seconds\nswitch costume to (costume1 v)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\ngo to x: (0) y: (0)\nshow\nif <(costume [number v]) = [1]> then\n    set size to (0) %\n    show\n    repeat (20)\n        turn right (18) degrees\n        change size by (5)\n    end\n    repeat (5)\n        change size by (10)\n        change x by (-10)\n        wait (0.2) seconds\n        change size by (-10)\n        change x by (-7.5)\n        wait (0.2) seconds\n    end\n    wait (1) seconds\n    repeat (20)\n        turn right (-18) degrees\n        change x by (20)\n    end\n    broadcast (Intro v)\n    delete this clone\nend\n\nwhen I start as a clone\nerase all\ngo to x: (0) y: (0)\nif <(costume [number v]) = [2]> then\n    set size to (100) %\n    show\n    go [backward v] (1) layers\n    repeat (10)\n        change x by (13)\n    end\n    wait (1.85) seconds\n    delete this clone\nend\n\n
new platformer:\nhttps://scratch.mit.edu/projects/394192511\ncheck it out pls!\n-------------------------------------------------------------------------\nPls ❤️,⭐️, and FOLLOW\nOr else i will steal all your money you have and give it to someone that loved and faved >:)\nI will be very happy!!!\nWhich leads to better projects!!!\n-------------------------------------------------------------------------\nAll levels are possible\nUse arrow keys or WASD to move (sorry no mobile mode)\nAvoid spikes, bats, and cops\nYou can wall jump\nWhen you have the lightsaber, press space to swing\nDown arrow or S to shrink\n16 levels! (I rushed)\nLike it? Love, favorite, and follow!\nHave fun!