Drawn 3(Platformer+Scrolling Platformer)  #games

Instructions:                                Instructions\n>Use The W,A,S,D or Arrow Keys To Move.\n>Jump Over Enemies.\n>Medium.\n>Part 1: https://scratch.mit.edu/projects/419661760\n>Part 2: https://scratch.mit.edu/projects/421336908/

@Stage\n\nwhen flag clicked\nbroadcast (Start v)\nforever\n    if <not <(Level) = [20]>> then\n        switch backdrop to (1 v)\n    else\n        switch backdrop to (2 v)\n    end\nend\n\nwhen I receive [start v]\nforever\n    play sound [Ricochet v] until done\nend\n\nwhen I receive [start v]\nforever\n    if <(Sounds) = [2]> then\n        set volume to (50) %\n    else\n        set volume to (0) %\n    end\nend\n\n@Blank\n\n@Player\n\nwhen I receive [start v]\nset size to (55) %\nbroadcast (Green Flag v) and wait\nbroadcast (Play Game v) and wait\n\ndefine Game On\nset [sx v] to [0]\nset [x v] to [-190]\nset [y v] to [-118]\nset [sy v] to [0]\nset [in air v] to [0]\nset [finish v] to []\nset [scroll x v] to [0]\nset [scroll y v] to [0]\npoint in direction (90)\nshow\n\ndefine Tick\nif <<<key (a v) pressed?> or <key (left arrow v) pressed?>> or <<(mouse x) < (x position)> and <mouse down?>>> then\n    change [sx v] by (-1.5)\nend\nif <<<key (d v) pressed?> or <key (right arrow v) pressed?>> or <<(mouse x) > (x position)> and <mouse down?>>> then\n    change [sx v] by (1.5)\nend\nset [sx v] to ((sx) * (0.8))\nif <([abs v] of (sx) ) > [0.9]> then\n    Change Player x by (round (sx))\nend\nif <<<key (w v) pressed?> or <key (up arrow v) pressed?>> or <<(mouse y) > (y position)> and <mouse down?>>> then\n    if <(in air) < [4]> then\n        set [sy v] to [14]\n    end\nend\nif <(sy) > [-20]> then\n    change [sy v] by (-2)\nend\nChange Player y by (sy)\nDie\nif <(Level) = [20]> then\n    set [scroll x v] to (x)\n    change [scroll x v] by (round (((x) - (Scroll x)) / (10)))\n    if <(Scroll x) > [3228]> then\n        set [scroll x v] to [3230]\n    end\n    if <(Scroll x) < [0]> then\n        set [scroll x v] to [0]\n    end\n    change [scroll y v] by (round (((y) - (Scroll y)) / (10)))\n    if <(Scroll y) < [0]> then\n        set [scroll y v] to [0]\n    end\nend\nPosition\n\nwhen I receive [play game v]\ngo to [front v] layer\nforever\n    broadcast (Reset v) and wait\n    broadcast (Setup v) and wait\n    Game On\n    repeat until <(Finish) > []>\n        Tick\n        Position\n        broadcast (Tick v)\n    end\n    if <(Finish) = [Yes]> then\n        Game Con\n    else\n        Game End\n    end\nend\n\ndefine Change Player y by (sy)\nchange [y v] by (sy)\nchange [in air v] by (1)\nPosition\nrepeat until <not <touching (platform v)?>>\n    if <(sy) > [0]> then\n        change [y v] by (-1)\n    else\n        change [y v] by (1)\n        set [in air v] to [0]\n    end\n    Position\n    set [sy v] to [0]\nend\n\ndefine Position\ngo to x: ((x) - (Scroll x)) y: ((y) - (Scroll y))\n\ndefine Change Player x by (sx)\nchange [x v] by (sx)\nPosition\nif <touching (platform v)?> then\n    repeat (12)\n        change [y v] by (1)\n        Position\n        if <not <touching (platform v)?>> then\n            stop [this script v]\n        end\n    end\n    change [y v] by (-12)\n    if <<<key (w v) pressed?> or <key (up arrow v) pressed?>> or <<(mouse y) > (y position)> and <mouse down?>>> then\n        if <(sx) > [0]> then\n            if <(Sounds) = [2]> then\n                start sound [Wall Jump v]\n            end\n            set [sx v] to [-15]\n        else\n            if <(Sounds) = [2]> then\n                start sound [Wall Jump v]\n            end\n            set [sx v] to [15]\n        end\n        set [in air v] to [0]\n    else\n        set [sx v] to [0]\n    end\n    repeat until <not <touching (platform v)?>>\n        if <(sx) > [0]> then\n            change [x v] by (-1)\n        else\n            change [x v] by (1)\n        end\n        Position\n    end\nend\n\ndefine Game End\nset [finish v] to []\nif <not <(Level) = [20]>> then\n    create clone of (_myself_ v)\nelse\n    show\n    wait (0.05) seconds\n    hide\n    wait (0.05) seconds\n    show\n    wait (0.05) seconds\n    hide\n    wait (0.05) seconds\nend\n\ndefine Die\nif <<touching (danger v)?> or <<touching (enemy v)?> or <touching (super enemy v)?>>> then\n    set [finish v] to [Die]\nend\n\ndefine Game Con\nchange [level v] by (1)\n\nwhen I receive [start v]\nforever\n    if <(Sounds) = [2]> then\n        set volume to (50) %\n    else\n        set volume to (0) %\n    end\nend\n\nwhen I start as a clone\nif <(Sounds) = [2]> then\n    start sound [Die v]\nend\ngo to [front v] layer\nset [sx v] to [0]\nset [sy v] to [8]\nrepeat (12)\n    turn right (15) degrees\n    change y by (sy)\n    change [sy v] by (-1)\nend\nrepeat until <[-180] > (y position)>\n    change y by (sy)\n    change [sy v] by (-1)\nend\ndelete this clone\n\nwhen I receive [start v]\nset [level v] to [1]\nforever\n    if <touching (finish v)?> then\n        wait (0.05) seconds\n        set [finish v] to [Yes]\n        wait until <not <touching (finish v)?>>\n    end\nend\n\nwhen I receive [start v]\nforever\n    if <(x) < [-232]> then\n        set [x v] to [-232]\n    end\n    if <not <(Level) = [20]>> then\n        if <(x) > [232]> then\n            set [x v] to [232]\n        end\n    else\n        if <(x) > [3464]> then\n            set [x v] to [3464]\n        end\n    end\nend\n\nwhen I receive [start v]\nset [level v] to [1]\nforever\n    if <touching (finish v)?> then\n        play sound [Connect v] until done\n    end\nend\n\nwhen I receive [skip v]\nset [finish v] to [Yes]\n\n@Platform\n\nwhen flag clicked\nhide\n\nwhen I receive [start v]\nforever\n    if <(Sounds) = [0]> then\n        set volume to (50) %\n    else\n        set volume to (0) %\n    end\nend\n\nwhen I receive [green flag v]\nshow\n\nwhen I receive [tick v]\nif <(Level) = [20]> then\n    Position ((x) - (Scroll x)) ((y) - (Scroll y))\nelse\n    show\n    go to x: (0) y: (0)\n    switch costume to (Level)\n    if <(Level) = [21]> then\n        switch costume to ( 21 v)\n    end\nend\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\ndefine Clone at x: (x) y: (y)\ncreate clone of (_myself_ v)\nnext costume\nchange [x v] by (x)\nchange [y v] by (y)\n\nwhen I receive [setup v]\nif <(Level) = [20]> then\n    hide\n    switch costume to (level 20 1 v)\n    set [x v] to [0]\n    set [y v] to [0]\n    Clone at x: [360] y: [0]\n    switch costume to (level 20 2 v)\n    Clone at x: [360] y: [0]\n    switch costume to (level 20 3 v)\n    Clone at x: [360] y: [0]\n    switch costume to (level 20 4 v)\n    Clone at x: [360] y: [0]\n    switch costume to (level 20 5 v)\n    Clone at x: [360] y: [0]\n    switch costume to (level 20 6 v)\n    Clone at x: [360] y: [0]\n    switch costume to (level 20 7 v)\n    Clone at x: [360] y: [0]\n    switch costume to (level 20 8 v)\n    Clone at x: [360] y: [0]\n    switch costume to (level 20 9 v)\n    Clone at x: [360] y: [0]\n    switch costume to (level 20 10 v)\nend\n\nwhen I receive [reset v]\ndelete this clone\n\n@Danger\n\nwhen flag clicked\nhide\n\nwhen I receive [green flag v]\nshow\n\nwhen I receive [tick v]\nif <(Level) = [20]> then\n    Position ((x) - (Scroll x)) ((y) - (Scroll y))\nelse\n    show\n    go to x: (0) y: (0)\n    switch costume to (Level)\n    if <(Level) = [21]> then\n        switch costume to ( 21 v)\n    end\nend\nif <(Level) = [11]> then\n    go to x: (29) y: (30)\n    turn right (5) degrees\nelse\n    point in direction (90)\nend\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\ndefine Clone at x: (x) y: (y)\ncreate clone of (_myself_ v)\nchange [x v] by (x)\nchange [y v] by (y)\nnext costume\n\nwhen I receive [setup v]\nif <(Level) = [20]> then\n    hide\n    set [x v] to [0]\n    set [y v] to [0]\n    switch costume to (level 20 1 v)\n    Clone at x: [360] y: [0]\n    switch costume to (level 20 2 v)\n    Clone at x: [360] y: [0]\n    switch costume to (level 20 3 v)\n    Clone at x: [360] y: [0]\n    switch costume to (level 20 4 v)\n    Clone at x: [360] y: [0]\n    switch costume to (level 20 5 v)\n    Clone at x: [360] y: [0]\n    switch costume to (level 20 6 v)\n    Clone at x: [360] y: [0]\n    switch costume to (level 20 7 v)\n    Clone at x: [360] y: [0]\n    switch costume to (level 20 8 v)\n    Clone at x: [360] y: [0]\n    switch costume to (level 20 9 v)\n    Clone at x: [360] y: [0]\n    switch costume to (level 20 10 v)\nend\n\nwhen I receive [reset v]\ndelete this clone\n\n@Finish\n\nwhen flag clicked\nhide\n\nwhen I receive [start v]\nforever\n    if <(Sounds) = [0]> then\n        set volume to (50) %\n    else\n        set volume to (0) %\n    end\nend\n\nwhen I receive [green flag v]\nshow\n\nwhen I receive [tick v]\nif <(Level) = [20]> then\n    Position ((x) - (Scroll x)) ((y) - (Scroll y))\nelse\n    show\n    if <<(Level) = [1]> or <(Level) = [2]>> then\n        go to x: (214) y: (-105)\n    end\n    if <(Level) = [3]> then\n        go to x: (214) y: (105)\n    end\n    if <<(Level) = [4]> or <(Level) = [5]>> then\n        go to x: (214) y: (-105)\n    end\n    if <<(Level) = [6]> or <(Level) = [8]>> then\n        go to x: (214) y: (-105)\n    end\n    if <(Level) = [7]> then\n        go to x: (214) y: (-55)\n    end\n    if <(Level) = [9]> then\n        go to x: (214) y: (159)\n    end\n    if <(Level) = [10]> then\n        go to x: (214) y: (-105)\n    end\n    if <(Level) = [11]> then\n        go to x: (214) y: (130)\n    end\n    if <(Level) = [12]> then\n        go to x: (214) y: (130)\n    end\n    if <(Level) = [13]> then\n        go to x: (214) y: (13)\n    end\n    if <(Level) = [14]> then\n        go to x: (214) y: (-55)\n    end\n    if <(Level) = [15]> then\n        go to x: (214) y: (-105)\n    end\n    if <(Level) = [16]> then\n        go to x: (214) y: (16)\n    end\n    if <(Level) = [17]> then\n        go to x: (214) y: (108)\n    end\n    if <(Level) = [18]> then\n        go to x: (214) y: (-63)\n    end\n    if <(Level) = [19]> then\n        go to x: (214) y: (-105)\n    end\n    if <(Level) = [21]> then\n        hide\n    end\nend\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\ndefine Clone at x: (x) y: (y)\ncreate clone of (_myself_ v)\nnext costume\nchange [x v] by (x)\nchange [y v] by (y)\n\nwhen I receive [setup v]\nif <(Level) = [20]> then\n    hide\n    switch costume to (1 v)\n    set [x v] to [3365]\n    set [y v] to [-108]\nend\n\nwhen I receive [reset v]\ndelete this clone\n\n@Enemy\n\nwhen I start as a clone\nset [x v] to [0]\nset [y v] to [0]\ngo to [front v] layer\nset size to (55) %\nshow\nforever\n    change [y v] by (-1)\n    if <([x position v] of [player v]) < ((x position) - (10))> then\n        change [x v] by (-.5)\n        point in direction (-90)\n    end\n    if <((x position) - (-10)) < ([x position v] of [player v])> then\n        change [x v] by (.5)\n        point in direction (90)\n    end\n    set [x v] to ((x) * (0.9))\n    change x by (x)\n    if <touching (platform v)?> then\n        change y by (1)\n        if <touching (platform v)?> then\n            change y by (1)\n            if <touching (platform v)?> then\n                change y by (1)\n                if <touching (platform v)?> then\n                    change y by (1)\n                    if <touching (platform v)?> then\n                        change y by (-3)\n                        change x by ((x) * (-1))\n                        if <<(y position) < ([y position v] of [player v])> or <(y position) < ([x position v] of [player v])>> then\n                            if <(x) > [0]> then\n                                set [x v] to [-5]\n                            else\n                                set [x v] to [5]\n                            end\n                            set [y v] to [12]\n                        else\n                            set [x v] to [0]\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change y by (y)\n    if <touching (platform v)?> then\n        change y by ((y) - ((y) * (2)))\n        set [y v] to [0]\n    end\n    change y by (-1)\nend\n\nwhen flag clicked\nhide\n\ndefine Create A Clone at x: (x) y: (y)\ngo to x: (x) y: (y)\ncreate clone of (_myself_ v)\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen I receive [setup v]\nif <(Level) = [5]> then\n    Create A Clone at x: [215] y: [-128]\n    Create A Clone at x: [80] y: [-128]\nend\nif <(Level) = [10]> then\n    Create A Clone at x: [215] y: [-128]\nend\nif <(Level) = [11]> then\n    Create A Clone at x: [215] y: [-128]\n    Create A Clone at x: [200] y: [6]\nend\nif <(Level) = [13]> then\n    Create A Clone at x: [200] y: [6]\nend\n\nwhen I start as a clone\nforever\n    if <touching (danger v)?> then\n        wait (0.05) seconds\n        delete this clone\n    end\nend\n\n@Super Enemy\n\ndefine loop\ncheck player\nif <(Right) = [1]> then\n    change [x v v] by (1.5)\nend\nif <(Left) = [1]> then\n    change [x v v] by (-1.5)\nend\nset [x v v] to ((x v) * (0.8))\nif <([abs v] of (x v) ) > [0.9]> then\n    Change player x by (round (x v))\nend\nif <(Jump) = [1]> then\n    if <(in air) < [4]> then\n        set [y v v] to [14]\n    end\nend\nchange [y v v] by (-2)\nChange player y by (y v)\n\nwhen I receive [green flag v]\nhide\n\ndefine reset\nset [y v v] to [0]\nset [x v v] to [0]\nset [in air v] to [0]\nshow\n\ndefine Change player y by (y v)\nchange y by (y v)\nchange [in air v] by (1)\nrepeat until <not <touching (platform v)?>>\n    if <(y v) > [0]> then\n        change y by (-1)\n        set [ceiling v] to [1]\n    else\n        change y by (1)\n        set [in air v] to [0]\n        set [ceiling v] to [-1]\n    end\n    set [y v v] to [0]\nend\n\ndefine Change player x by (x v)\nchange x by (x v)\nif <touching (platform v)?> then\n    set [jump v] to [1]\n    repeat (8)\n        change y by (1)\n        if <not <touching (platform v)?>> then\n            stop [this script v]\n        end\n    end\n    change y by (-8)\n    if <(no wall jump) = [0]> then\n        if <(x v) > [0]> then\n            set [x v v] to [-10]\n        else\n            set [x v v] to [10]\n        end\n        set [in air v] to [0]\n    else\n        set [x v v] to [0]\n    end\n    repeat until <not <<touching (platform v)?> or <touching (_edge_ v)?>>>\n        if <(x v) > [0]> then\n            change x by (-1)\n            set [checking the right v] to [0]\n            set [right wall v] to [1]\n            set [left wall v] to [0]\n        else\n            change x by (1)\n            set [checking the left v] to [0]\n            set [left wall v] to [1]\n            set [right wall v] to [0]\n        end\n    end\nelse\n    set [left wall v] to [0]\n    set [right wall v] to [0]\nend\n\ndefine check player\nset [check platform v] to [0]\nset [platform above v] to [0]\nif <([y position v] of [player v]) > ((y position) + (-1))> then\n    set [no wall jump v] to [0]\nend\nif <([y position v] of [player v]) > (y position)> then\n    set [check platform v] to (y position)\n    repeat ((([y position v] of [player v]) - (y position)) / (6))\n        change y by (6)\n        if <touching (platform v)?> then\n            set [platform above v] to [1]\n        end\n    end\n    set y to (check platform)\n    if <(platform above) = [1]> then\n        set [jump v] to [0]\n        if <<(checking the left) = [0]> and <(checking the right) = [0]>> then\n            if <(pick random (1) to (2)) = [1]> then\n                set [checking the left v] to [1]\n                set [checking the right v] to [0]\n            else\n                set [checking the right v] to [1]\n                set [checking the left v] to [0]\n            end\n        end\n    else\n        if <<(in air) < [1]> and < (round (((timer) / (pick random (150) to (299))) * (100000))) contains [2]?>> then\n            set [jump v] to [1]\n        end\n    end\nelse\n    set [jump v] to [0]\nend\nif <([x position v] of [player v]) < (x position)> then\n    set [left v] to [1]\n    set [right v] to [0]\nelse\n    if <([x position v] of [player v]) > (x position)> then\n        set [right v] to [1]\n        set [left v] to [0]\n    else\n        set [right v] to [0]\n        set [left v] to [0]\n    end\nend\nif <<(checking the left) = [1]> or <(down left) = [1]>> then\n    set [left v] to [1]\n    set [right v] to [0]\nend\nif <<(checking the right) = [1]> or <(down right) = [1]>> then\n    set [right v] to [1]\n    set [left v] to [0]\nend\nif <<<not <([y position v] of [player v]) > (y position)>> and <(platform above) = [0]>> and <(in air) < [6]>> then\n    set [checking the left v] to [0]\n    set [checking the right v] to [0]\nend\nif <(in air) = [0]> then\n    set [ground level v] to (y position)\nend\nif <(ground level) > (([y position v] of [player v]) + (15))> then\n    set [no wall jump v] to [1]\n    if <<(down left) = [0]> and <(down right) = [0]>> then\n        if <(x v) > [0]> then\n            set [down right v] to [1]\n            set [down left v] to [0]\n        else\n            set [down left v] to [1]\n            set [down right v] to [0]\n        end\n    end\nend\nif <<<([x position v] of [player v]) > (x position)> and <(right wall) = [1]>> or <<([x position v] of [player v]) < (x position)> and <(left wall) = [1]>>> then\n    set [no wall jump v] to [0]\nend\nif <<not <(ground level) > ([y position v] of [player v])>> or <<<<(right wall) = [1]> or <(left wall) = [1]>> and <(ceiling) = [1]>> or <<(right wall) = [1]> or <(left wall) = [1]>>>> then\n    set [down right v] to [0]\n    set [down left v] to [0]\nend\n\nwhen I start as a clone\nshow\nforever\n    reset\n    repeat until <(Finish) > []>\n        loop\n    end\nend\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen I receive [setup v]\nif <(Level) = [10]> then\n    Create A Clone at x: [215] y: [-128]\nend\n\ndefine Create A Clone at x: (x) y: (y)\ngo to x: (x) y: (y)\ncreate clone of (_myself_ v)\n\n@Text\n\nwhen flag clicked\nhide\n\nwhen I receive [start v]\nforever\n    if <(Sounds) = [0]> then\n        set volume to (50) %\n    else\n        set volume to (0) %\n    end\nend\n\nwhen I receive [green flag v]\nshow\n\nwhen I receive [tick v]\nif <(Level) = [20]> then\n    Position ((x) - (Scroll x)) ((y) - (Scroll y))\nelse\n    show\n    go to x: (0) y: (0)\n    switch costume to (Level)\n    if <(Level) = [21]> then\n        switch costume to ( 21 v)\n    end\nend\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\ndefine Clone at x: (x) y: (y)\ncreate clone of (_myself_ v)\nnext costume\nchange [x v] by (x)\nchange [y v] by (y)\n\nwhen I receive [setup v]\nif <(Level) = [20]> then\n    hide\n    switch costume to (level 20 1 v)\n    set [x v] to [0]\n    set [y v] to [0]\n    Clone at x: [360] y: [0]\n    switch costume to (level 20 2 v)\n    Clone at x: [360] y: [0]\n    switch costume to (level 20 3 v)\n    Clone at x: [360] y: [0]\n    switch costume to (level 20 4 v)\n    Clone at x: [360] y: [0]\n    switch costume to (level 20 5 v)\n    Clone at x: [360] y: [0]\n    switch costume to (level 20 6 v)\n    Clone at x: [360] y: [0]\n    switch costume to (level 20 7 v)\n    Clone at x: [360] y: [0]\n    switch costume to (level 20 8 v)\n    Clone at x: [360] y: [0]\n    switch costume to (level 20 9 v)\n    Clone at x: [360] y: [0]\n    switch costume to (level 20 10 v)\nend\n\nwhen I receive [reset v]\ndelete this clone\n\n@Volume\n\nwhen flag clicked\nset [sounds v] to [2]\nset size to (80) %\nforever\n    go to x: (-200) y: (158)\n    if <(Sounds) = [0]> then\n        switch costume to (2 v)\n    end\n    if <(Sounds) = [2]> then\n        switch costume to (1 v)\n    end\n    if <touching (mouse-pointer v)?> then\n        if <(size) < [90]> then\n            change size by (2)\n        end\n        if <<mouse down?> and <(Sounds) = [0]>> then\n            set [sounds v] to [2]\n            wait until <not <mouse down?>>\n        end\n        if <<mouse down?> and <(Sounds) = [2]>> then\n            set [sounds v] to [0]\n            wait until <not <mouse down?>>\n        end\n    else\n        if <(size) > [80]> then\n            change size by (-2)\n        end\n    end\nend\n\n@Skip\n\nwhen flag clicked\nshow\nset size to (60) %\nforever\n    go to x: (195) y: (-158)\n    if <touching (mouse-pointer v)?> then\n        if <(size) < [64]> then\n            change size by (2)\n        end\n        if <mouse down?> then\n            broadcast (Skip v)\n            wait until <not <mouse down?>>\n        end\n    else\n        if <(size) > [60]> then\n            change size by (-2)\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    if <not <(Level) = [21]>> then\n        show\n    else\n        hide\n        stop [other scripts in sprite v]\n        stop [this script v]\n    end\nend\n\n@Thumbnail\n\nwhen flag clicked\nforever\n    show\n    go to x: (0) y: (0)\n    go to [front v] layer\n    set [ghost v] effect to (100)\nend\n\n