Views - A 2.5D Platformer

Instructions: Views\nThere are two modes\nX to switch modes.\n- Mode one (Birds eye view)\nArrow keys to move \nZ to Jump or space\n- Mode Two (Side view)\nArrow key to move (platfoming)\nHarder\n@https://scratch.mit.edu/projects/916950533/

@Stage\n\nwhen [t v] key pressed\nif <(R) = [0]> then\n    show variable [time v]\n    show variable [☁ best time v]\n    set [r v] to [1]\nelse\n    hide variable [time v]\n    hide variable [☁ best time v]\n    set [r v] to [0]\nend\n\nwhen I receive [start v]\nswitch backdrop to (backdrop1 v)\nset [level v] to [1]\nset [time v] to [0]\nwait until <<<<key (left arrow v) pressed?> or <key (right arrow v) pressed?>> or <key (down arrow v) pressed?>> or <key (up arrow v) pressed?>>\nrepeat until <(Level) = [8]>\n    if <(Pause) = [0]> then\n        wait (0.001) seconds\n        change [time v] by (0.1)\n    end\nend\n\nwhen I receive [start v]\nset [pause v] to [0]\nrepeat until <key (q v) pressed?>\n    repeat until <key (r v) pressed?>\nend\nbroadcast (Start v)\n\ndefine Set\nrepeat until <(Time) = (☁ Best Time)>\n    set [☁ best time v] to (Time)\nend\n\nset [☁ best time v] to [126.1]\n\nwhen flag clicked\nforever\n    if <(Level) = [8]> then\n        if <(Time) < (☁ Best Time)> then\n            Set\n        end\n    end\nend\n\nset [level v] to [7]\n\nwhen [p v] key pressed\nif <(Pause) = [0]> then\n    set [pause v] to [1]\nelse\n    set [pause v] to [0]\nend\n\nwhen I receive [main v]\nswitch backdrop to (backdrop2 v)\n\n@Dude\n\nwhen I receive [scroll v]\ngo to x: (() - ()) y: (() - ())\n\ndefine Walls\nif <touching color (#000000)?> then\n    change y by (1)\n    repeat until <not <touching color (#000000)?>>\n        if <(XV) < [0]> then\n            change x by (1)\n        else\n            change x by (-1)\n        end\n    end\nend\n\ndefine Ground\nif <touching color (#000000)?> then\n    repeat until <not <touching color (#000000)?>>\n        if <(YV) < [0]> then\n            change y by (1)\n        else\n            change y by (-1)\n        end\n    end\n    set [yv v] to [0]\n    change y by (-1)\n    if <touching color (#000000)?> then\n        if <<<key (up arrow v) pressed?> or <(JUMP KEY?) = [1]>> or <<<(y position) < (mouse x)> and <mouse down?>> and <(Device) = [MOBILE]>>> then\n            set [yv v] to [15]\n        end\n    end\n    change y by (1)\nend\n\nwhen I receive [start v]\nshow\nset [veiw v] to [1]\nset size to (100) %\ngo to x: (0) y: (0)\nset [xv v] to [0]\nset [yv v] to [0]\nset [jump v] to [0]\nset [cam x v] to [-650]\nset [cam y v] to [-465]\nforever\n    if <(Pause) = [1]> then\nend\n\nwhen flag clicked\nset [r v] to [0]\nhide variable [☁ best time v]\nhide\n\nwhen I receive [start v]\nforever\n    change [cam x v] by (x position)\n    change [cam y v] by (y position)\n    broadcast (Scroll v)\n    if <touching color (#bdffff)?> then\n        change [level v] by (1)\n        set [veiw v] to [1]\n        set size to (100) %\n        go to x: (0) y: (0)\n        set [xv v] to [0]\n        set [yv v] to [0]\n        set [jump v] to [0]\n        set [cam x v] to [-650]\n        set [cam y v] to [-465]\n    end\n    if <touching color (#ff0000)?> then\n        if <(size) = [100]> then\n            set [veiw v] to [1]\n            set size to (100) %\n            go to x: (0) y: (0)\n            set [xv v] to [0]\n            set [yv v] to [0]\n            set [jump v] to [0]\n            set [cam x v] to [-650]\n            set [cam y v] to [-465]\n        end\n    end\nend\n\nwhen I receive [change v]\nswitch costume to (3 v)\nif <(Veiw) = [1]> then\n    set [veiw v] to [2]\nelse\n    set [veiw v] to [1]\nend\nwait until <not <key (x v) pressed?>>\nwait until <not <mouse down?>>\n\n@Platform\n\nwhen I receive [scroll v]\ngo to x: (() - (CAM X)) y: (() - (CAM Y))\n\nwhen I receive [start v]\nshow\nset [level v] to [1]\nforever\n    switch costume to (blank v)\n    set size to (300) %\n    switch costume to (Level)\nend\n\nwhen flag clicked\nhide variable [☁ best time v]\nhide variable [time v]\nhide\n\n@Thumb Nail\n\nwhen flag clicked\ngo to [front v] layer\nhide\n\nforever\n    show\n    go to [front v] layer\nend\n\n@Intro\n\nwhen flag clicked\nset size to (100) %\nset [ghost v] effect to (0)\nset [intro v] to [0]\npoint in direction (90)\nhide\ngo to x: (0) y: (150)\nswitch costume to (drop v)\ncreate clone of (_myself_ v)\nwait (0.5) seconds\nrepeat (50)\n    go to x: (0) y: (0)\n    switch costume to (dot v)\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nshow\nif <(costume [name v]) = [Drop]> then\n    set [ghost v] effect to (100)\n    set [intro v] to [0]\n    repeat until <(y position) < [-200]>\n        change [intro v] by (-1)\n        change y by (Intro)\n        change [ghost v] effect by (-10)\n    end\n    wait (1) seconds\n    repeat (20)\n        change [ghost v] effect by (5)\n    end\nend\nif <(costume [name v]) = [Dot]> then\n    point in direction (90)\n    turn right (pick random (0) to (360)) degrees\n    repeat (20)\n        move (15) steps\n        change [ghost v] effect by (5)\n    end\nend\nif <(costume [name v]) = [Full]> then\n    set [ghost v] effect to (100)\n    set size to (5) %\n    go to x: (0) y: (0)\n    point in direction (0)\n    repeat (50)\n        change [ghost v] effect by (-10)\n        change size by (((100) - (size)) / (7))\n        turn right (((100) - (size)) / (7)) degrees\n        go to [front v] layer\n    end\n    broadcast (Main v)\n    repeat (50)\n        go to [front v] layer\n        change [ghost v] effect by (10)\n        change size by (((5) - (size)) / (7))\n        turn right (((5) - (size)) / (7)) degrees\n    end\nend\ndelete this clone\n\nwhen flag clicked\nwait (0.5) seconds\nswitch costume to (full v)\ncreate clone of (_myself_ v)\n\n@Main Menu\n\nwhen flag clicked\nset [main v] to [0]\nset [device v] to [PC]\nhide\ngo to x: (0) y: (0)\n\nwhen I receive [main v]\nshow\nswitch costume to (play v)\ngo to x: (0) y: (0)\ncreate clone of (_myself_ v)\nswitch costume to (pc v)\ngo to x: (0) y: (-60)\ncreate clone of (_myself_ v)\nswitch costume to (mobile v)\ngo to x: (0) y: (-120)\ncreate clone of (_myself_ v)\nhide\n\nwhen I start as a clone\nrepeat until <(Main) = [1]>\n    if <(costume [name v]) = [Play]> then\n        if <touching (mouse-pointer v)?> then\n            change size by (((110) - (size)) / (7))\n            if <mouse down?> then\n                wait until <not <mouse down?>>\n                set [main v] to [1]\n                broadcast (Start v)\n            end\n        else\n            change size by (((100) - (size)) / (7))\n        end\n    end\n    if <(costume [name v]) = [PC]> then\n        if <(Device) = [MOBILE]> then\n            set [brightness v] effect to (0)\n            if <touching (mouse-pointer v)?> then\n                change size by (((110) - (size)) / (7))\n                if <mouse down?> then\n                    set [device v] to [PC]\n                    wait until <not <mouse down?>>\n                end\n            else\n                change size by (((100) - (size)) / (7))\n            end\n        else\n            change size by (((90) - (size)) / (7))\n            set [brightness v] effect to (-10)\n        end\n    end\n    if <(costume [name v]) = [MOBILE]> then\n        if <(Device) = [PC]> then\n            set [brightness v] effect to (0)\n            if <touching (mouse-pointer v)?> then\n                change size by (((110) - (size)) / (7))\n                if <mouse down?> then\n                    set [device v] to [MOBILE]\n                    wait until <not <mouse down?>>\n                end\n            else\n                change size by (((100) - (size)) / (7))\n            end\n        else\n            change size by (((90) - (size)) / (7))\n            set [brightness v] effect to (-10)\n        end\n    end\nend\ndelete this clone\n\n@Buttons\n\nwhen flag clicked\nhide\n\nwhen I receive [start v]\ngo to x: (0) y: (0)\nif <(Device) = [MOBILE]> then\n    set [ghost v] effect to (50)\n    show\n    switch costume to (jump v)\n    create clone of (_myself_ v)\n    switch costume to (change v)\n    create clone of (_myself_ v)\n    hide\nend\n\nwhen I start as a clone\nforever\n    go to [front v] layer\n    if <(costume [name v]) = [Change]> then\n        go to x: (-200) y: (-140)\n        if <mouse down?> then\n        end\n        if <touching (mouse-pointer v)?> then\n            set [button v] to [1]\n            if <mouse down?> then\n                broadcast (Change v) and wait\n                change [move v] by (-1)\n            end\n        end\n    end\n    if <(costume [name v]) = [Jump]> then\n        if <mouse down?> then\n            go to x: (0) y: (0)\n            point towards (mouse-pointer v)\n            move (75) steps\n            point in direction (90)\n        end\n        if <touching (mouse-pointer v)?> then\n            set [button v] to [1]\n            if <mouse down?> then\n                set [jump key? v] to [1]\n            else\n                set [jump key? v] to [0]\n            end\n        end\n        if <not <touching (mouse-pointer v)?>> then\n            set [button v] to [0]\n            set [jump key? v] to [0]\n        end\n    end\nend\n\n