The Platformer II {DEMO}

Instructions: Hey! Welcome to the early demo for The Platformer II!\nThis is a sneak-peek of a game that's being worked on for a collaboration! Instructions down below!\n\nYou can use WASD, or Arrow Keys to move around!\nYou can use your mouse to identify and interact with things. [So far, only three things]\nYou can click the door to exit the house!\n{Currently, there are only Arrow Key controls when you leave the house, WASD is yet to be added}\n\nThis is a very early demo, there may be bugs and glitches, hopefully you can comment them down below to help us out!\nTo support the project, love and favorite, and feel free to follow!

@Stage\n\nwhen flag clicked\nset [the level v] to [1]\nforever\n    switch backdrop to (The Level)\nend\n\n@Blank\n\n@Player Hitbox\n\nwhen flag clicked\nset [the level v] to [1]\nbroadcast (Next Level v)\nforever\n    if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n        change [x velocity v] by (-1.5)\n    end\n    if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n        change [x velocity v] by (1.5)\n    end\n    set [x velocity v] to ((X Velocity) * (0.85))\n    change x by (X Velocity)\n    if <touching (ground v)?> then\n        change y by (1)\n    end\n    if <touching (ground v)?> then\n        change y by (1)\n    end\n    if <touching (ground v)?> then\n        change y by (1)\n    end\n    if <touching (ground v)?> then\n        change y by (1)\n    end\n    if <touching (ground v)?> then\n        change y by (-4)\n        change x by ((X Velocity) * (-1))\n    end\n    change [y velocity v] by (-1)\n    change y by (Y Velocity)\n    if <touching (ground v)?> then\n        change y by ((Y Velocity) - ((Y Velocity) * (2)))\n        set [y velocity v] to [0]\n        if <<key (down arrow v) pressed?> or <key (s v) pressed?>> then\n            switch costume to (crouch v)\n        else\n            switch costume to (player v)\n        end\n    end\n    change y by (-1)\n    if <<touching (ground v)?> and <<key (up arrow v) pressed?> or <key (w v) pressed?>>> then\n        set [y velocity v] to [15]\n    end\n    change y by (1)\n    if <(x position) > [239]> then\n        broadcast (Next Level v) and wait\n        change [the level v] by (1)\n    end\n    if <touching (spikes v)?> then\n        broadcast (Reset v)\n        create clone of (_myself_ v)\n    else\n        if <<key (down arrow v) pressed?> or <key (s v) pressed?>> then\n            switch costume to (crouch v)\n        else\n            switch costume to (player v)\n        end\n        if <touching (lava v)?> then\n            broadcast (Reset v)\n        end\n    end\nend\n\nwhen I start as a clone\nclear graphic effects\nrepeat (10)\n    change [ghost v] effect by (10)\n    change y by (5)\n    turn right (5) degrees\nend\ndelete this clone\n\nwhen I receive [next level v]\nbroadcast (Reset v)\n\nwhen I receive [reset v]\nset [x velocity v] to [0]\nset [y velocity v] to [0]\ngo to x: (120) y: (70)\n\nwhen flag clicked\nforever\n    set [ghost v] effect to (100)\nend\n\nwhen flag clicked\nforever\n    if <(Inside House?) = [0]> then\n        go to x: (120) y: (70)\n    end\nend\n\n@Ground\n\nwhen flag clicked\nforever\n    switch costume to (The Level)\nend\n\nwhen flag clicked\nforever\n    set [ghost v] effect to (100)\nend\n\nset [ghost v] effect to (0)\n\nwhen flag clicked\nforever\n    if <(Inside House?) = [1]> then\n        show\n    else\n        hide\n    end\nend\n\n@Ground Art\n\nwhen flag clicked\nforever\n    switch costume to (The Level)\nend\n\nwhen flag clicked\nforever\n    if <(Inside House?) = [1]> then\n        show\n    else\n        hide\n    end\nend\n\n@Player\n\nwhen flag clicked\nforever\n    if <(Inside House?) = [1]> then\n        show\n    else\n        hide\n    end\nend\n\nwhen flag clicked\nset size to (100) %\n\nwhen flag clicked\n\nwhen flag clicked\n\nwhen I receive [start game v]\n\nwhen I receive [start game v]\nforever\n\nwhen I receive [start game v]\n\nforever\n\nwhen I receive [start game v]\n\nbroadcast (Start Game v)\n\nwhen flag clicked\n\nwhen I receive [start game v]\n\nbroadcast (Start Game v)\n\nbroadcast (Start Game v)\n\nwhen flag clicked\nforever\n    if <(Inside House?) = [1]> then\n        if <key (right arrow v) pressed?> then\n            point in direction (90)\n        end\n        if <key (left arrow v) pressed?> then\n            point in direction (-90)\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Inside House?) = [1]> then\n        if <<<<key (up arrow v) pressed?> or <<key (right arrow v) pressed?> or <key (left arrow v) pressed?>>> or <key (w v) pressed?>> or <<key (d v) pressed?> or <key (a v) pressed?>>> then\n            next costume\n        else\n            switch costume to (run21 v)\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Inside House?) = [1]> then\n        if <key (d v) pressed?> then\n            point in direction (90)\n        end\n        if <key (a v) pressed?> then\n            point in direction (-90)\n        end\n    end\nend\n\nforever\n\nwhen flag clicked\nforever\n    if <(Inside House?) = [1]> then\n        go to (player hitbox v)\n    end\nend\n\nset [inside house? v] to [1]\n\nset [inside house? v] to [0]\n\n@Door\n\nwhen flag clicked\nforever\n    if <(Inside House?) = [1]> then\n        show\n    else\n        hide\n    end\nend\n\nwhen I receive [exit house v]\nswitch costume to (door-1 v)\nrepeat (9)\n    next costume\nend\nswitch costume to (door-10 v)\nwait (1.4) seconds\nswitch costume to (door-1 v)\n\nswitch costume to (door-1 v)\n\nwhen flag clicked\nforever\n    if <touching (mouse-pointer v)?> then\n        repeat (10)\n            change [brightness v] effect by (1)\n        end\n        wait (0.1) seconds\n        repeat (10)\n            change [brightness v] effect by (-1)\n        end\n        wait (0.1) seconds\n    else\n        set [brightness v] effect to (0)\n    end\nend\n\nwhen flag clicked\nforever\n    if <touching (mouse-pointer v)?> then\n        if <mouse down?> then\n            broadcast (Exit House v)\n            wait (0.3) seconds\n            broadcast (Transition v)\n            wait (1) seconds\n            set [inside house? v] to [0]\n        end\n    end\nend\n\nwhen flag clicked\nset [inside house? v] to [1]\n\nwhen I receive [enter house v]\nswitch costume to (door-1 v)\n\nwhen flag clicked\nbroadcast (Enter House v)\n\n@Mouse-Pointer\n\nwhen flag clicked\nforever\n    go to (mouse-pointer v)\nend\n\nwhen flag clicked\nforever\n    if <touching (door v)?> then\n        switch costume to (mouse-pointer \(door\) v)\n    end\n    if <touching (player v)?> then\n        switch costume to (mouse-pointer \(you\) v)\n    end\n    if <touching (ground \(house\) v)?> then\n        switch costume to (mouse-pointer \(house\) v)\n    end\n    if <not <<touching (door v)?> or <<touching (door v)?> or <touching (ground \(house\) v)?>>>> then\n        switch costume to (mouse-pointer v)\n    end\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [begin demo v]\nshow\n\n@Transition\n\nwhen I receive [transition v]\nshow\ngo to x: (-470) y: (0)\nglide (1) secs to x: (0) y: (0)\nwait (0.1) seconds\nglide (1) secs to x: (470) y: (0)\nhide\n\n@Ground (Scrolling)\n\nwhen I receive [setup v]\ngo to x: (0) y: (0)\nset [y v] to [0]\nset [x v] to [0]\nswitch costume to (sizer v)\nset size to (300) %\nswitch costume to (level v)\n\nwhen I receive [move level v]\ngo to x: ((x) - (SCROLLX)) y: ((y) - (SCROLLY))\n\nwhen flag clicked\nforever\n    go to [back v] layer\nend\n\nwhen flag clicked\nforever\n    if <(Inside House?) = [0]> then\n        show\n    else\n        hide\n    end\nend\n\nwhen flag clicked\nforever\n    set [ghost v] effect to (100)\nend\n\n@Player Hitbox (Scrolling)\n\nwhen flag clicked\nset [scrollx v] to [0]\nset [scrolly v] to [0]\nbroadcast (Setup v) and wait\n\n    broadcast (Move Level v)\n    broadcast (Player Move v)\nend\n\nwhen I receive [player move v]\nPlayer Move\n\ndefine Player Move\nif <key (up arrow v) pressed?> then\n    Try Move X [0] Y [4]\nend\nif <key (down arrow v) pressed?> then\n    Try Move X [0] Y [-4]\nend\nif <key (right arrow v) pressed?> then\n    Try Move X [4] Y [0]\nend\nif <key (left arrow v) pressed?> then\n    Try Move X [-4] Y [0]\nend\nchange [scrollx v] by (round (((x) - (SCROLLX)) / (5)))\nchange [scrolly v] by (round (((y) - (SCROLLY)) / (5)))\n\ndefine Try Move X (add x) Y (add y)\ngo to x: (((x) + (add x)) - (SCROLLX)) y: (((y) + (add y)) - (SCROLLY))\nif <not <touching (ground \(scrolling\) v)?>> then\n    change [x v] by (add x)\n    change [y v] by (add y)\nend\n\nwhen I receive [move level v]\ngo to x: ((x) - (SCROLLX)) y: ((y) - (SCROLLY))\n\nwhen flag clicked\nset [ghost v] effect to (100)\nset [x v] to [0]\nset [y v] to [80]\n\nwhen I receive [start engine v]\nset [x v] to [0]\nset [y v] to [0]\n\nwhen flag clicked\nforever\n    if <(Engine?) = [1]> then\n        show\n    else\n        hide\n    end\nend\n\nwhen flag clicked\nhide\n\nwhen flag clicked\nforever\n    if <(Inside House?) = [0]> then\n        show\n    else\n        hide\n    end\nend\n\nwhen I receive [exit house v]\nset [ghost v] effect to (100)\nset [x v] to [0]\nset [y v] to [80]\n\n@Player (Scrolling\n\nwhen flag clicked\ngo to x: (-8) y: (7)\nswitch costume to (run1 v)\nforever\n    if <not <key (any v) pressed?>> then\n        switch costume to (run1 v)\n    else\n        if <<key (up arrow v) pressed?> or <<key (down arrow v) pressed?> or <<key (right arrow v) pressed?> or <key (left arrow v) pressed?>>>> then\n            repeat until <not <<key (up arrow v) pressed?> or <<key (down arrow v) pressed?> or <<key (right arrow v) pressed?> or <key (left arrow v) pressed?>>>>>\n                next costume\n                wait (0.01) seconds\n                next costume\n                next costume\n            end\n        end\n    end\nend\n\nwhen flag clicked\nset [color v] effect to (0)\n\nwhen flag clicked\nforever\n    go to (player hitbox \(scrolling\) v)\nend\n\nwhen flag clicked\nforever\n    if <key (right arrow v) pressed?> then\n        point in direction (90)\n    end\n    if <key (left arrow v) pressed?> then\n        point in direction (-90)\n    end\nend\n\nwhen flag clicked\nforever\n    if <<key (up arrow v) pressed?> or <<key (down arrow v) pressed?> or <<key (right arrow v) pressed?> or <key (left arrow v) pressed?>>>> then\n        start sound (pick random (1) to (2))\n        wait (0.2) seconds\n    end\nend\n\nwhen flag clicked\nforever\n    if <touching (test {helpful} v)?> then\n        go [forward v] (1) layers\n    else\n        go [backward v] (1) layers\n    end\nend\n\nwhen flag clicked\nforever\n    if <(costume [number v]) = [22]> then\n        switch costume to (run2 v)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Inside House?) = [0]> then\n        set volume to (100) %\n        show\n    else\n        set volume to (0) %\n        hide\n    end\nend\n\nwhen flag clicked\nhide\n\n@Ground (Fence-1)\n\nwhen I receive [setup v]\ngo to x: (0) y: (0)\nset [y v] to [0]\nset [x v] to [0]\nswitch costume to (sizer v)\nset size to (300) %\nswitch costume to (level v)\n\nwhen I receive [move level v]\ngo to x: ((x) - (SCROLLX)) y: ((y) - (SCROLLY))\n\nwhen flag clicked\nforever\n    if <(Inside House?) = [0]> then\n        show\n    else\n        hide\n    end\nend\n\n@Ground (Fence-2)\n\nwhen I receive [setup v]\ngo to x: (0) y: (0)\nset [y v] to [0]\nset [x v] to [0]\nswitch costume to (sizer v)\nset size to (300) %\nswitch costume to (level v)\n\nwhen I receive [move level v]\ngo to x: ((x) - (SCROLLX)) y: ((y) - (SCROLLY))\n\nwhen flag clicked\nforever\n    if <(Inside House?) = [0]> then\n        show\n    else\n        hide\n    end\nend\n\nwhen flag clicked\nforever\n    go to [back v] layer\nend\n\n@Identity\n\nwhen flag clicked\nforever\n    if <(Inside House?) = [0]> then\n        show\n    else\n        hide\n    end\nend\n\n@Ground (House)\n\nwhen I receive [setup v]\ngo to x: (0) y: (0)\nset [y v] to [0]\nset [x v] to [0]\nswitch costume to (sizer v)\nset size to (300) %\nswitch costume to (level v)\n\nwhen I receive [move level v]\ngo to x: ((x) - (SCROLLX)) y: ((y) - (SCROLLY))\n\nwhen flag clicked\nforever\n    go to [back v] layer\nend\n\nwhen flag clicked\nforever\n    if <(Inside House?) = [0]> then\n        show\n    else\n        hide\n    end\nend\n\nwhen flag clicked\nforever\n    if <touching (mouse-pointer v)?> then\n        repeat (10)\n            change [brightness v] effect by (1)\n        end\n        wait (0.1) seconds\n        repeat (10)\n            change [brightness v] effect by (-1)\n        end\n    else\n        set [brightness v] effect to (0)\n    end\nend\n\nwhen flag clicked\nforever\n    if <touching (mouse-pointer v)?> then\n        if <mouse down?> then\n            broadcast (Transition v)\n            wait (1) seconds\n            set [inside house? v] to [1]\n        end\n    end\nend\n\n@Intro-1\n\nwhen flag clicked\nshow\nset [ghost v] effect to (0)\ngo to x: (0) y: (-1300)\nrepeat until <(y position) = [0]>\n    change y by (5)\nend\n\nwhen I receive [end intro v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\n\n@Intro-2\n\nwhen flag clicked\nshow\nset [ghost v] effect to (100)\nswitch costume to (intro-1 v)\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nwait (1) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nswitch costume to (intro-2 v)\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nwait (1) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nswitch costume to (intro-3 v)\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nwait (1) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nswitch costume to (intro-4 v)\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nwait (1) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nswitch costume to (intro-5 v)\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nwait (1) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nswitch costume to (intro-6 v)\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nwait (1) seconds\nbroadcast (End Intro v)\n\nwhen I receive [end intro v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nbroadcast (Begin Demo v)\nhide\n\nwhen I receive [begin demo v]\nset [inside house? v] to [1]\n\nwhen flag clicked\nset [inside house? v] to [0]\n\n@Sprite1\n\nwhen flag clicked\nforever\n    go to [front v] layer\nend\n\nwhen flag clicked\nset [ghost v] effect to (100)\n\n