Platformer Creator
@Stage\n\nwhen flag clicked\nset volume to (200) %\nplay sound [Pottah Waltz v] until done\n\nwhen I receive [start game v]\nstop [other scripts in sprite v]\nrepeat (10)\n    change volume by (-20)\nend\nset volume to (200) %\nforever\n    play sound [Hedwig's Flight v] until done\n    play sound [Buckbeak's Flight v] until done\n    play sound [Fred and George v] until done\nend\n\nwhen I receive [start game v]\nrepeat (200)\n    change volume by (-1)\nend\n\n@Harry\n\ndefine Up\nTouching Ground?\nif <(Touching Ground?) = [True]> then\n    repeat (40)\n        if <<(Touching Ground?) = [True]> and <[180] > (y position)>> then\n            change y by (1)\n            Touching Ground?\n        end\n    end\n    if <(Touching Ground?) = [True]> then\n        set [kill harry v] to [True]\n    end\nend\nchange y by (-1)\n\ndefine Touching Ground?\nif <<touching (ground v)?> or <touching color (#80004f)?>> then\n    set [touching ground? v] to [True]\nelse\n    set [touching ground? v] to [False]\nend\n\ndefine Animate\nset rotation style [left-right v]\nif <<(Y Velocity) > [1]> and <([abs v] of (X Velocity) ) > [1]>> then\n    if <(direction) = [90]> then\n        switch costume to (jump v)\n        point in direction ((((timer) * (25)) mod (360)) * (50))\n        set rotation style [all around v]\n    else\n        switch costume to (jump left v)\n        point in direction ((((timer) * (25)) mod (360)) * (-50))\n        set rotation style [all around v]\n    end\nelse\n    if <(Y Velocity) > [1]> then\n        switch costume to (jump straight v)\n    else\n        if <[0] > (Y Velocity)> then\n            switch costume to (fall v)\n        else\n            if <<([abs v] of (X Velocity) ) > [1]> and <not <<key (left arrow v) pressed?> or <key (right arrow v) pressed?>>>> then\n                switch costume to (slide v)\n            else\n                if <<<[-1] > (X Velocity)> and <key (right arrow v) pressed?>> or <<(X Velocity) > [1]> and <key (left arrow v) pressed?>>> then\n                    switch costume to (turn v)\n                else\n                    if <([abs v] of (X Velocity) ) > [1]> then\n                        switch costume to ((2) + ((round ((timer) * (20))) mod (6)))\n                        if <((round ((timer) * (20))) mod (6)) = [0]> then\n                            start sound [Footsteps v]\n                        end\n                    else\n                        switch costume to ((12) + ((round ((timer) * (2))) mod (2)))\n                        if <(Touching Ground?) = [True]> then\n                            if <<<key (w v) pressed?> or <key (a v) pressed?>> or <<key (s v) pressed?> or <key (d v) pressed?>>> then\n                                repeat until <key (space v) pressed?>\n                                    if <key (w v) pressed?> then\n                                        switch costume to (w v)\n                                        create clone of (spell counter v)\n                                        wait until <<not <key (w v) pressed?>> or <key (space v) pressed?>>\n                                    else\n                                        if <key (a v) pressed?> then\n                                            switch costume to (a v)\n                                            create clone of (spell counter v)\n                                            wait until <<not <key (a v) pressed?>> or <key (space v) pressed?>>\n                                        else\n                                            if <key (s v) pressed?> then\n                                                switch costume to (s v)\n                                                create clone of (spell counter v)\n                                                wait until <<not <key (s v) pressed?>> or <key (space v) pressed?>>\n                                            else\n                                                if <key (d v) pressed?> then\n                                                    switch costume to (d v)\n                                                    create clone of (spell counter v)\n                                                    wait until <<not <key (d v) pressed?>> or <key (space v) pressed?>>\n                                                end\n                                            end\n                                        end\n                                    end\n                                end\n                                if <<<(Spell) = [AWSD]> or <<(Spell) = [SWAD]> or <(Spell) = [WD]>>> or <<<(Spell) = [AWD]> or <(Spell) = [AWS]>> or <(Spell) = [DA]>>> then\n                                    broadcast (Cast Spell v)\n                                    if <(direction) = [90]> then\n                                        set [x velocity v] to [-30]\n                                    else\n                                        set [x velocity v] to [30]\n                                    end\n                                else\n                                    set [spell v] to []\n                                end\n                                set [kill harry v] to [False]\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen I receive [cast spell v]\nrepeat (10)\n    switch costume to (spell v)\nend\nset [spell v] to []\n\nwhen I receive [start game v]\nshow\nforever\n    if <(In Talking) = [True]> then\n        go to [back v] layer\n    end\n    if <(In Talking) = [False]> then\n        go to [front v] layer\n        set rotation style [don't rotate v]\n        switch costume to (hitbox v)\n        Touching Ground?\n        if <(Touching Ground?) = [True]> then\n            set [y velocity v] to [1]\n        end\n        if <key (up arrow v) pressed?> then\n            change y by (-10)\n            if <(Touching Ground?) = [True]> then\n                set [y velocity v] to [15]\n            end\n            change y by (10)\n        end\n        change y by (1)\n        change [y velocity v] by (-1)\n        if <key (right arrow v) pressed?> then\n            change [x velocity v] by (1)\n            point in direction (90)\n        end\n        if <key (left arrow v) pressed?> then\n            change [x velocity v] by (-1)\n            point in direction (-90)\n        end\n        if <<key (right arrow v) pressed?> or <key (left arrow v) pressed?>> then\n            set [x velocity v] to ((X Velocity) * (0.9))\n        else\n            set [x velocity v] to ((X Velocity) * (0.7))\n        end\n        change x by (X Velocity)\n        Touching Ground?\n        if <(Touching Ground?) = [True]> then\n            change y by (10)\n            Touching Ground?\n            if <(Touching Ground?) = [True]> then\n                change y by (-10)\n                change x by ((X Velocity) * (-1))\n                set [x velocity v] to [0]\n            else\n                change y by (-10)\n                Up\n            end\n        end\n        change y by (Y Velocity)\n        Touching Ground?\n        if <<(Touching Ground?) = [True]> and <(Y Velocity) > [0]>> then\n            if <(Touching Ground?) = [True]> then\n                change y by ((Y Velocity) * (-1.5))\n                set [y velocity v] to [-1]\n            end\n        end\n        if <not <<key (right arrow v) pressed?> or <key (left arrow v) pressed?>>> then\n            Touching Ground?\n            if <(Touching Ground?) = [True]> then\n                change y by (-5)\n                change x by (10)\n                Touching Ground?\n                if <(Touching Ground?) = [True]> then\n                    change x by (-20)\n                    Touching Ground?\n                    if <(Touching Ground?) = [True]> then\n                        change x by (10)\n                        change y by (5)\n                    end\n                end\n            end\n        end\n        Up\n        if <<[-180] > (y position)> or <<(Kill Harry) = [True]> or <<key (r v) pressed?> or <touching (dementors v)?>>>> then\n            set rotation style [all around v]\n            switch costume to (death v)\n            set [y velocity v] to [15]\n            repeat until <(y position) < [-180]>\n                go to [front v] layer\n                change y by (Y Velocity)\n                change [y velocity v] by (-1)\n                turn right (30) degrees\n            end\n            set [x velocity v] to [0]\n            set [y velocity v] to [0]\n            set [camera x v] to [0]\n            set [kill harry v] to [False]\n            go to x: (-200) y: (0)\n            point in direction (90)\n            broadcast (Died v)\n        end\n        if <<(x position) > [230]> and <(Show Talker) = [False]>> then\n            set [x velocity v] to [0]\n            set [y velocity v] to [0]\n            set [camera x v] to [0]\n            change [level v] by (1)\n            go to x: (-200) y: (0)\n            point in direction (90)\n            broadcast (Next Level v)\n        end\n        if <<(x position) > [0]> and <(Camera X) > [-1]>> then\n            change [camera x v] by (x position)\n            if <not <(Camera X) > [480]>> then\n                set x to (0)\n            end\n            if <(Camera X) > [480]> then\n                set [camera x v] to [480]\n            end\n        else\n            if <<[0] > (x position)> and <[481] > (Camera X)>> then\n                change [camera x v] by (x position)\n                if <not <[0] > (Camera X)>> then\n                    set x to (0)\n                end\n                if <[0] > (Camera X)> then\n                    set [camera x v] to [0]\n                end\n            end\n        end\n    end\n    Touching Ground?\n    Animate\nend\n\nwhen flag clicked\nhide\nclear graphic effects\nswitch costume to (hitbox v)\nset size to (200) %\nset rotation style [left-right v]\npoint in direction (90)\ngo to x: (0) y: (0)\nset [x velocity v] to [0]\nset [y velocity v] to [0]\nset [camera x v] to [0]\nset [level v] to [1]\nset [kill harry v] to [False]\n\nwhen I receive [end game v]\nstop [other scripts in sprite v]\nswitch costume to (idle1 v)\n\n@Ground\n\nwhen flag clicked\nhide\n\nwhen I start as a clone\ngo to [front v] layer\nforever\n    go to x: (((Camera X) * (-1)) + (480)) y: (0)\n    if <[0] < (Camera X)> then\n        show\n    else\n        hide\n    end\n    switch costume to ((Level) * (2))\nend\n\nwhen I receive [start game v]\ngo to [front v] layer\ncreate clone of (_myself_ v)\nforever\n    erase all\n    go to x: ((Camera X) * (-1)) y: (0)\n    if <(Camera X) < [480]> then\n        show\n    else\n        hide\n    end\n    switch costume to (((Level) * (2)) - (1))\nend\n\nwhen I receive [end game v]\ndelete this clone\n\n@Scenery\n\nwhen I start as a clone\nforever\n    go to x: (((Camera X) / (-1)) + (480)) y: (0)\n    if <[0] < (Camera X)> then\n        show\n    else\n        hide\n    end\n    switch costume to ((Level) * (2))\nend\n\nwhen flag clicked\ncreate clone of (_myself_ v)\nforever\n    erase all\n    go to x: ((Camera X) / (-1)) y: (0)\n    if <(Camera X) < [480]> then\n        show\n    else\n        hide\n    end\n    switch costume to (((Level) * (2)) - (1))\nend\n\n@Tables\n\nwhen I start as a clone\nforever\n    go to x: (((Camera X) / (-1)) + (480)) y: (0)\n    if <[0] < (Camera X)> then\n        show\n    else\n        hide\n    end\n    switch costume to ((Level) * (2))\nend\n\nwhen flag clicked\ncreate clone of (_myself_ v)\nforever\n    erase all\n    go to x: ((Camera X) / (-1)) y: (0)\n    if <(Camera X) < [480]> then\n        show\n    else\n        hide\n    end\n    switch costume to (((Level) * (2)) - (1))\nend\n\n@Torches\n\nwhen flag clicked\ngo to [back v] layer\nset rotation style [left-right v]\ncreate clone of (_myself_ v)\npoint in direction (90)\nforever\n    go to x: (((Camera X) / (-2)) + (100)) y: (([sin v] of ((timer) * (150)) ) * (10))\nend\n\nwhen I start as a clone\npoint in direction (-90)\nforever\n    go to x: (((Camera X) / (-2)) + (100)) y: (([cos v] of ((timer) * (150)) ) * (10))\nend\n\n@Arches\n\nwhen flag clicked\nforever\n    go to x: (((Camera X) / (-3)) + (100)) y: (0)\n    go to [back v] layer\nend\n\n@Props\n\nwhen I receive [died v]\ndelete this clone\n\nwhen I receive [next level v]\ndelete this clone\n\nwhen I receive [died v]\nwait (0.01) seconds\nReset\n\nwhen I receive [next level v]\nwait (0.01) seconds\nReset\n\ndefine Reset\nThings [0] [-60] [1] [1]\nThings [-200] [-60] [1] [1]\nThings [280] [-40] [1] [1]\nThings [440] [-70] [4] [1]\nThings [520] [-100] [2] [2]\nThings [600] [120] [4] [2]\nThings [70] [0] [1] [2]\nThings [180] [0] [1] [2]\nThings [650] [-80] [1] [2]\nThings [680] [-60] [3] [3]\nThings [-40] [-80] [4] [3]\nThings [-170] [-80] [1] [3]\nThings [350] [-80] [1] [3]\nThings [600] [-80] [1] [3]\nThings [-100] [0] [1] [4]\nThings [600] [0] [1] [4]\nThings [320] [100] [2] [4]\nThings [-160] [-100] [1] [5]\nThings [0] [-100] [1] [5]\nThings [180] [-90] [2] [5]\nThings [490] [80] [3] [5]\nThings [400] [70] [1] [5]\nThings [-200] [-90] [1] [6]\nThings [-45] [-90] [2] [6]\nThings [480] [-40] [4] [6]\nThings [200] [-60] [1] [6]\nThings [660] [100] [1] [6]\nThings [340] [-40] [1] [6]\nThings [-200] [-120] [1] [7]\nThings [130] [-120] [1] [7]\nThings [-30] [-40] [1] [7]\nThings [390] [100] [1] [7]\nThings [690] [150] [1] [7]\nThings [500] [-100] [1] [7]\nThings [440] [-130] [1] [7]\nThings [580] [-75] [1] [7]\nThings [650] [-60] [4] [7]\nThings [660] [100] [4] [8]\nThings [660] [100] [1] [8]\nThings [400] [0] [1] [8]\nThings [200] [0] [1] [8]\nThings [0] [-120] [4] [9]\nThings [480] [0] [4] [9]\nThings [680] [180] [3] [9]\nThings [0] [180] [1] [9]\nThings [0] [50] [1] [9]\nThings [340] [180] [1] [9]\nThings [340] [50] [1] [9]\nThings [560] [180] [1] [9]\nThings [340] [-80] [1] [9]\nThings [380] [100] [4] [10]\nThings [-60] [70] [1] [10]\nThings [40] [-80] [1] [10]\nThings [230] [110] [1] [10]\nThings [700] [40] [1] [10]\nThings [420] [-130] [1] [10]\nThings [-70] [-100] [1] [11]\nThings [65] [-50] [1] [11]\nThings [600] [-100] [1] [11]\nThings [700] [40] [1] [11]\nThings [0] [-50] [4] [12]\nThings [520] [140] [1] [12]\nThings [360] [-10] [3] [12]\nThings [630] [-60] [1] [12]\nThings [240] [-50] [1] [12]\nThings [300] [-100] [1] [12]\nThings [0] [-60] [1] [13]\nThings [-200] [-60] [1] [13]\nThings [280] [-40] [1] [13]\nThings [440] [-70] [4] [13]\nThings [-80] [0] [2] [14]\nThings [240] [0] [3] [14]\nThings [550] [0] [2] [14]\nThings [-220] [-120] [1] [14]\nThings [90] [-120] [1] [14]\nThings [390] [-120] [1] [14]\nThings [690] [-120] [1] [14]\nThings [170] [80] [4] [15]\nThings [70] [80] [4] [15]\nThings [-200] [90] [1] [15]\nThings [70] [-40] [1] [15]\nThings [280] [-100] [1] [15]\nThings [450] [10] [1] [15]\n\ndefine Things (x) (y) (type) (lvl)\nif <<(Level) = (lvl)> and <(Type) = [Org]>> then\n    if <(type) = [1]> then\n        set y to (y)\n        set [my y position v] to (y)\n        set [my x position v] to (x)\n        switch costume to (pick random (4) to (6))\n        create clone of (_myself_ v)\n    else\n        set y to (y)\n        set [my y position v] to (y)\n        set [my x position v] to (x)\n        switch costume to ((type) - (1))\n        create clone of (_myself_ v)\n        if <(type) = [4]> then\n            set y to ((y) + (50))\n            set [my y position v] to (y)\n            set [my x position v] to (x)\n            switch costume to (costume3 v)\n            create clone of (_myself_ v)\n        end\n    end\nend\n\nwhen I start as a clone\nwait until <<(My X Position) < ((Camera X) + (230))> and <((Camera X) - (230)) < (My X Position)>>\nshow\ngo to [front v] layer\nif <(Type) = [Org]> then\n    set rotation style [left-right v]\n    point in direction (pick random (0) to (360))\n    Touching Ground?\n    repeat until <(I'm Touching the Ground?) = [True]>\n        change y by (-10)\n        Touching Ground?\n    end\n    set [my x velocity v] to [0]\n    set [my y velocity v] to [0]\n    set [type v] to [Clo]\n    Up\n    if <(costume [number v]) < [4]> then\n        go to [front v] layer\n        forever\n            change [my y velocity v] by (-1)\n            change [my x position v] by (My X Velocity)\n            set [my x velocity v] to ((My X Velocity) * (0.9))\n            Touching Ground?\n            if <(I'm Touching the Ground?) = [True]> then\n                Up\n                if <not <touching (spell wingardium leviosa v)?>> then\n                    set [my y velocity v] to [0]\n                end\n            end\n        end\n    else\n        repeat until <<<[-10] > (My Y Velocity)> and <(I'm Touching the Ground?) = [True]>> or <touching (spell petrificus totalus v)?>>\n            if <<(My X Position) < ((Camera X) + (230))> and <((Camera X) - (230)) < (My X Position)>> then\n                set [my cost v] to (costume [number v])\n                switch costume to ((costume [number v]) + (9))\n                Touching Ground?\n                switch costume to (My Cost)\n                if <not <<(My Y Velocity) = [0]> and <<([abs v] of (round (My X Velocity)) ) = [0]> and <(I'm Touching the Ground?) = [True]>>>> then\n                    change [my y velocity v] by (-1)\n                    change [my x position v] by (My X Velocity)\n                    set [my x velocity v] to ((My X Velocity) * (0.9))\n                    set [my cost v] to (costume [number v])\n                    switch costume to ((costume [number v]) + (9))\n                    Touching Ground?\n                    if <<not <[-10] > (My Y Velocity)>> and <(I'm Touching the Ground?) = [True]>> then\n                        switch costume to (My Cost)\n                        Up\n                        if <not <touching (spell wingardium leviosa v)?>> then\n                            set [my y velocity v] to [0]\n                        end\n                    end\n                    switch costume to (My Cost)\n                end\n                switch costume to (My Cost)\n            end\n        end\n        switch costume to (My Cost)\n        start sound [Bowling Strike v]\n        switch costume to (((costume [number v]) * (2)) - (1))\n        create clone of (_myself_ v)\n        next costume\n        create clone of (_myself_ v)\n    end\nelse\n    set rotation style [all around v]\n    set [my x velocity v] to (pick random (-5) to (5))\n    set [my y velocity v] to (pick random (5) to (10))\n    set [type v] to [Sma]\n    change y by (5)\n    Touching Ground?\n    repeat until <<(I'm Touching the Ground?) = [True]> and <(My Y Velocity) < [0]>>\n        change [my x position v] by (My X Velocity)\n        change y by (My Y Velocity)\n        set [my x velocity v] to ((My X Velocity) * (0.9))\n        change [my y velocity v] by (-1)\n        turn right (pick random (1) to (10)) degrees\n        Touching Ground?\n    end\nend\ndelete this clone\n\ndefine Up\nif <<(My X Position) < ((Camera X) + (230))> and <((Camera X) - (230)) < (My X Position)>> then\n    if <(costume [number v]) < [4]> then\n        if <(I'm Touching the Ground?) = [True]> then\n            set [my count v] to [0]\n            repeat until <<(I'm Touching the Ground?) = [False]> or <(My Count) = [50]>>\n                change y by (1)\n                Touching Ground?\n                change [my count v] by (1)\n            end\n            Touching Ground?\n            if <(I'm Touching the Ground?) = [True]> then\n                change y by (-50)\n                set [my count v] to [0]\n                change [my x position v] by ((My X Velocity) * (-5))\n                set [my x velocity v] to [0]\n                set x to (((Camera X) / (-1)) + (My X Position))\n                repeat until <<(I'm Touching the Ground?) = [False]> or <(My Count) = [50]>>\n                    change y by (1)\n                    Touching Ground?\n                    change [my count v] by (1)\n                    set [my x velocity v] to [0]\n                end\n                Touching Ground?\n                if <(I'm Touching the Ground?) = [True]> then\n                    delete this clone\n                end\n            end\n        end\n    else\n        repeat (50)\n            Touching Ground?\n            if <(I'm Touching the Ground?) = [True]> then\n                change y by (1)\n            end\n        end\n        Touching Ground?\n        if <(I'm Touching the Ground?) = [True]> then\n            start sound [Bowling Strike v]\n            switch costume to (((costume [number v]) * (2)) - (1))\n            create clone of (_myself_ v)\n            next costume\n            create clone of (_myself_ v)\n            delete this clone\n        end\n    end\n    change y by (-1)\nend\n\nwhen I start as a clone\nforever\n    set x to (((Camera X) / (-1)) + (My X Position))\n    if <<(My X Position) < ((Camera X) + (230))> and <((Camera X) - (230)) < (My X Position)>> then\n        show\n        change y by (My Y Velocity)\n        set [my y position v] to (y position)\n    else\n        hide\n        set y to (My Y Position)\n        set [my y velocity v] to [0]\n    end\nend\n\nwhen I start as a clone\nforever\n    wait until <touching (spell accio v)?>\n    if <(costume [number v]) < [4]> then\n        if <([x position v] of [harry v]) > (x position)> then\n            set [my x velocity v] to [2]\n        else\n            set [my x velocity v] to [-2]\n        end\n    else\n        if <([x position v] of [harry v]) > (x position)> then\n            set [my x velocity v] to [5]\n        else\n            set [my x velocity v] to [-5]\n        end\n    end\nend\n\nwhen I start as a clone\ngo to [front v] layer\nforever\n    wait until <touching (spell exsecto v)?>\n    if <(costume [number v]) < [4]> then\n        if <([x position v] of [harry v]) > (x position)> then\n            set [my x velocity v] to [-2]\n        else\n            set [my x velocity v] to [2]\n        end\n    else\n        if <([x position v] of [harry v]) > (x position)> then\n            set [my x velocity v] to [-5]\n        else\n            set [my x velocity v] to [5]\n        end\n    end\nend\n\nwhen I start as a clone\nforever\n    wait until <touching (spell wingardium leviosa v)?>\n    if <(costume [number v]) < [4]> then\n        Float (y position)\n    else\n        set [my y velocity v] to [15]\n    end\nend\n\ndefine Float (y)\nrepeat (100)\n    change y by (((((([sin v] of ((timer) * (250)) ) * (10)) + (100)) + (y)) - (y position)) / (4))\n    set [my y velocity v] to [0]\nend\n\ndefine Touching Ground?\nif <<touching (ground v)?> or <<touching (tables v)?> or <touching color (#80004f)?>>> then\n    set [i'm touching the ground? v] to [True]\nelse\n    set [i'm touching the ground? v] to [False]\nend\n\nwhen I receive [start game v]\nset [type v] to [Org]\nhide\nReset\n\nwhen I receive [end game v]\ndelete this clone\n\n@Other Wizzos\n\nwhen flag clicked\nset [sort v] to [Org]\nhide\n\nwhen I receive [died v]\ndelete this clone\n\ndefine Reset\nStudents at [420] [-20] [8]\nStudents at [380] [-20] [8]\nStudents at [0] [-120] [9]\nStudents at [240] [-120] [9]\nStudents at [480] [-120] [9]\nStudents at [0] [20] [9]\nStudents at [240] [20] [9]\nStudents at [480] [20] [9]\nStudents at [0] [150] [9]\nStudents at [240] [150] [9]\nStudents at [480] [150] [9]\nStudents at [0] [100] [10]\nStudents at [20] [-80] [10]\nStudents at [480] [-120] [10]\nStudents at [480] [-120] [11]\nStudents at [100] [-140] [12]\nStudents at [160] [0] [12]\nStudents at [440] [-150] [12]\nStudents at [-80] [0] [14]\nStudents at [240] [0] [14]\nStudents at [550] [0] [14]\nStudents at [-200] [80] [15]\nStudents at [540] [30] [15]\nStudents at [0] [-100] [15]\n\ndefine Students at (x) (y) (lvl)\nif <(Level) = (lvl)> then\n    set y to (y)\n    set [my x position v] to (x)\n    change [type v] by (pick random (1) to (2))\n    if <(Type) > [3]> then\n        set [type v] to [1]\n    end\n    create clone of (_myself_ v)\nend\n\ndefine Animate\nif <([abs v] of (round (My X Velocity)) ) > [0]> then\n    switch costume to (((round ((timer) * (20))) mod (6)) + ((((Type) - (1)) * (11)) + (1)))\n    if <<((round ((timer) * (20))) mod (6)) = [0]> and <not <<(Sort) = [Stoned]> or <(Sort) = [Wandless]>>>> then\n        start sound [Footsteps v]\n    end\nelse\n    switch costume to (((round ((timer) * (2))) mod (2)) + (((Type) * (2)) + (39)))\nend\n\nwhen I receive [next level v]\ndelete this clone\n\nwhen I receive [next level v]\nwait (0.01) seconds\nReset\n\nwhen I receive [died v]\nwait (0.01) seconds\nReset\n\nwhen I start as a clone\nif <(Sort) = [Org]> then\n    hide\n    wait until <<(My X Position) < ((Camera X) + (230))> and <((Camera X) - (230)) < (My X Position)>>\n    set [my x velocity v] to [0]\n    show\n    switch costume to (join [Fall] (Type))\n    Touching Ground?\n    set rotation style [left-right v]\n    repeat until <<(I'm Touching the Ground?) = [True]> or <(y position) < [-170]>>\n        if <<(My X Position) < ((Camera X) + (230))> and <((Camera X) - (230)) < (My X Position)>> then\n            change y by (-10)\n        end\n        Touching Ground?\n    end\n    Up\n    forever\n        repeat (pick random (30) to (50))\n            switch costume to (hitbox 1 v)\n            if <(My X Position) < ((([x position v] of [harry v]) + (Camera X)) - (50))> then\n                change [my x velocity v] by (1)\n            end\n            if <(My X Position) > ((([x position v] of [harry v]) + (Camera X)) + (50))> then\n                change [my x velocity v] by (-1)\n            end\n            if <(My X Position) > (([x position v] of [harry v]) + (Camera X))> then\n                point in direction (-90)\n            else\n                point in direction (90)\n            end\n            change [my x position v] by (My X Velocity)\n            switch costume to (hitbox 2 v)\n            Touching Ground?\n            if <(I'm Touching the Ground?) = [True]> then\n                change [my x position v] by ((My X Velocity) * (-1))\n                set [my x velocity v] to [0]\n            end\n            switch costume to (hitbox 3 v)\n            Touching Ground?\n            if <(I'm Touching the Ground?) = [False]> then\n                change [my x position v] by ((My X Velocity) * (-1))\n                set [my x velocity v] to [0]\n            end\n            set [my x velocity v] to ((My X Velocity) * (0.7))\n            Animate\n        end\n        repeat (pick random (10) to (15))\n            change [my x position v] by (My X Velocity)\n            set [my x velocity v] to ((My X Velocity) * (0.7))\n            if <(My X Position) > (([x position v] of [harry v]) + (Camera X))> then\n                point in direction (-90)\n            else\n                point in direction (90)\n            end\n            Animate\n        end\n        if <not <<(Sort) = [Stoned]> or <(Sort) = [Wandless]>>> then\n            start sound [Ocean Wave v]\n        end\n        repeat (10)\n            if <not <<(Sort) = [Wandless]> or <(Sort) = [Stoned]>>> then\n                set [sort v] to [Spell]\n                switch costume to (((round ((timer) * (10))) mod (4)) + ((((Type) - (1)) * (11)) + (7)))\n                create clone of (_myself_ v)\n            end\n        end\n        repeat (pick random (10) to (15))\n            change [my x position v] by (My X Velocity)\n            set [my x velocity v] to ((My X Velocity) * (0.7))\n            if <(My X Position) > (([x position v] of [harry v]) + (Camera X))> then\n                point in direction (-90)\n            else\n                point in direction (90)\n            end\n            Animate\n        end\n    end\nend\n\nwhen I start as a clone\nforever\n    set x to (((Camera X) * (-1)) + (My X Position))\n    if <<(My X Position) < ((Camera X) + (230))> and <((Camera X) - (230)) < (My X Position)>> then\n        show\n    else\n        hide\n        set [my y velocity v] to [0]\n    end\nend\n\ndefine Touching Ground?\nif <touching (ground v)?> then\n    set [i'm touching the ground? v] to [True]\nelse\n    set [i'm touching the ground? v] to [False]\nend\n\ndefine Up\nTouching Ground?\nrepeat (40)\n    if <(I'm Touching the Ground?) = [True]> then\n        change y by (1)\n        Touching Ground?\n    end\nend\nif <(I'm Touching the Ground?) = [True]> then\n    Die\nend\nchange y by (-1)\n\ndefine Die\nset rotation style [all around v]\nswitch costume to (death v)\nset [my y velocity v] to [15]\nrepeat until <(y position) < [-180]>\n    go to [front v] layer\n    change y by (My Y Velocity)\n    change [my y velocity v] by (-1)\n    turn right (30) degrees\n    switch costume to (death v)\nend\ndelete this clone\n\nwhen I start as a clone\nif <(Sort) = [Org]> then\n    wait until <<touching (spell petrificus totalus v)?> and <not <(Sort) = [Wandless]>>>\n    start sound [Cymbal + Low Squeak v]\n    set [stoned x v] to (My X Position)\n    forever\n        set [sort v] to [Stoned]\n        switch costume to (stoned v)\n        set [my x position v] to (Stoned X)\n    end\nend\n\nwhen I start as a clone\nif <(Sort) = [Spell]> then\n    set size to (100) %\n    if < (costume [name v]) contains [Die]?> then\n        delete this clone\n    end\n    switch costume to (spell v)\n    repeat until <<touching (_edge_ v)?> or <touching (ground v)?>>\n        if <(direction) = [90]> then\n            change [my x position v] by (20)\n        else\n            change [my x position v] by (-20)\n        end\n        change y by (([sin v] of ((timer) * (500)) ) + (pick random (-1) to (1)))\n        if <touching (harry v)?> then\n            set [kill harry v] to [True]\n        end\n    end\n    delete this clone\nend\n\nwhen I start as a clone\nif <not <<(Sort) = [Spell]> or <<(Sort) = [Org]> or <(Sort) = [Wandless]>>>> then\n    delete this clone\nend\n\ndefine Float (y)\nrepeat (100)\n    set [sort v] to [Stoned]\n    switch costume to (stoned v)\n    set [my x position v] to (Stoned X)\n    change y by (((((([sin v] of ((timer) * (250)) ) * (10)) + (100)) + (y)) - (y position)) / (4))\n    set [my y velocity v] to [0]\nend\nrepeat until <(I'm Touching the Ground?) = [True]>\n    change y by (My Y Velocity)\n    change [my y velocity v] by (-1)\n    Touching Ground?\nend\nUp\n\nwhen I start as a clone\nwait until <(Sort) = [Stoned]>\nforever\n    wait until <touching (spell wingardium leviosa v)?>\n    Float (y position)\nend\n\nwhen I start as a clone\nif <(Sort) = [Org]> then\n    wait until <<touching (spell expelliarmus v)?> and <not <(Sort) = [Stoned]>>>\n    start sound [High Whoosh v]\n    set [sort v] to [Wandless]\n    create clone of (_myself_ v)\n    set [stoned x v] to (My X Position)\n    forever\n        set [sort v] to [Wandless]\n        switch costume to (((round ((timer) * (2))) mod (2)) + (((Type) * (2)) + (47)))\n        set [my x position v] to (Stoned X)\n    end\nend\n\nwhen I start as a clone\nif <(Sort) = [Wandless]> then\n    show\n    switch costume to (wand v)\n    set [my x velocity v] to (pick random (-10) to (10))\n    set [my y velocity v] to (pick random (10) to (15))\n    set rotation style [all around v]\n    repeat until <(y position) < [-170]>\n        change [my x position v] by (My X Velocity)\n        change y by (My Y Velocity)\n        set [my x velocity v] to ((My X Velocity) * (0.9))\n        change [my y velocity v] by (-1)\n        turn right (15) degrees\n    end\n    delete this clone\nend\n\nwhen I start as a clone\nforever\n    go [forward v] (1) layers\nend\n\nwhen I receive [end game v]\ndelete this clone\n\n@Spell Counter\n\nwhen flag clicked\nset [spell v] to []\nhide\nrepeat (10)\n    go to [front v] layer\n    switch costume to (costume1 v)\nend\nforever\n    set y to (0)\n    set [on right side v] to [True]\n    repeat until <(Camera X) > [250]>\n        change x by (((0) - (x position)) / (4))\n    end\n    go to [front v] layer\n    set y to (0)\n    set [on right side v] to [False]\n    repeat until <(Camera X) < [230]>\n        change x by (((-300) - (x position)) / (4))\n    end\n    go to [front v] layer\nend\n\nwhen I start as a clone\nif <(length of (Spell)) = [4]> then\n    delete this clone\nend\ngo to [front v] layer\nif <key (w v) pressed?> then\n    switch costume to (w v)\nelse\n    if <key (a v) pressed?> then\n        switch costume to (a v)\n    else\n        if <key (s v) pressed?> then\n            switch costume to (s v)\n        else\n            switch costume to (d v)\n        end\n    end\nend\nset [spell v] to (join (Spell) (costume [name v]))\nset [my x position v] to ((100) + (((length of (Spell)) - (1)) * (20)))\nforever\n    set y to (-165)\n    if <(On Right Side) = [True]> then\n        set x to (My X Position)\n    else\n        set x to ((My X Position) - (300))\n    end\n    go to [front v] layer\nend\n\nwhen [space v] key pressed\ndelete this clone\n\nwhen I receive [start game v]\nforever\n    go to [front v] layer\n    if <(In Talking) = [False]> then\n        show\n    else\n        hide\n    end\nend\n\nwhen I receive [end game v]\ndelete this clone\n\nwhen I receive [end game v]\nstop [other scripts in sprite v]\nhide\n\n@Spritesheet\n\n@Effect\n\nwhen flag clicked\ngo to [back v] layer\nshow\nset [ghost v] effect to (100)\nforever\n    wait until <not <(Spell) = []>>\n    repeat (10)\n        change [ghost v] effect by (-10)\n    end\n    set [ghost v] effect to (0)\n    repeat until <(Spell) = []>\n        create clone of (_myself_ v)\n    end\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\n    set [ghost v] effect to (100)\nend\n\nwhen flag clicked\nswitch costume to (costume1 v)\nforever\n    go to (harry v)\n    set [brightness v] effect to (([sin v] of ((timer) * (500)) ) * (10))\n    set [color v] effect to (([cos v] of ((timer) * (25)) ) * (100))\nend\n\nwhen I start as a clone\nswitch costume to (costume2 v)\nchange x by (pick random (-25) to (25))\nchange y by (pick random (-25) to (25))\nset [ghost v] effect to (100)\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nglide (1) secs to (harry v)\ndelete this clone\n\n@SPELL Accio\n\nwhen flag clicked\nset [type v] to [Org]\nhide\n\nwhen I receive [cast spell v]\nif <<(Spell) = [DA]> and <(Type) = [Org]>> then\n    point in direction ([direction v] of [harry v])\n    start sound [Ocean Wave v]\n    repeat (10)\n        create clone of (_myself_ v)\n    end\nend\n\nwhen I start as a clone\nset [type v] to [Clo]\nshow\ngo to (harry v)\nmove (10) steps\nset [my x position v] to (([x position v] of [harry v]) + (Camera X))\nrepeat until <<touching (ground v)?> or <touching (_edge_ v)?>>\n    if <(direction) = [90]> then\n        change [my x position v] by (20)\n    else\n        change [my x position v] by (-20)\n    end\n    change y by (([sin v] of ((timer) * (500)) ) + (pick random (-1) to (1)))\nend\ndelete this clone\n\nwhen I start as a clone\ngo to [front v] layer\nforever\n    set x to (((Camera X) / (-1)) + (My X Position))\n    if <<(My X Position) < ((Camera X) + (230))> and <((Camera X) - (230)) < (My X Position)>> then\n        show\n    else\n        hide\n    end\nend\n\n@SPELL Exsecto\n\nwhen flag clicked\nset [type v] to [Org]\nhide\n\nwhen I receive [cast spell v]\nif <<(Spell) = [SWAD]> and <(Type) = [Org]>> then\n    point in direction ([direction v] of [harry v])\n    start sound [Ocean Wave v]\n    repeat (10)\n        create clone of (_myself_ v)\n    end\nend\n\nwhen I start as a clone\nset [type v] to [Clo]\nshow\ngo to (harry v)\nmove (10) steps\nset [my x position v] to (([x position v] of [harry v]) + (Camera X))\nrepeat until <<touching (ground v)?> or <touching (_edge_ v)?>>\n    if <(direction) = [90]> then\n        change [my x position v] by (20)\n    else\n        change [my x position v] by (-20)\n    end\n    change y by (([sin v] of ((timer) * (500)) ) + (pick random (-1) to (1)))\nend\ndelete this clone\n\nwhen I start as a clone\ngo to [front v] layer\nforever\n    set x to (((Camera X) / (-1)) + (My X Position))\n    if <<(My X Position) < ((Camera X) + (230))> and <((Camera X) - (230)) < (My X Position)>> then\n        show\n    else\n        hide\n    end\nend\n\n@SPELL Wingardium Leviosa\n\nwhen flag clicked\nset [type v] to [Org]\nhide\n\nwhen I receive [cast spell v]\nif <<(Spell) = [WD]> and <(Type) = [Org]>> then\n    point in direction ([direction v] of [harry v])\n    go to (harry v)\n    start sound [Ocean Wave v]\n    repeat (10)\n        create clone of (_myself_ v)\n    end\nend\n\nwhen I start as a clone\nset [type v] to [Clo]\nshow\ngo to (harry v)\nmove (10) steps\nset [my x position v] to (([x position v] of [harry v]) + (Camera X))\nrepeat until <<touching (ground v)?> or <touching (_edge_ v)?>>\n    if <(direction) = [90]> then\n        change [my x position v] by (20)\n    else\n        change [my x position v] by (-20)\n    end\n    change y by (([sin v] of ((timer) * (500)) ) + (pick random (-1) to (1)))\nend\ndelete this clone\n\nwhen I start as a clone\ngo to [front v] layer\nforever\n    set x to (((Camera X) / (-1)) + (My X Position))\n    if <<(My X Position) < ((Camera X) + (230))> and <((Camera X) - (230)) < (My X Position)>> then\n        show\n    else\n        hide\n    end\nend\n\n@SPELL Petrificus Totalus\n\nwhen flag clicked\nset [type v] to [Org]\nhide\n\nwhen I receive [cast spell v]\nif <<(Spell) = [AWD]> and <(Type) = [Org]>> then\n    point in direction ([direction v] of [harry v])\n    start sound [Ocean Wave v]\n    repeat (10)\n        create clone of (_myself_ v)\n    end\nend\n\nwhen I start as a clone\nset [type v] to [Clo]\nshow\ngo to (harry v)\nmove (10) steps\nset [my x position v] to (([x position v] of [harry v]) + (Camera X))\nrepeat until <<touching (ground v)?> or <touching (_edge_ v)?>>\n    if <(direction) = [90]> then\n        change [my x position v] by (20)\n    else\n        change [my x position v] by (-20)\n    end\n    change y by (([sin v] of ((timer) * (500)) ) + (pick random (-1) to (1)))\nend\ndelete this clone\n\nwhen I start as a clone\ngo to [front v] layer\nforever\n    set x to (((Camera X) / (-1)) + (My X Position))\n    if <<(My X Position) < ((Camera X) + (230))> and <((Camera X) - (230)) < (My X Position)>> then\n        show\n    else\n        hide\n    end\nend\n\n@SPELL Expelliarmus\n\nwhen flag clicked\nset [type v] to [Org]\nhide\n\nwhen I receive [cast spell v]\nif <<(Spell) = [AWS]> and <(Type) = [Org]>> then\n    point in direction ([direction v] of [harry v])\n    start sound [Ocean Wave v]\n    repeat (10)\n        create clone of (_myself_ v)\n    end\nend\n\nwhen I start as a clone\nset [type v] to [Clo]\nshow\ngo to (harry v)\nmove (10) steps\nset [my x position v] to (([x position v] of [harry v]) + (Camera X))\nrepeat until <<touching (ground v)?> or <touching (_edge_ v)?>>\n    if <(direction) = [90]> then\n        change [my x position v] by (20)\n    else\n        change [my x position v] by (-20)\n    end\n    change y by (([sin v] of ((timer) * (500)) ) + (pick random (-1) to (1)))\nend\ndelete this clone\n\nwhen I start as a clone\ngo to [front v] layer\nforever\n    set x to (((Camera X) / (-1)) + (My X Position))\n    if <<(My X Position) < ((Camera X) + (230))> and <((Camera X) - (230)) < (My X Position)>> then\n        show\n    else\n        hide\n    end\nend\n\n@SPELL Expecto Patronum\n\nwhen flag clicked\nset [type v] to [Org]\nhide\n\nwhen I receive [cast spell v]\nif <<(Spell) = [AWSD]> and <(Type) = [Org]>> then\n    point in direction ([direction v] of [harry v])\n    start sound [Ocean Wave v]\n    repeat (10)\n        create clone of (_myself_ v)\n    end\nend\n\nwhen I start as a clone\nset [type v] to [Clo]\nshow\ngo to (harry v)\nmove (10) steps\nset [my x position v] to (([x position v] of [harry v]) + (Camera X))\nrepeat until <<touching (ground v)?> or <touching (_edge_ v)?>>\n    if <(direction) = [90]> then\n        change [my x position v] by (20)\n    else\n        change [my x position v] by (-20)\n    end\n    change y by (([sin v] of ((timer) * (500)) ) + (pick random (-1) to (1)))\nend\ndelete this clone\n\nwhen I start as a clone\ngo to [front v] layer\nforever\n    set x to (((Camera X) / (-1)) + (My X Position))\n    if <<(My X Position) < ((Camera X) + (230))> and <((Camera X) - (230)) < (My X Position)>> then\n        show\n    else\n        hide\n    end\nend\n\n@Ronald Weasley\n\nwhen flag clicked\nset [show talker v] to [False]\nhide\nset size to (200) %\nset rotation style [left-right v]\nforever\n    if <(x position) < ([x position v] of [harry v])> then\n        point in direction (90)\n    else\n        point in direction (-90)\n    end\n    if <(Level) = [11]> then\n        switch costume to (((round ((timer) * (2))) mod (2)) + (3))\n    else\n        switch costume to (((round ((timer) * (2))) mod (2)) + (1))\n    end\n    set x to (((Camera X) / (-1)) + (My X Position))\nend\n\nwhen I receive [next level v]\nhide\nset [show talker v] to [False]\nRon [240] [-120] [3]\nRon [240] [50] [5]\nRon [-100] [-120] [8]\nRon [220] [-75] [11]\nRon [240] [-140] [12]\n\ndefine Ron (x) (y) (lvl)\nif <(Level) = (lvl)> then\n    show\n    set y to (y)\n    set [show talker v] to [True]\n    set [my x position v] to (x)\nend\n\nwhen flag clicked\nhide\nforever\n    wait until <<<(My X Position) < ((Camera X) + (230))> and <((Camera X) - (230)) < (My X Position)>> and <(Show Talker) = [True]>>\n    set size to (200) %\n    clear graphic effects\n    show\n    wait until <not <<<(My X Position) < ((Camera X) + (230))> and <((Camera X) - (230)) < (My X Position)>> and <(Show Talker) = [True]>>>\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\n    hide\nend\n\n@Ron Talk\n\nwhen flag clicked\ngo to x: (0) y: (0)\nclear graphic effects\nset [ghost v] effect to (100)\nswitch costume to (costume1 v)\nset [in talking v] to [False]\nset [chat v] to [2]\nbroadcast (Not Talk v)\n\nwhen I receive [talk v]\nif <(Show Talker) = [True]> then\n    stop [other scripts in sprite v]\n    broadcast (Talky Talk Talk v)\n    set [in talking v] to [True]\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\n    switch costume to (Chat)\n    go to x: (0) y: (0)\n    repeat (10)\n        change [ghost v] effect by (-10)\n    end\n    wait until <not <key (space v) pressed?>>\n    wait until <key (space v) pressed?>\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\n    change [chat v] by (1)\n    if < (costume [name v]) contains [End]?> then\n        set [in talking v] to [False]\n        set [show talker v] to [False]\n        broadcast (Not Talk v)\n    else\n        broadcast (Talk v)\n    end\nend\n\nwhen I receive [next level v]\nswitch costume to (e v)\nforever\n    if <(Show Talker) = [True]> then\n        set x to ([x position v] of [ronald weasley v])\n        set y to (([y position v] of [ronald weasley v]) + (([sin v] of ((timer) * (250)) ) * (5)))\n        repeat until <<([abs v] of ((x position) - ([x position v] of [harry v])) ) < [50]> or <(Show Talker) = [False]>>\n            set x to ([x position v] of [ronald weasley v])\n            set y to (([y position v] of [ronald weasley v]) + (([sin v] of ((timer) * (250)) ) * (5)))\n        end\n        repeat (10)\n            change [ghost v] effect by (-10)\n            set x to ([x position v] of [ronald weasley v])\n            set y to (([y position v] of [ronald weasley v]) + (([sin v] of ((timer) * (250)) ) * (5)))\n        end\n        repeat until <<<key (space v) pressed?> or <[100] < ([abs v] of ((x position) - ([x position v] of [harry v])) )>> or <(Show Talker) = [False]>>\n            set x to ([x position v] of [ronald weasley v])\n            set y to (([y position v] of [ronald weasley v]) + (([sin v] of ((timer) * (250)) ) * (5)))\n        end\n        if <key (space v) pressed?> then\n            broadcast (Talk v)\n        end\n        repeat (10)\n            change [ghost v] effect by (10)\n            set x to ([x position v] of [ronald weasley v])\n            set y to (([y position v] of [ronald weasley v]) + (([sin v] of ((timer) * (250)) ) * (5)))\n        end\n    else\n        set [ghost v] effect to (100)\n    end\nend\n\nwhen I receive [talky talk talk v]\nforever\n    go to [front v] layer\nend\n\nwhen I receive [not talk v]\nforever\n    if <(Show Talker) = [True]> then\n        show\n    else\n        hide\n    end\nend\n\n@Remember...\n\nwhen flag clicked\nforever\n    hide\n    wait (50) seconds\n    go to x: (0) y: (240)\n    show\n    repeat (5)\n        change y by (-20)\n    end\n    wait (1) seconds\n    repeat (5)\n        change y by (20)\n    end\nend\n\nwhen flag clicked\nforever\n    go to [front v] layer\nend\n\nwhen I receive [end game v]\nstop [other scripts in sprite v]\nhide\n\n@Dementors\n\nwhen I start as a clone\nforever\n    set x to (((Camera X) * (-1)) + (My X Position))\n    if <<(My X Position) < ((Camera X) + (230))> and <((Camera X) - (230)) < (My X Position)>> then\n        show\n    else\n        hide\n    end\nend\n\ndefine Dementors at (x) (y) (lvl)\nif <(Level) = (lvl)> then\n    set y to (y)\n    set [my x position v] to (x)\n    create clone of (_myself_ v)\nend\n\ndefine Touching Ground?\nif <touching (ground v)?> then\n    set [i'm touching the ground? v] to [True]\nelse\n    set [i'm touching the ground? v] to [False]\nend\n\nwhen flag clicked\nhide\n\nwhen I start as a clone\nforever\n    go [forward v] (1) layers\nend\n\nwhen I receive [died v]\ndelete this clone\n\nwhen I receive [next level v]\ndelete this clone\n\nwhen I receive [next level v]\nwait (0.01) seconds\nReset\n\nwhen I receive [died v]\nwait (0.01) seconds\nReset\n\nwhen I start as a clone\nset [my x velocity v] to [0]\nset [my y velocity v] to [0]\nset [step v] to [0.25]\nclear graphic effects\nset [ghost v] effect to (50)\nwait until <<(My X Position) < ((Camera X) + (230))> and <((Camera X) - (230)) < (My X Position)>>\nrepeat until <touching (spell expecto patronum v)?>\n    change [my x velocity v] by (pick random (-0.1) to (0.1))\n    change [my y velocity v] by (pick random (-0.1) to (0.1))\n    if <(x position) > ([x position v] of [harry v])> then\n        change [my x velocity v] by ((Step) / (-1))\n        change [my x position v] by (My X Velocity)\n        set x to (((Camera X) * (-1)) + (My X Position))\n        Touching Ground?\n        if <(Touching Ground?) = [True]> then\n            change [my x velocity v] by ((Step) / (2))\n        end\n        change [my x velocity v] by ((Step) / (2))\n        change [my x position v] by (My X Velocity)\n    else\n        change [my x velocity v] by (Step)\n        change [my x position v] by (My X Velocity)\n        set x to (((Camera X) * (-1)) + (My X Position))\n        Touching Ground?\n        if <(Touching Ground?) = [True]> then\n            change [my x velocity v] by ((Step) / (-2))\n        end\n        change [my x velocity v] by ((Step) / (-2))\n        change [my x position v] by (My X Velocity)\n    end\n    set [my x velocity v] to ((My X Velocity) * (0.9))\n    if <(y position) > ([y position v] of [harry v])> then\n        change [my y velocity v] by ((Step) / (-1))\n        change y by (My Y Velocity)\n        Touching Ground?\n        if <(Touching Ground?) = [True]> then\n            change [my y velocity v] by ((Step) / (2))\n        end\n        change [my y velocity v] by ((Step) / (2))\n        change y by (My Y Velocity)\n    else\n        change [my y velocity v] by (Step)\n        change y by (My Y Velocity)\n        Touching Ground?\n        if <(Touching Ground?) = [True]> then\n            change [my y velocity v] by ((Step) / (-2))\n        end\n        change [my y velocity v] by ((Step) / (-2))\n        change y by (My Y Velocity)\n    end\n    set [my y velocity v] to ((My Y Velocity) * (0.9))\nend\nrepeat (10)\n    if <(x position) > ([x position v] of [harry v])> then\n        change [my x velocity v] by (1)\n        change [my x position v] by (My X Velocity)\n        set [my x velocity v] to ((My X Velocity) * (0.9))\n    else\n        change [my x velocity v] by (-1)\n        change [my x position v] by (My X Velocity)\n        set [my x velocity v] to ((My X Velocity) * (0.9))\n    end\n    change [ghost v] effect by (5)\nend\ndelete this clone\n\ndefine Reset\nDementors at [480] [0] [13]\nDementors at [90] [0] [14]\nDementors at [390] [0] [14]\nDementors at [240] [0] [15]\n\nwhen I start as a clone\nset rotation style [left-right v]\nforever\n    point towards (harry v)\n    switch costume to ([floor v] of ((((timer) * (10)) mod (3)) + (1)) )\n    if <<<([x position v] of [harry v]) > (x position)> and <[0] > (My X Velocity)>> or <<(x position) > ([x position v] of [harry v])> and <(My X Velocity) > [0]>>> then\n        switch costume to (costume6 v)\n        wait (0.1) seconds\n        switch costume to (costume5 v)\n        wait (0.1) seconds\n        switch costume to (costume4 v)\n        wait (0.1) seconds\n    end\nend\n\n@Hermione Granger\n\nwhen flag clicked\nhide\nset size to (200) %\nset [my x position v] to [680]\nset y to (60)\nforever\n    set x to (((Camera X) / (-1)) + (My X Position))\n    if <<(Level) = [15]> and <<(My X Position) < ((Camera X) + (230))> and <((Camera X) - (230)) < (My X Position)>>> then\n        switch costume to (((round ((timer) * (2))) mod (2)) + (1))\n        show\n    else\n        hide\n    end\nend\n\nwhen flag clicked\nwait until <touching (harry v)?>\nbroadcast (End Game v)\n\n@Hermione Intro Bg\n\nwhen flag clicked\nswitch costume to (costume1 v)\ngo to x: (0) y: (0)\nclear graphic effects\nshow\n\nwhen I receive [start game v]\nrepeat (10)\n    change [brightness v] effect by (-10)\n    change [ghost v] effect by (10)\nend\n\n@Intro\n\nwhen flag clicked\nshow\ngo to x: (0) y: (0)\ngo to [front v] layer\nclear graphic effects\nset [brightness v] effect to (-100)\nrepeat (5)\n    switch costume to (costume1 v)\n    wait (0.1) seconds\n    change [brightness v] effect by (10)\n    start sound [Crank v]\n    next costume\n    wait (0.1) seconds\n    change [brightness v] effect by (10)\n    start sound [Crank v]\nend\nrepeat (19)\n    next costume\n    wait (0.1) seconds\n    start sound [Crank v]\nend\nwait (1) seconds\nrepeat (10)\n    change [brightness v] effect by (-10)\nend\nnext costume\nrepeat (10)\n    change [brightness v] effect by (10)\nend\nwait (2) seconds\nbroadcast (Start Cutscene v)\nrepeat (10)\n    change [brightness v] effect by (-10)\n    change [ghost v] effect by (10)\nend\nhide\n\n@Hermione Intro Animation\n\nwhen I receive [start cutscene v]\nhide\nwait (0.5) seconds\nshow\nswitch costume to (costume3 v)\nwait (0.01) seconds\nrepeat (3)\n    next costume\n    wait (0.01) seconds\nend\nwait (0.1) seconds\nrepeat (4)\n    next costume\n    wait (0.01) seconds\nend\ngo to x: (0) y: (0)\nrepeat (10)\n    switch costume to (talk 1 v)\n    wait (0.05) seconds\n    repeat (2)\n        next costume\n        wait (0.05) seconds\n    end\nend\nswitch costume to (kit v)\nwait (0.5) seconds\ngo to x: (0) y: (0)\nrepeat (5)\n    switch costume to (talk 4 v)\n    wait (0.05) seconds\n    repeat (2)\n        next costume\n        wait (0.05) seconds\n    end\nend\ngo to x: (0) y: (0)\nswitch costume to (costume27 v)\nwait (0.01) seconds\nrepeat (7)\n    next costume\n    wait (0.01) seconds\nend\ngo to x: (0) y: (0)\nrepeat (5)\n    switch costume to (talk 4 v)\n    wait (0.05) seconds\n    repeat (2)\n        next costume\n        wait (0.05) seconds\n    end\nend\nswitch costume to (kit v)\nwait (0.5) seconds\ngo to x: (0) y: (0)\nswitch costume to (costume11 v)\nwait (0.01) seconds\nrepeat (3)\n    next costume\n    wait (0.01) seconds\nend\nwait (0.1) seconds\nrepeat (12)\n    next costume\n    wait (0.01) seconds\nend\nwait (0.1) seconds\nrepeat (4)\n    next costume\n    wait (0.01) seconds\nend\ngo to x: (0) y: (0)\nrepeat (10)\n    switch costume to (talk 7 v)\n    wait (0.05) seconds\n    repeat (2)\n        next costume\n        wait (0.05) seconds\n    end\nend\nswitch costume to (kit v)\nwait (0.5) seconds\nhide\nbroadcast (Harold v)\n\nwhen flag clicked\nclear graphic effects\ngo to x: (0) y: (0)\nhide\n\nwhen I receive [start game v]\nstop [other scripts in sprite v]\nrepeat (10)\n    change [brightness v] effect by (-10)\n    change [ghost v] effect by (10)\nend\n\n@Harold Stackmint\n\nwhen flag clicked\nclear graphic effects\ngo to x: (0) y: (0)\nhide\n\nwhen I receive [harold v]\nswitch costume to (costume1 v)\nshow\nwait (1) seconds\nnext costume\nwait (2) seconds\nnext costume\nwait (2) seconds\nrepeat (3)\n    next costume\n    wait (1) seconds\nend\nnext costume\nwait (3) seconds\nrepeat (3)\n    next costume\n    wait (2) seconds\nend\nnext costume\nwait (3) seconds\nbroadcast (Start Game v)\n\nwhen I receive [start game v]\nrepeat (10)\n    change [brightness v] effect by (-10)\n    change [ghost v] effect by (10)\nend\n\nwhen I receive [start cutscene v]\nwait until <key (space v) pressed?>\nstop [other scripts in sprite v]\nbroadcast (Start Game v)\n\n@End and Credits\n\nwhen flag clicked\ngo to x: (0) y: (0)\nclear graphic effects\nhide\n\nwhen I receive [end game v]\ngo to [front v] layer\nswitch costume to (costume2 v)\nrepeat (4)\n    create clone of (_myself_ v)\n    next costume\nend\nset [ghost v] effect to (100)\nset [brightness v] effect to (-100)\nshow\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nwait (2) seconds\nrepeat ((5) * (360))\n    broadcast (Credits Roll v)\nend\nrepeat (100)\n    change [brightness v] effect by (1)\nend\nstop [all v]\n\nwhen I start as a clone\nclear graphic effects\nwait (0.1) seconds\nset [ghost v] effect to (100)\ngo to [front v] layer\nshow\nset [my y position v] to (((costume [number v]) * (-360)) + (720))\ngo to x: (0) y: (My Y Position)\nif <(My Y Position) > [-360]> then\n    show\nelse\n    hide\nend\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nrepeat until <(y position) > [360]>\n    go to x: (0) y: (My Y Position)\n    if <(My Y Position) > [-360]> then\n        show\n    else\n        hide\n    end\nend\ndelete this clone\n\nwhen I receive [credits roll v]\nchange [my y position v] by (1)\n\n@Title\n\nwhen flag clicked\ngo to x: (0) y: (0)\nclear graphic effects\nhide\n\n