Harry Potter Platformer

Instructions: The instructions will be in-game.

@Stage\n\nwhen flag clicked\nforever\n    if <[12] > ([costume # v] of [sprite2 v])> then\n        switch backdrop to (wall 2 v)\n    else\n        switch backdrop to (stars v)\n    end\nend\n\nwhen flag clicked\nforever\n    play sound [Harry Potter theme v] until done\nend\n\n@Sprite3\n\nwhen flag clicked\nset [d v] to [1]\nwait (2) seconds\nclear graphic effects\nswitch costume to (costume1 v)\nset size to (35) %\nset rotation style [left-right v]\npoint in direction (90)\ngo to x: (0) y: (0)\nforever\n    go to (sprite10 v)\n    if <(d) = [1]> then\n        start sound [Sneeze2 v]\n        repeat (10)\n            set rotation style [all around v]\n            turn right (15) degrees\n            change [ghost v] effect by (10)\n        end\n        set [x v] to [0]\n        set [y v] to [0]\n        set x to (-230)\n        set y to (-90)\n        point in direction (90)\n        set [d v] to [0]\n        repeat (10)\n            set rotation style [left-right v]\n            change [ghost v] effect by (-10)\n        end\n    else\n        if <key (right arrow v) pressed?> then\n            change [x v] by (0)\n            point in direction (90)\n        end\n        if <key (left arrow v) pressed?> then\n            change [x v] by (0)\n            point in direction (-90)\n        end\n    end\nend\n\nwhen flag clicked\nset [s v] to [Stupefy]\nforever\n    wait until <key (down arrow v) pressed?>\n    set [s v] to [Expecto Patronum]\n    wait until <not <key (down arrow v) pressed?>>\n    wait until <key (down arrow v) pressed?>\n    set [s v] to [Stupefy]\n    wait until <not <key (down arrow v) pressed?>>\nend\n\nwhen flag clicked\nforever\n    if <key (space v) pressed?> then\n        switch costume to (costume3 v)\n        start sound [Laugh2 v]\n        if <(pick random (1) to (2)) = [1]> then\n            start sound [Low Whoosh v]\n        else\n            start sound [High Whoosh v]\n        end\n        if <(s) = [Expecto Patronum]> then\n            wait (2.5) seconds\n        else\n            wait (1) seconds\n        end\n        switch costume to (costume1 v)\n        wait until <not <key (space v) pressed?>>\n    else\n        if <<key (right arrow v) pressed?> or <key (left arrow v) pressed?>> then\n            switch costume to (costume1 v)\n            wait (0.1) seconds\n            switch costume to (costume2 v)\n            wait (0.1) seconds\n        else\n            switch costume to (costume1 v)\n        end\n    end\nend\n\nwhen I receive [d v]\nset [d v] to [1]\n\nwhen flag clicked\nhide variable [s v]\nwait (2) seconds\nshow variable [s v]\n\n@Sprite2\n\nwhen flag clicked\nswitch costume to (costume3 v)\nforever\n    go to x: (0) y: (0)\nend\n\nwhen I receive [message1 v]\nnext costume\n\nwhen I receive [m v]\nswitch costume to ((costume [number v]) - (1))\n\n@Sprite1\n\nwhen flag clicked\nwait (2) seconds\nforever\n    hide\n    set size to (15) %\n    if <<key (space v) pressed?> and <(s) = [Stupefy]>> then\n        repeat (25)\n            create clone of (_myself_ v)\n        end\n        wait until <not <key (space v) pressed?>>\n    end\nend\n\nwhen I start as a clone\nshow\ngo to (sprite3 v)\npoint in direction ([direction v] of [sprite3 v])\nmove (50) steps\nif <(pick random (1) to (2)) = [1]> then\n    turn left (15) degrees\n    forever\n        repeat (4)\n            move (5) steps\n            turn right (5) degrees\n        end\n        repeat (4)\n            move (5) steps\n            turn left (5) degrees\n        end\n    end\nelse\n    turn right (15) degrees\n    forever\n        repeat (4)\n            move (5) steps\n            turn left (5) degrees\n        end\n        repeat (4)\n            move (5) steps\n            turn right (5) degrees\n        end\n    end\nend\n\nwhen I start as a clone\nwait (1) seconds\nrepeat (5)\n    change [ghost v] effect by (20)\nend\ndelete this clone\n\nwhen I start as a clone\nwait until <touching (sprite2 v)?>\nforever\n    move (-5) steps\nend\n\nwhen I receive [m v]\ndelete this clone\n\nwhen I receive [message1 v]\ndelete this clone\n\n@Sprite4\n\nwhen flag clicked\nforever\n    go to [front v] layer\n    go to x: (0) y: (0)\nend\n\nwhen flag clicked\nwait (2) seconds\nrepeat (100)\n    change [ghost v] effect by (1)\nend\n\n@Sprite5\n\nwhen flag clicked\ngo to [front v] layer\nswitch costume to (costume1 v)\ngo to x: (0) y: (0)\nforever\n    if <(costume [number v]) = [15]> then\n        change [color v] effect by (5)\n    else\n        clear graphic effects\n    end\nend\n\nwhen I receive [m v]\nswitch costume to ((costume [number v]) - (1))\n\nwhen I receive [message1 v]\nnext costume\n\nwhen flag clicked\ngo to [front v] layer\nswitch costume to (costume1 v)\ngo to x: (0) y: (0)\nforever\n    if <(costume [number v]) = [15]> then\n        play sound [Triumph v] until done\n    else\n        clear sound effects\n    end\nend\n\n@Sprite6\n\nwhen flag clicked\npoint in direction (90)\ngo to [back v] layer\nset size to (35) %\nhide\nforever\n    if <([costume # v] of [sprite2 v]) = [4]> then\n        go to x: (0) y: (-85)\n        create clone of (_myself_ v)\n        wait until <not <([costume # v] of [sprite2 v]) = [4]>>\n    end\n    if <([costume # v] of [sprite2 v]) = [5]> then\n        go to x: (-65) y: (-80)\n        create clone of (_myself_ v)\n        go to x: (155) y: (30)\n        create clone of (_myself_ v)\n        wait until <not <([costume # v] of [sprite2 v]) = [5]>>\n    end\n    if <([costume # v] of [sprite2 v]) = [6]> then\n        go to x: (-80) y: (-95)\n        create clone of (_myself_ v)\n        wait until <not <([costume # v] of [sprite2 v]) = [6]>>\n    end\n    if <([costume # v] of [sprite2 v]) = [10]> then\n        go to x: (-40) y: (10)\n        create clone of (_myself_ v)\n        wait until <not <([costume # v] of [sprite2 v]) = [10]>>\n    end\n    if <([costume # v] of [sprite2 v]) = [11]> then\n        go to x: (135) y: (70)\n        point in direction (-90)\n        create clone of (_myself_ v)\n        point in direction (90)\n        wait until <not <([costume # v] of [sprite2 v]) = [11]>>\n    end\n    if <([costume # v] of [sprite2 v]) = [12]> then\n        go to x: (-125) y: (-135)\n        create clone of (_myself_ v)\n        point in direction (180)\n        go to x: (0) y: (-110)\n        create clone of (_myself_ v)\n        point in direction (90)\n        wait until <not <([costume # v] of [sprite2 v]) = [12]>>\n    end\n    if <([costume # v] of [sprite2 v]) = [15]> then\n        go to x: (160) y: (-135)\n        create clone of (_myself_ v)\n        go to x: (60) y: (-135)\n        create clone of (_myself_ v)\n        wait until <not <([costume # v] of [sprite2 v]) = [15]>>\n    end\nend\n\nwhen I start as a clone\nclear graphic effects\nshow\nwait until <touching (sprite1 v)?>\nstart sound [Chomp v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\ndelete this clone\n\nwhen I start as a clone\nforever\n    repeat (10)\n        turn right (5) degrees\n    end\n    repeat (20)\n        turn left (5) degrees\n    end\n    repeat (10)\n        turn right (5) degrees\n    end\nend\n\nwhen I receive [message1 v]\ndelete this clone\n\nwhen I receive [m v]\ndelete this clone\n\n@Sprite7\n\nwhen flag clicked\nset rotation style [left-right v]\npoint in direction (90)\ngo to [back v] layer\nset size to (50) %\nhide\ngo to x: (100) y: (180)\nforever\n    if <([costume # v] of [sprite2 v]) = [8]> then\n        go to x: (100) y: (-95)\n        create clone of (_myself_ v)\n        wait until <not <([costume # v] of [sprite2 v]) = [8]>>\n    end\n    if <([costume # v] of [sprite2 v]) = [9]> then\n        go to x: (200) y: (10)\n        create clone of (_myself_ v)\n        go to x: (5) y: (0)\n        create clone of (_myself_ v)\n        go to x: (0) y: (100)\n        create clone of (_myself_ v)\n        wait until <not <([costume # v] of [sprite2 v]) = [9]>>\n    end\n    if <([costume # v] of [sprite2 v]) = [10]> then\n        go to x: (125) y: (110)\n        create clone of (_myself_ v)\n        go to x: (125) y: (0)\n        create clone of (_myself_ v)\n        wait until <not <([costume # v] of [sprite2 v]) = [10]>>\n    end\n    if <([costume # v] of [sprite2 v]) = [11]> then\n        go to x: (130) y: (-45)\n        create clone of (_myself_ v)\n        go to x: (-65) y: (115)\n        create clone of (_myself_ v)\n        wait until <not <([costume # v] of [sprite2 v]) = [11]>>\n    end\n    if <([costume # v] of [sprite2 v]) = [15]> then\n        go to x: (-20) y: (120)\n        create clone of (_myself_ v)\n        go to x: (-170) y: (-80)\n        create clone of (_myself_ v)\n        wait until <not <([costume # v] of [sprite2 v]) = [15]>>\n    end\nend\n\nwhen I start as a clone\nclear graphic effects\nshow\nwait until <touching (zebra v)?>\nset rotation style [all around v]\nstart sound [Plunge v]\nrepeat (10)\n    turn right (30) degrees\n    change [ghost v] effect by (10)\nend\ndelete this clone\n\nwhen I receive [m v]\ndelete this clone\n\nwhen I receive [message1 v]\ndelete this clone\n\nwhen I start as a clone\nforever\n    point towards (sprite3 v)\n    move (0.5) steps\n    if <touching (sprite2 v)?> then\n        move (-0.5) steps\n    end\n    if <touching (sprite3 v)?> then\n        set rotation style [all around v]\n        start sound [Plunge v]\n        repeat (10)\n            turn right (30) degrees\n            change [ghost v] effect by (10)\n        end\n        set x to (230)\n        set rotation style [left-right v]\n        clear graphic effects\n        repeat until <not <touching (sprite2 v)?>>\n            change x by (-10)\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    if <<<([costume # v] of [sprite2 v]) = [8]> or <([costume # v] of [sprite2 v]) = [9]>> or <<([costume # v] of [sprite2 v]) = [10]> or <<([costume # v] of [sprite2 v]) = [11]> or <([costume # v] of [sprite2 v]) = [15]>>>> then\n        play sound [Singer1 v] until done\n        play sound [Singer4 v] until done\n    end\nend\n\n@Zebra\n\nwhen flag clicked\nwait (2) seconds\nset rotation style [left-right v]\nset [brightness v] effect to (100)\nforever\n    hide\n    set size to (75) %\n    if <<key (space v) pressed?> and <(s) = [Expecto Patronum]>> then\n        play sound [Oops v] until done\n        create clone of (_myself_ v)\n        wait until <not <key (space v) pressed?>>\n    end\nend\n\nwhen I start as a clone\nwait (1) seconds\nrepeat (5)\n    change [ghost v] effect by (20)\nend\ndelete this clone\n\nwhen I start as a clone\nset size to (1) %\nshow\ngo to (sprite3 v)\npoint in direction ([direction v] of [sprite3 v])\nmove (50) steps\nrepeat (10)\n    change size by (5)\nend\nif <(pick random (1) to (2)) = [1]> then\n    turn left (15) degrees\n    forever\n        repeat (4)\n            move (5) steps\n            turn right (5) degrees\n        end\n        repeat (4)\n            move (5) steps\n            turn left (5) degrees\n        end\n    end\nelse\n    turn right (15) degrees\n    forever\n        repeat (4)\n            move (5) steps\n            turn left (5) degrees\n        end\n        repeat (4)\n            move (5) steps\n            turn right (5) degrees\n        end\n    end\nend\n\nwhen I start as a clone\nforever\n    wait (0.1) seconds\n    next costume\nend\n\nwhen I start as a clone\nwait until <touching (sprite2 v)?>\nforever\n    move (-5) steps\nend\n\nwhen I receive [message1 v]\ndelete this clone\n\nwhen I receive [m v]\ndelete this clone\n\n@Sprite8\n\nwhen flag clicked\ngo to [front v] layer\nset [ghost v] effect to (50)\nforever\n    go to x: (0) y: (0)\n    if <[11] > ([costume # v] of [sprite2 v])> then\n        hide\n    else\n    end\nend\n\nshow\n\n@Sprite9\n\nwhen flag clicked\nset [my variable v] to [0]\nset [ghost v] effect to (100)\nset size to (75) %\nset [brightness v] effect to (0)\nforever\n    hide\n    if <[13] = ([costume # v] of [sprite2 v])> then\n        go to [front v] layer\n        wait (5) seconds\n        go to x: (0) y: (0)\n        show\n        repeat (20)\n            change [ghost v] effect by (-5)\n        end\n        set [my variable v] to [1]\n        wait (2) seconds\n        set [my variable v] to [0]\n        repeat (20)\n            change [ghost v] effect by (5)\n        end\n    else\n        hide\n    end\nend\n\nwhen flag clicked\nforever\n    if <<touching (mouse-pointer v)?> and <[1] = (my variable)>> then\n        start sound [Coin v]\n        set size to (100) %\n        set [brightness v] effect to (25)\n        wait until <not <touching (mouse-pointer v)?>>\n    else\n        set size to (75) %\n        set [brightness v] effect to (0)\n    end\nend\n\nwhen this sprite clicked\nbroadcast (message1 v)\n\nwhen flag clicked\nset [my variable v] to [0]\nset [ghost v] effect to (100)\nset size to (75) %\nset [brightness v] effect to (0)\nforever\n    hide\n    if <[13] = ([costume # v] of [sprite2 v])> then\n        show\n    else\n        hide\n    end\nend\n\n@Sprite10\n\nwhen flag clicked\ngo to x: (0) y: (0)\nwait (2) seconds\nclear graphic effects\nset [ghost v] effect to (100)\nswitch costume to (costume1 v)\nset size to (35) %\nset rotation style [left-right v]\npoint in direction (90)\ngo to x: (0) y: (0)\nset [x v] to [0]\nset [y v] to [0]\nforever\n    if <(my variable) = [0]> then\n        if <key (up arrow v) pressed?> then\n            set [y v] to [12.5]\n        end\n    end\n    if <touching (sprite2 v)?> then\n        set [y v] to [1]\n    end\n    change y by (1)\n    change [y v] by (-1)\n    if <key (right arrow v) pressed?> then\n        change [x v] by (1)\n        point in direction (90)\n    end\n    if <key (left arrow v) pressed?> then\n        change [x v] by (-1)\n        point in direction (90)\n    end\n    set [x v] to ((x) * (0.9))\n    change x by (x)\n    if <touching (sprite2 v)?> then\n        change y by (1)\n    end\n    if <touching (sprite2 v)?> then\n        change y by (1)\n    end\n    if <touching (sprite2 v)?> then\n        change y by (1)\n    end\n    if <touching (sprite2 v)?> then\n        change y by (1)\n    end\n    if <touching (sprite2 v)?> then\n        change y by (1)\n    end\n    if <touching (sprite2 v)?> then\n        change y by (-5)\n        change x by ((x) * (-1))\n        set [x v] to [0]\n    end\n    change y by (y)\n    if <<touching (sprite2 v)?> and <(y) > [0]>> then\n        if <touching (sprite2 v)?> then\n            change y by (-2)\n        end\n        if <touching (sprite2 v)?> then\n            change y by (-2)\n        end\n        if <touching (sprite2 v)?> then\n            change y by (-2)\n        end\n        if <touching (sprite2 v)?> then\n            change y by (-2)\n        end\n        if <touching (sprite2 v)?> then\n            change y by (-2)\n        end\n        if <touching (sprite2 v)?> then\n            change y by (0)\n            change y by ((y) * (-1))\n            set [y v] to [-1]\n        end\n    end\n    if <touching (sprite2 v)?> then\n        change y by (1)\n    end\n    if <touching (sprite2 v)?> then\n        change y by (1)\n    end\n    if <touching (sprite2 v)?> then\n        change y by (1)\n    end\n    if <touching (sprite2 v)?> then\n        change y by (1)\n    end\n    if <touching (sprite2 v)?> then\n        change y by (1)\n    end\n    if <touching (sprite2 v)?> then\n        change y by (1)\n    end\n    if <touching (sprite2 v)?> then\n        change y by (1)\n    end\n    if <touching (sprite2 v)?> then\n        change y by (1)\n    end\n    if <(x position) > [230]> then\n        set [x v] to [0]\n        set [y v] to [0]\n        set x to (-230)\n        broadcast (message1 v)\n    end\n    if <[-230] > (x position)> then\n        set [x v] to [0]\n        set [y v] to [0]\n        set x to (230)\n        broadcast (m v)\n    end\n    if <<[-170] > (y position)> or <<touching (sprite6 v)?> or <touching (sprite7 v)?>>> then\n        broadcast (d v)\n        repeat (10)\n            set rotation style [all around v]\n            turn right (15) degrees\n            change [ghost v] effect by (10)\n        end\n        set [x v] to [0]\n        set [y v] to [0]\n        set x to (-230)\n        set y to (-90)\n        point in direction (90)\n        repeat (10)\n            set rotation style [left-right v]\n        end\n    end\nend\n\n@Sprite11\n\nwhen flag clicked\nset rotation style [left-right v]\nswitch costume to (costume1 v)\nhide\ngo to x: (-100) y: (-85)\ncreate clone of (_myself_ v)\nnext costume\ngo to x: (160) y: (-85)\ncreate clone of (_myself_ v)\nnext costume\ngo to x: (10) y: (-85)\ncreate clone of (_myself_ v)\nnext costume\n\nwhen I start as a clone\nshow\nset size to (35) %\nforever\n    point towards (sprite3 v)\n    if <([costume # v] of [sprite5 v]) = [15]> then\n        show\n    else\n        hide\n    end\nend\n\n@Sprite12\n\nwhen flag clicked\nset [ghost v] effect to (100)\nwait (2) seconds\nforever\n    go to x: ([x position v] of [sprite10 v]) y: (([y position v] of [sprite10 v]) - (60))\n    if <touching (sprite2 v)?> then\n        set [my variable v] to [0]\n    else\n        set [my variable v] to [1]\n    end\nend\n\n