The Potato Fox (platformer)

Instructions: The Potato Fox\nby skidsteerloader\n\nInstructions\n⊳arrow keys to move⊲\n⊳avoid smashers, wolves and gaps⊲\n⊳get to the other side of the screen to go to the next level⊲\n⊳if you go on mushrooms you will bounce⊲\n\n⊳get through all 20 levels to win the game and if you are stuck press S⊲\n\nENJOY\n\ngame created by skidsteerloader\nif you take any code or sprites please give proper credit\n❤️ ⭐\nFox blockshade: https://scratch.mit.edu/projects/354399938/\n\n#game #fox #potato #fun #platformer #the #enjoy

@Stage\n\nwhen flag clicked\nforever\n    play sound [Music v] until done\nend\n\n@Potato Fox\n\nwhen flag clicked\nset [level v] to [0]\n\nbroadcast (Play Game v) and wait\n\nwhen I receive [play game v]\nset [level v] to [1]\nset [spawn x v] to [-200]\nset [spawn y v] to [-100]\nSet Up Level\nbroadcast (Reset v) and wait\nforever\n    switch costume to (hitbox v)\n    point in direction (90)\n    change [pvx v] by ((0) - ((PVX) * (0.2)))\n    if <key (right arrow v) pressed?> then\n        change [pvx v] by (1)\n        set [direction v] to [90]\n    end\n    if <key (left arrow v) pressed?> then\n        change [pvx v] by (-1)\n        set [direction v] to [-90]\n    end\n    change y by (-1)\n    if <<touching (moving platform v)?> and <(In Platform) = [1]>> then\n        change x by ((PVX) + (Move Speed))\n    else\n        change x by (PVX)\n    end\n    change y by (1)\n    Detect Slope Then Wall [8]\n    change [pvy v] by (-1)\n    change [jump key v] by (1)\n    change y by (PVY)\n    if <touching (moving platform v)?> then\n        if <(Platform C) = [true]> then\n            set [in platform v] to [2]\n        else\n            if <(PVY) < [0]> then\n                set [in platform v] to [1]\n            end\n        end\n    else\n        set [in platform v] to [2]\n    end\n    if <<touching color (#000000)?> or <(In Platform) = [1]>> then\n        change y by ((PVY) * (-1))\n        if <(PVY) < [0]> then\n            set [jump key v] to [0]\n        end\n        set [pvy v] to [0]\n    end\n    set [platform c v] to <touching (moving platform v)?>\n    if <<key (up arrow v) pressed?> and <(Jump Key) < [3]>> then\n        set [pvy v] to [10]\n        set [jump key v] to [3]\n    end\n    if <<(y position) = [-191]> or <<touching (enemy v)?> or <touching ( smash v)?>>> then\n        broadcast (Black v) and wait\n        Set Up Level\n        broadcast (Reset v) and wait\n        wait (.01) seconds\n        broadcast (Out v) and wait\n    end\n    if <(x position) > [234]> then\n        broadcast (Black v) and wait\n        Set Up Level\n        change [level v] by (1)\n        broadcast (Reset v) and wait\n        broadcast (Next Level v) and wait\n        wait (.01) seconds\n        broadcast (Out v) and wait\n    end\n    point in direction (Direction)\n    switch costume to (potato fox v)\n    if <(LEVEL) = [20]> then\n        \n    end\n    broadcast (Tick v)\nend\n\ndefine Set Up Level\nset rotation style [left-right v]\ngo to x: (-200) y: (-120)\nset [pvx v] to [0]\nset [pvy v] to [0]\n\ndefine Detect Slope Then Wall (slope max)\nset [slope step v] to [0]\nrepeat until <<(Slope Step) = (slope max)> or <not <touching color (#000000)?>>>\n    change y by (1)\n    change [slope step v] by (1)\nend\nif <(Slope Step) = (slope max)> then\n    change y by (-8)\n    change y by (-1)\n    if <<touching (moving platform v)?> and <(In Platform) = [1]>> then\n        change x by (((PVX) + (Move Speed)) * (-1))\n    else\n        change x by ((PVX) * (-1))\n    end\n    change y by (1)\n    set [pvx v] to [0]\nend\n\nwhen I receive [jump v]\nset [pvy v] to [20]\n\nwhen [s v] key pressed\nif <not <(LEVEL) = [0]>> then\n    broadcast (Black v) and wait\n    Set Up Level\n    change [level v] by (1)\n    broadcast (Reset v) and wait\n    broadcast (Next Level v) and wait\n    wait (.01) seconds\n    broadcast (Out v) and wait\nend\n\n@Levels\n\nwhen I receive [next level v]\nnext costume\n\nwhen I receive [play game v]\nswitch costume to (level 1 v)\n\n@Black out\n\nwhen I receive [black v]\ngo to [front v] layer\nshow\n\nwhen I receive [out v]\ngo to [front v] layer\nhide\n\nwhen I receive [play game v]\ngo to [front v] layer\nset [ghost v] effect to (0)\nhide\n\n@Enemy\n\nwhen I receive [reset v]\nset rotation style [left-right v]\nbroadcast (Delete E v)\nif <(LEVEL) = [4]> then\n    go to x: (122) y: (-80)\n    set [evx v] to [0]\n    set [evy v] to [0]\n    set [border start v] to [16]\n    set [border end v] to [211]\n    create clone of (_myself_ v)\nelse\n    if <(LEVEL) = [5]> then\n        go to x: (34) y: (-100)\n        set [evx v] to [0]\n        set [evy v] to [0]\n        set [border start v] to [-50]\n        set [border end v] to [226]\n        create clone of (_myself_ v)\n        go to x: (163) y: (-90)\n        set [evx v] to [0]\n        set [evy v] to [0]\n        set [border start v] to [-50]\n        set [border end v] to [226]\n        create clone of (_myself_ v)\n    else\n        if <(LEVEL) = [7]> then\n            go to x: (43) y: (60)\n            set [evx v] to [0]\n            set [evy v] to [0]\n            set [border start v] to [23]\n            set [border end v] to [84]\n            create clone of (_myself_ v)\n        else\n            if <(LEVEL) = [8]> then\n                go to x: (-70) y: (-145)\n                set [evx v] to [0]\n                set [evy v] to [0]\n                set [border start v] to [-300]\n                set [border end v] to [300]\n                create clone of (_myself_ v)\n                go to x: (-60) y: (-145)\n                set [evx v] to [0]\n                set [evy v] to [0]\n                set [border start v] to [-300]\n                set [border end v] to [300]\n                create clone of (_myself_ v)\n                go to x: (99) y: (-143)\n                set [evx v] to [0]\n                set [evy v] to [0]\n                set [border start v] to [-300]\n                set [border end v] to [300]\n                create clone of (_myself_ v)\n                go to x: (150) y: (-143)\n                set [evx v] to [0]\n                set [evy v] to [0]\n                set [border start v] to [-300]\n                set [border end v] to [300]\n                create clone of (_myself_ v)\n            else\n                if <(LEVEL) = [9]> then\n                    go to x: (182) y: (-147)\n                    set [evx v] to [0]\n                    set [evy v] to [0]\n                    set [border start v] to [-300]\n                    set [border end v] to [300]\n                    create clone of (_myself_ v)\n                else\n                    if <(LEVEL) = [10]> then\n                        go to x: (112) y: (10)\n                        set [evx v] to [0]\n                        set [evy v] to [0]\n                        set [border start v] to [98]\n                        set [border end v] to [300]\n                        create clone of (_myself_ v)\n                        go to x: (10) y: (-86)\n                        set [evx v] to [0]\n                        set [evy v] to [0]\n                        set [border start v] to [-999]\n                        set [border end v] to [20]\n                        create clone of (_myself_ v)\n                        go to x: (-133) y: (-40)\n                        set [evx v] to [0]\n                        set [evy v] to [0]\n                        set [border start v] to [-163]\n                        set [border end v] to [300]\n                        create clone of (_myself_ v)\n                    else\n                        if <(LEVEL) = [13]> then\n                            go to x: (66) y: (-120)\n                            set [evx v] to [0]\n                            set [evy v] to [0]\n                            set [border start v] to [15]\n                            set [border end v] to [121]\n                            create clone of (_myself_ v)\n                        else\n                            if <(LEVEL) = [14]> then\n                                go to x: (-7) y: (-150)\n                                set [evx v] to [0]\n                                set [evy v] to [0]\n                                set [border start v] to [-65]\n                                set [border end v] to [66]\n                                create clone of (_myself_ v)\n                                go to x: (7) y: (-150)\n                                set [evx v] to [0]\n                                set [evy v] to [0]\n                                set [border start v] to [-65]\n                                set [border end v] to [66]\n                                create clone of (_myself_ v)\n                            else\n                                if <(LEVEL) = [15]> then\n                                    go to x: (100) y: (-127)\n                                    set [evx v] to [0]\n                                    set [evy v] to [0]\n                                    set [border start v] to [73]\n                                    set [border end v] to [173]\n                                    create clone of (_myself_ v)\n                                    go to x: (150) y: (-127)\n                                    set [evx v] to [0]\n                                    set [evy v] to [0]\n                                    set [border start v] to [73]\n                                    set [border end v] to [173]\n                                    create clone of (_myself_ v)\n                                    go to x: (170) y: (-127)\n                                    set [evx v] to [0]\n                                    set [evy v] to [0]\n                                    set [border start v] to [73]\n                                    set [border end v] to [173]\n                                    create clone of (_myself_ v)\n                                else\n                                    if <(LEVEL) = [16]> then\n                                        go to x: (-41) y: (23)\n                                        set [evx v] to [0]\n                                        set [evy v] to [0]\n                                        set [border start v] to [-300]\n                                        set [border end v] to [300]\n                                        create clone of (_myself_ v)\n                                    else\n                                        if <(LEVEL) = [18]> then\n                                            go to x: (156) y: (-154)\n                                            set [evx v] to [0]\n                                            set [evy v] to [0]\n                                            set [border start v] to [-300]\n                                            set [border end v] to [300]\n                                            create clone of (_myself_ v)\n                                            go to x: (-46) y: (-147)\n                                            set [evx v] to [0]\n                                            set [evy v] to [0]\n                                            set [border start v] to [-300]\n                                            set [border end v] to [300]\n                                            create clone of (_myself_ v)\n                                        else\n                                            if <(LEVEL) = [20]> then\n                                                go to x: (-10) y: (36)\n                                                set [evx v] to [0]\n                                                set [evy v] to [0]\n                                                set [border start v] to [-300]\n                                                set [border end v] to [300]\n                                                create clone of (_myself_ v)\n                                                go to x: (95) y: (23)\n                                                set [evx v] to [0]\n                                                set [evy v] to [0]\n                                                set [border start v] to [-300]\n                                                set [border end v] to [300]\n                                                create clone of (_myself_ v)\n                                            end\n                                        end\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen I receive [play game v]\nhide\n\nwhen I start as a clone\nshow\nforever\n    set [way v] to (pick random (0) to (1))\n    set [repeat v] to (pick random (5) to (10))\n    switch costume to (hitbox v)\n    point in direction (90)\n    set [evx v] to ((EVX) * (.0))\n    if <(pick random (0) to (1)) = [1]> then\n        repeat (Repeat)\n            point in direction (90)\n            switch costume to (hitbox v)\n            set [evx v] to ((EVX) * (.0))\n            if <(Way) = [0]> then\n                change [evx v] by (1)\n                set [direction v] to [90]\n            else\n                change [evx v] by (-1)\n                set [direction v] to [-90]\n            end\n            change x by (EVX)\n            if <<touching (levels v)?> or <<(x position) < (Border Start)> or <(x position) > (Border End)>>> then\n                change x by ((EVX) * (-1))\n                set [evx v] to [0]\n            end\n            change [evy v] by (-1)\n            change y by (EVY)\n            if <touching (levels v)?> then\n                change y by ((EVY) * (-1))\n                set [evy v] to [0]\n            end\n            switch costume to (enemy v)\n            point in direction (Direction)\n        end\n    end\n    change [evy v] by (-1)\n    change y by (EVY)\n    if <touching (levels v)?> then\n        change y by ((EVY) * (-1))\n        set [evy v] to [0]\n    end\n    if <touching (mushroom v)?> then\n    point in direction (Direction)\n    switch costume to (enemy v)\nend\n\nwhen I receive [delete e v]\ndelete this clone\n\n\n    if <(() * (30)) = [50]> then\n        if <([x position v] of [potato fox v]) < (x position)> then\n        if <(x position) < ([x position v] of [potato fox v])> then\n    end\nend\n\nwhen I receive [e j v]\nset [evy v] to [15]\n\n@Moving Platform\n\nwhen I receive [reset v]\nbroadcast (Moving v) and wait\nhide\nif <(LEVEL) = [6]> then\n    go to x: (144) y: (-150)\n    set [start x v] to (x position)\n    set [start y v] to (y position)\n    set [x v] to [-74]\n    set [y v] to [-150]\n    create clone of (_myself_ v)\nelse\n    if <(LEVEL) = [10]> then\n        go to x: (106) y: (85)\n        set [start x v] to (x position)\n        set [start y v] to (y position)\n        set [x v] to [-20]\n        set [y v] to [-150]\n        create clone of (_myself_ v)\n    else\n        if <(LEVEL) = [19]> then\n            go to x: (64) y: (-122)\n            set [start x v] to (x position)\n            set [start y v] to (y position)\n            set [x v] to [-83]\n            set [y v] to [-150]\n            create clone of (_myself_ v)\n        end\n    end\nend\n\nwhen I receive [moving v]\ndelete this clone\n\nwhen I start as a clone\nshow\nforever\n    set [move speed v] to [3]\n    repeat until <(x position) > (Start X)>\n        change x by (Move Speed)\n    end\n    set [move speed v] to [0]\n    wait (1) seconds\n    set [move speed v] to [-3]\n    repeat until <(x position) < (X)>\n        change x by (Move Speed)\n    end\n    set [move speed v] to [0]\n    wait (1) seconds\nend\n\nglide (3) secs to x: (-74) y: (Start Y)\n\nglide (3) secs to x: (Start X) y: (Y)\n\n@Mushroom\n\nwhen I receive [mush v]\ndelete this clone\n\nwhen I receive [reset v]\nhide\nbroadcast (Mush v)\nif <(LEVEL) = [7]> then\n    go to x: (-43) y: (-86)\n    create clone of (_myself_ v)\nelse\n    if <(LEVEL) = [9]> then\n        go to x: (-46) y: (-102)\n        create clone of (_myself_ v)\n        go to x: (127) y: (-171)\n        create clone of (_myself_ v)\n    else\n        if <(LEVEL) = [10]> then\n            go to x: (-211) y: (-56)\n            create clone of (_myself_ v)\n        else\n            if <(LEVEL) = [15]> then\n                go to x: (-136) y: (-131)\n                create clone of (_myself_ v)\n            else\n                if <(LEVEL) = [16]> then\n                    go to x: (-145) y: (-40)\n                    create clone of (_myself_ v)\n                    go to x: (-21) y: (-130)\n                    create clone of (_myself_ v)\n                    go to x: (129) y: (-144)\n                    create clone of (_myself_ v)\n                else\n                    if <(LEVEL) = [18]> then\n                        go to x: (110) y: (-111)\n                        create clone of (_myself_ v)\n                    else\n                        if <(LEVEL) = [20]> then\n                            go to x: (-113) y: (-129)\n                            create clone of (_myself_ v)\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen I start as a clone\nshow\nforever\n    if <touching (potato fox v)?> then\n        broadcast (jump v)\n        switch costume to (mush 2 v)\n        wait (.1) seconds\n        switch costume to (mush 1 v)\n    end\n    if <touching (enemy v)?> then\n        broadcast (E j v)\n        switch costume to (mush 2 v)\n        wait (.1) seconds\n        switch costume to (mush 1 v)\n    end\nend\n\nbroadcast (Mush v) and wait\n\n@Start Game\n\nwhen flag clicked\nhide\ngo to [front v] layer\nset [id v] to [1]\nswitch costume to (02 v)\ngo to x: (0) y: (0)\ncreate clone of (_myself_ v)\nset [id v] to [2]\nswitch costume to (03 v)\ngo to x: (0) y: (0)\ncreate clone of (_myself_ v)\nset [id v] to [3]\nswitch costume to (04 v)\ngo to x: (166) y: (-148)\ncreate clone of (_myself_ v)\nset [id v] to [4]\nswitch costume to (loader v)\ngo to x: (-110) y: (-148)\ncreate clone of (_myself_ v)\nset [id v] to [5]\nswitch costume to (01 v)\ngo to x: (0) y: (0)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nshow\nforever\n    if <(ID) = [1]> then\n        go to x: ((mouse x) / (50)) y: ((mouse y) / (50))\n    else\n        if <(ID) = [2]> then\n            go to x: ((mouse x) / (70)) y: ((mouse y) / (70))\n        else\n            if <(ID) = [3]> then\n                go to x: (((mouse x) / (50)) + (160)) y: (((mouse y) / (50)) + (-135))\n                if <touching (mouse-pointer v)?> then\n                    set size to (105) %\n                    if <mouse down?> then\n                        broadcast (Play Game v) and wait\n                    end\n                else\n                    set size to (100) %\n                end\n            else\n                if <(ID) = [5]> then\n                    go to x: ((mouse x) / (10)) y: ((mouse y) / (10))\n                else\n                    go to x: (((mouse x) / (20)) + (-90)) y: (((mouse y) / (20)) + (-140))\n                end\n            end\n        end\n    end\nend\n\nwhen I receive [play game v]\nhide\n\n@ Smash\n\nwhen I receive [reset v]\nbroadcast (Smash v) and wait\nhide\nif <(LEVEL) = [12]> then\n    go to x: (-16) y: (-11)\n    create clone of (_myself_ v)\nelse\n    if <(LEVEL) = [13]> then\n        go to x: (-55) y: (-5)\n        create clone of (_myself_ v)\n    else\n        if <(LEVEL) = [14]> then\n            go to x: (70) y: (-5)\n            create clone of (_myself_ v)\n            go to x: (206) y: (-5)\n            create clone of (_myself_ v)\n        else\n            if <(LEVEL) = [17]> then\n                go to x: (101) y: (-32)\n                create clone of (_myself_ v)\n                go to x: (-120) y: (-103)\n                create clone of (_myself_ v)\n                go to x: (-73) y: (-80)\n                create clone of (_myself_ v)\n            else\n                if <(LEVEL) = [18]> then\n                    go to x: (7) y: (42)\n                    create clone of (_myself_ v)\n                else\n                    if <(LEVEL) = [19]> then\n                        go to x: (150) y: (-1)\n                        create clone of (_myself_ v)\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen I receive [smash v]\ndelete this clone\n\nwhen I start as a clone\nshow\nset [sy v] to [0]\nforever\n    if <not <(SY) < [-8]>> then\n        change [sy v] by (-1)\n    end\n    change y by (SY)\n    if <touching (levels v)?> then\n        change y by ((SY) * (-1))\n        set [sy v] to [15]\n    end\nend\n\ngo to x: (206) y: (-5)\ncreate clone of (_myself_ v)\n\n@End Screen\n\nwhen I receive [reset v]\nif <(LEVEL) = [20]> then\n    switch costume to (end screen v)\n    show\n    go to x: (0) y: (0)\n    go to [front v] layer\nend\n\nstop [all v]\n\nwhen flag clicked\nhide\n\n\n\nbroadcast (End v) and wait\n\nif <(LEVEL) = [20]> then\nend\n\n