Jack Jack | A Platformer | Incredibles 2 |


@Stage\n\nwhen I receive [next level v]\n\nwhen [r v] key pressed\nchange [level v] by (-1)\nbroadcast (Next Level v)\n\nwhen [o v] key pressed\nset [game end v] to [1]\nchange [level v] by (-2)\nbroadcast (Next Level v)\n\nwhen flag clicked\nforever\n    play sound [Michael Giacchino - Incredits 2 \(From Incredibles 2Audio Only\).mp3 v] until done\nend\n\nwhen flag clicked\nswitch backdrop to (backdrop1 v)\nforever\n    switch backdrop to (backdrop1 v)\n    if <(Level) = [20]> then\n        switch backdrop to (backdrop2 v)\n    end\nend\n\nwhen [p v] key pressed\nbroadcast (Next Level v)\n\nwhen I receive [laser fight v]\nrepeat until <(Game End) = [1]>\n    switch backdrop to (backdrop3 v)\nend\n\n@Jack Jack\n\nwhen flag clicked\nforever\n    if <<(Xv) > [1]> or <(Xv) < [-1]>> then\n        change [walk v] by (1)\n        if <(Walk) > [9]> then\n            set [walk v] to [1]\n        end\n        wait (0.1) seconds\n    else\n        set [walk v] to [1]\n    end\nend\n\nwhen flag clicked\ndelete (all) of [collected v]\nset [game end v] to [0]\nset [laser fight v] to [0]\nset [level v] to [0]\nbroadcast (next level v)\nset [levitation v] to [0]\ngo to [front v] layer\nset size to (20) %\nset rotation style [left-right v]\ngo to x: (-200) y: (-40)\nset [xv v] to [0]\nset [yv v] to [0]\nforever\n    switch costume to (hitbox v)\n    if <key (d v) pressed?> then\n        if <(Selected Power) = [6]> then\n            change [xv v] by (50)\n        else\n            change [xv v] by (0.5)\n        end\n        point in direction (90)\n    end\n    if <key (a v) pressed?> then\n        if <(Selected Power) = [6]> then\n            change [xv v] by (-50)\n        else\n            change [xv v] by (-0.5)\n        end\n        point in direction (-90)\n    end\n    set [xv v] to ((Xv) * (0.9))\n    change x by (Xv)\n    if <<touching (ground v)?> or <touching (levitation v)?>> then\n        switch costume to (hitbox v)\n        change y by (1)\n        if <<touching (ground v)?> or <touching (levitation v)?>> then\n            change y by (1)\n            if <<touching (ground v)?> or <touching (levitation v)?>> then\n                change y by (1)\n                if <<touching (ground v)?> or <touching (levitation v)?>> then\n                    change y by (1)\n                    if <<touching (ground v)?> or <touching (levitation v)?>> then\n                        change y by (1)\n                        if <<touching (ground v)?> or <touching (levitation v)?>> then\n                            change x by ((Xv) * (-1))\n                            change y by (-5)\n                            if <key (w v) pressed?> then\n                                switch costume to (hitbox v)\n                                if <(Xv) > [0]> then\n                                    set [xv v] to [-5]\n                                else\n                                    set [xv v] to [5]\n                                end\n                                set [yv v] to [10]\n                            else\n                                set [xv v] to [0]\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\n    if <(y position) < [-180]> then\n        change [level v] by (-1)\n        broadcast (next level v)\n    end\n    switch costume to (hitbox v)\n    change [yv v] by (-0.8)\n    change y by (Yv)\n    if <<touching (ground v)?> or <touching (levitation v)?>> then\n        change y by ((Yv) * (-1))\n        set [yv v] to [0]\n        switch costume to (hitbox v)\n    end\n    change y by (-1)\n    if <<touching (ground v)?> or <touching (levitation v)?>> then\n        switch costume to (hitbox v)\n        if <key (w v) pressed?> then\n            if <(Selected Power) = [6]> then\n                set [yv v] to [20]\n            else\n                set [yv v] to [11]\n            end\n        end\n    end\n    change y by (1)\n    switch costume to (jack jack stand v)\n    if <<(Xv) > [1]> or <(Xv) < [-1]>> then\n        switch costume to ((Walk) + (2))\n    end\n    change y by (-1)\n    if <not <<touching (ground v)?> or <touching (levitation v)?>>> then\n        switch costume to (jack jack airborne v)\n    end\n    change y by (1)\nend\n\nnext costume\n\nset size to (30) %\n\nmove (1) steps\nif <touching (_edge_ v)?> then\n    go to x: (-201) y: (-67)\nend\n\nif <(costume [number v]) = [1]> then\n\nrepeat until <not <key (space v) pressed?>>\n\nswitch costume to (jack jack stand v)\n\nif <key (a v) pressed?> then\n\nwhen flag clicked\nwait (0.5) seconds\nforever\n    if <(Level) > [20]> then\n        set [level v] to [20]\n        broadcast (laser fight v)\n    end\n    if <(Laser Fight) = [0]> then\n        if <key (space v) pressed?> then\n            if <(Selected Power) = [1]> then\n                repeat (10)\n                    switch costume to (jack jack fire v)\n                    set [xv v] to [0]\n                    if <<touching (ground v)?> or <touching (levitation v)?>> then\n                        set [yv v] to [0]\n                    end\n                end\n                repeat (10)\n                    set [xv v] to [0]\n                    switch costume to (jack jack fire v)\n                    create clone of (projectiles v)\n                    broadcast (projectile costume v)\n                    if <<touching (ground v)?> or <touching (levitation v)?>> then\n                        set [yv v] to [0]\n                    end\n                end\n                repeat (5)\n                    set [xv v] to [0]\n                    switch costume to (jack jack fire v)\n                    if <<touching (ground v)?> or <touching (levitation v)?>> then\n                        set [yv v] to [0]\n                    end\n                end\n            end\n            if <(Selected Power) = [2]> then\n                set [xv v] to [0]\n                repeat (5)\n                    switch costume to (jack jack lazer v)\n                    point towards (mouse-pointer v)\n                end\n                create clone of (projectiles v)\n                broadcast (projectile costume v)\n                repeat (5)\n                    switch costume to (jack jack lazer v)\n                end\n            end\n            if <(Selected Power) = [3]> then\n                repeat (8)\n                    set [yv v] to [6]\n                    set [xv v] to ((Xv) * (0.7))\n                    switch costume to (jack jack metal v)\n                end\n                repeat until <<touching (ground v)?> or <touching (levitation v)?>>\n                    change y by (1)\n                    set [xv v] to ((Xv) * (0.6))\n                    change [yv v] by (-1)\n                    switch costume to (jack jack metal v)\n                    change y by (-1)\n                    if <touching (raccoon v)?> then\n                        change [racoon hp v] by (-1)\n                    end\n                end\n                repeat (5)\n                    change y by (-5)\n                    switch costume to (jack jack metal v)\n                    if <touching (raccoon v)?> then\n                        change [racoon hp v] by (-1)\n                    end\n                end\n                if <touching (ground v)?> then\n                    change y by (25)\n                end\n            end\n            if <(Selected Power) = [4]> then\n                repeat (5)\n                    switch costume to (jack jack levitation v)\n                    set [levitation v] to [1]\n                    set [xv v] to [0]\n                end\n                repeat until <not <key (space v) pressed?>>\n                    switch costume to (jack jack levitation v)\n                    set [levitation v] to [1]\n                    set [xv v] to [0]\n                    if <<touching (ground v)?> or <touching (levitation v)?>> then\n                        set [yv v] to [0]\n                    end\n                end\n                set [levitation v] to [0]\n            end\n            if <(Selected Power) = [5]> then\n                repeat (10)\n                    change size by (1)\n                end\n                if <(Level) = [20]> then\n                    set size to (15) %\n                else\n                    set size to (20) %\n                end\n                repeat (10)\n                    switch costume to (jack jack chuby v)\n                    change size by (1)\n                end\n                repeat (30)\n                    switch costume to (jack jack chuby v)\n                    set [xv v] to ((Xv) * (0.6))\n                    change [yv v] by (-1)\n                end\n                repeat (10)\n                    switch costume to (jack jack chuby v)\n                    change size by (-1)\n                    change [yv v] by (1)\n                end\n                if <(Level) = [20]> then\n                    set size to (25) %\n                else\n                    set size to (30) %\n                end\n                repeat (10)\n                    change size by (-1)\n                end\n                if <(Level) = [20]> then\n                    set size to (15) %\n                else\n                    set size to (20) %\n                end\n            end\n            broadcast (cool down v)\n            wait (1) seconds\n        end\n    end\nend\n\nset [yv v] to [5]\n\nwhen I receive [next level v]\nset [laser fight v] to [0]\ngo to x: (-200) y: (-40)\nset [xv v] to [0]\nset [yv v] to [0]\nchange [level v] by (1)\nif <(Level) = [10]> then\n    go to x: (-191) y: (75)\nend\n\nset [yv v] to [5]\nset [xv v] to [0]\n\nset [xv v] to ((Xv) * (0.5))\n\nwhen flag clicked\nforever\n    if <touching (_edge_ v)?> then\n        if <(x position) > [230]> then\n            broadcast (next level v)\n        end\n    end\nend\n\nwhen I receive [next level v]\nwait (0) seconds\nif <(Level) = [20]> then\n    set size to (15) %\nelse\n    set size to (20) %\nend\n\nset size to (30) %\n\nhide\n\nwhen I receive [laser fight v]\nrepeat until <(Game End) = [1]>\n    switch costume to (jack jack lazer2 v)\n    point in direction (90)\n    set size to (90) %\n    go to x: (-138) y: (-38)\nend\n\nwhen I start as a clone\n\nadd [16] to [collected v]\n\n@Ground\n\nwhen flag clicked\nforever\n    go to x: (0) y: (0)\n    switch costume to (Level)\n    show\nend\n\nwhen I receive [raccoon smash v]\nif <touching (jack jack v)?> then\n    set [level v] to [19]\n    broadcast (Next Level v)\nend\nif <touching (raccoon v)?> then\n    set [racoon hp v] to [0]\nend\nturn right (5) degrees\nwait (0.1) seconds\nturn left (10) degrees\nwait (0.1) seconds\npoint in direction (90)\n\ngo to (the racoon v)\ngo to [front v] layer\nif <([direction v] of [the racoon v]) = [90]> then\n    switch costume to (arms v)\nelse\n    switch costume to (arms2 v)\nend\nif <touching (jack jack v)?> then\n    change [level v] by (-1)\n    broadcast (Next Level v)\n    show\nend\nrepeat (74)\n    if <touching (jack jack v)?> then\n        if <([costume # v] of [jack jack v]) = [16]> then\n            set [brightness v] effect to (10)\n        end\n    end\nend\nset [brightness v] effect to (0)\nhide\n\nshow\n\nwhen I receive [laser fight v]\nrepeat until <(Game End) = [1]>\n    hide\nend\n\n@Projectiles\n\nwhen flag clicked\nset size to (50) %\nhide\n\nwhen I start as a clone\nif <(Selected Power) = [1]> then\n    switch costume to (fire v)\n    show\n    go to (jack jack v)\n    point in direction ([direction v] of [jack jack v])\n    move (20) steps\n    turn right (pick random (-20) to (20)) degrees\nend\nif <(Selected Power) = [2]> then\n    switch costume to (laser v)\n    show\n    go to (jack jack v)\n    change y by (16)\n    go to [front v] layer\n    point towards (mouse-pointer v)\nend\nrepeat (5)\n    move (10) steps\nend\nforever\n    move (10) steps\n    if <touching (raccoon v)?> then\n        change [racoon hp v] by (-2)\n        if <(costume [number v]) = [2]> then\n            change [racoon hp v] by (-3)\n        end\n        delete this clone\n    end\n    if <<touching (_edge_ v)?> or <touching (ground v)?>> then\n        delete this clone\n    end\n    if <touching (levitation v)?> then\n        repeat (2)\n            move (10) steps\n        end\n        delete this clone\n    end\nend\n\nmove (20) steps\n\nwhen I receive [projectile costume v]\nif <(Selected Power) = [1]> then\n    switch costume to (fire v)\nend\nif <(Selected Power) = [2]> then\n    switch costume to (laser v)\nend\n\n@Selected Power\n\nwhen [e v] key pressed\nnext costume\nset [selected power v] to (costume [number v])\n\nwhen this sprite clicked\nnext costume\nset [selected power v] to (costume [number v])\n\nwhen [q v] key pressed\nswitch costume to ((costume [number v]) - (1))\nset [selected power v] to (costume [number v])\n\nwhen I receive [next level v]\nshow\ngo to [front v] layer\n\ngo to (raccoon v)\n\nwait (0) seconds\nif <(Level) = [4]> then\n    switch costume to (power-1 v)\n    set [selected power v] to (costume [number v])\nend\n\nset [ghost v] effect to (0)\n\nwhen [1 v] key pressed\nswitch costume to (power-1 v)\nset [selected power v] to (costume [number v])\n\nwhen flag clicked\nshow\ngo to x: (181) y: (148)\nswitch costume to (power-1 v)\nset [selected power v] to [1]\nforever\n    if <touching (mouse-pointer v)?> then\n        change size by (25)\n        set [brightness v] effect to (20)\n    else\n        change size by (20)\n        set [brightness v] effect to (0)\n    end\n    if <not <(size) < [100]>> then\n        change size by ((0) - ((size) / (5)))\n    end\nend\n\nwhen [2 v] key pressed\nswitch costume to (power-2 v)\nset [selected power v] to (costume [number v])\n\nwhen [3 v] key pressed\nswitch costume to (power-3 v)\nset [selected power v] to (costume [number v])\n\nwhen [4 v] key pressed\nswitch costume to (power-4 v)\nset [selected power v] to (costume [number v])\n\nwhen [5 v] key pressed\nswitch costume to (power-5 v)\nset [selected power v] to (costume [number v])\n\nwhen I receive [laser fight v]\nrepeat until <(Game End) = [1]>\n    hide\nend\nshow\n\n@Thumbnail\n\nhide\n\nwhen I receive [laser fight v]\nswitch costume to (thumbnail2 v)\n\nwhen flag clicked\nswitch costume to (thumbnail v)\nforever\n    show\n    go to x: (0) y: (0)\n    go to [front v] layer\n    set [ghost v] effect to (100)\nend\n\ngo to [front v] layer\nswitch costume to (thumbnail v)\n\n@Cool Down\n\nwhen flag clicked\nset [ghost v] effect to (100)\ngo to x: (179) y: (148)\nswitch costume to (power-1 v)\nset [selected power v] to [1]\nforever\n    show\n    if <touching (mouse-pointer v)?> then\n        change size by (25)\n        set [brightness v] effect to (20)\n    else\n        change size by (20)\n        set [brightness v] effect to (0)\n    end\n    if <not <(size) < [100]>> then\n        change size by ((0) - ((size) / (5)))\n    end\nend\n\nwhen I receive [cool down v]\nset [ghost v] effect to (0)\nrepeat (20)\n    go to [front v] layer\n    change [ghost v] effect by (6)\nend\n\nwhen I receive [laser fight v]\nrepeat until <(Game End) = [1]>\n    hide\nend\n\n@Levitation\n\nwhen flag clicked\nset rotation style [don't rotate v]\nset [costume v] to [1]\nforever\n    if <(Costume) = [1]> then\n        if <(Levitation) = [0]> then\n            switch costume to (Costume)\n        else\n            if <touching (mouse-pointer v)?> then\n                repeat until <(Levitation) = [0]>\n                    switch costume to ((Costume) + (1))\n                    if <not <touching (mouse-pointer v)?>> then\n                        point towards (mouse-pointer v)\n                        move (3) steps\n                        if <(Level) = [9]> then\n                            go to x: (120) y: (y position)\n                        end\n                        if <(Level) = [16]> then\n                            go to x: (-73) y: (y position)\n                        end\n                        if <(Level) = [18]> then\n                            go to x: (-49) y: (y position)\n                        end\n                    end\n                end\n            end\n        end\n    end\n    if <(Costume) = [3]> then\n        switch costume to (Costume)\n        if <touching (jack jack v)?> then\n            if <([costume # v] of [jack jack v]) = [16]> then\n                switch costume to ((Costume) + (1))\n                repeat (10)\n                    change [ghost v] effect by (10)\n                end\n                hide\n                set [ghost v] effect to (0)\n            end\n        end\n    end\n    if <(Costume) = [5]> then\n        switch costume to (Costume)\n        if <([costume name v] of [button v]) = [Down]> then\n            hide\n        else\n            show\n        end\n    end\n    if <(Costume) = [6]> then\n        switch costume to (Costume)\n        if <touching (projectiles v)?> then\n            if <([costume # v] of [projectiles v]) = [2]> then\n                switch costume to ((Costume) + (1))\n                repeat (20)\n                    change [ghost v] effect by (5)\n                end\n                hide\n                set [ghost v] effect to (0)\n            end\n        end\n    end\nend\n\nwhen I receive [next level v]\nwait (0) seconds\nset rotation style [don't rotate v]\nset [costume v] to [0]\nset [ghost v] effect to (0)\nhide\nif <(Level) = [2]> then\n    show\n    set [costume v] to [1]\n    go to x: (-14) y: (-31)\nend\nif <(Level) = [6]> then\n    show\n    set [costume v] to [1]\n    go to x: (-14) y: (-31)\nend\nif <(Level) = [7]> then\n    show\n    set [costume v] to [1]\n    go to x: (-57) y: (-96)\nend\nif <(Level) = [8]> then\n    show\n    set [costume v] to [3]\n    go to x: (116) y: (-9)\nend\nif <(Level) = [9]> then\n    show\n    set [costume v] to [1]\n    go to x: (120) y: (-139)\nend\nif <(Level) = [11]> then\n    show\n    set [costume v] to [5]\n    go to x: (222) y: (72)\nend\nif <(Level) = [14]> then\n    show\n    set [costume v] to [6]\n    go to x: (6) y: (-22)\nend\nif <(Level) = [15]> then\n    show\n    set [costume v] to [5]\n    go to x: (131) y: (-65)\nend\nif <(Level) = [16]> then\n    create clone of (_myself_ v)\n    show\n    set [costume v] to [1]\n    go to x: (-73) y: (114)\nend\nif <(Level) = [17]> then\n    show\n    set [costume v] to [3]\n    go to x: (2) y: (119)\nend\nif <(Level) = [18]> then\n    show\n    set [costume v] to [1]\n    go to x: (-49) y: (80)\nend\n\nwhen I receive [next level v]\ndelete this clone\n\ngo to x: (0) y: (0)\n\nforever\nend\n\nif <touching (jack jack v)?> then\nend\n\nchange [boss hp v] by (-1)\n\nswitch costume to ((Costume) + (1))\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\nset [ghost v] effect to (0)\n\ngo to x: (-122) y: (-67)\nswitch costume to (costume5 v)\nif <([costume name v] of [button v]) = [Down]> then\n    hide\nelse\n    show\nend\n\nwhen I start as a clone\ngo to [front v] layer\nif <(Level) = [16]> then\n    forever\n        go to x: (-122) y: (-67)\n        switch costume to (costume5 v)\n        if <([costume name v] of [button v]) = [Down]> then\n            hide\n        else\n            show\n        end\n    end\nend\n\nwhen I receive [raccoon throw v]\nhide\ngo to x: (-62) y: (120)\npoint towards (jack jack v)\nset rotation style [all around v]\nforever\n    show\n    repeat until <(y position) < [36]>\n        switch costume to (trash can v)\n        if <(Boss HP) = [4]> then\n            move (6) steps\n        else\n            move (11) steps\n        end\n    end\n    if <<(Levitation) = [0]> and <not <touching (mouse-pointer v)?>>> then\n        switch costume to (trash can v)\n        if <(Boss HP) = [4]> then\n            move (6) steps\n        else\n            move (11) steps\n        end\n        if <touching (the racoon v)?> then\n            if <(y position) > [35]> then\n                if <touching color (#2b1e13)?> then\n                    change [boss hp v] by (-1)\n                    broadcast (Bam v)\n                    hide\n                    stop [this script v]\n                end\n            end\n        end\n        if <touching (jack jack v)?> then\n            set [level v] to [19]\n            broadcast (Next Level v)\n            hide\n            stop [this script v]\n        end\n        if <touching (_edge_ v)?> then\n            hide\n            stop [this script v]\n        end\n    else\n        repeat until <(Levitation) = [0]>\n            switch costume to (trash can2 v)\n            if <not <touching (mouse-pointer v)?>> then\n                point towards (mouse-pointer v)\n            end\n        end\n    end\nend\n\nwhen I receive [raccoon smash v]\nshow\ngo to (the racoon v)\ngo to [front v] layer\nif <([direction v] of [the racoon v]) = [90]> then\n    switch costume to (arms v)\nelse\n    switch costume to (arms2 v)\nend\nif <touching (jack jack v)?> then\n    set [level v] to [19]\n    broadcast (Next Level v)\n    show\nend\nrepeat (75)\n    if <touching (jack jack v)?> then\n        if <([costume # v] of [jack jack v]) = [16]> then\n            set [brightness v] effect to (10)\n            set [boss hp v] to ((Old Boss Hp) - (1))\n        end\n    end\nend\nset [brightness v] effect to (0)\nhide\n\nwhen I receive [laser fight v]\nstop [other scripts in sprite v]\nhide\n\n@Raccoon\n\ndefine Attack\nif <touching (jack jack v)?> then\n    if <not <<<([costume # v] of [jack jack v]) = [16]> or <([costume # v] of [jack jack v]) = [18]>> or <([size v] of [jack jack v]) > [25]>>> then\n        if <(Racoon Hp) > [0]> then\n            change [level v] by (-1)\n            broadcast (Next Level v)\n        end\n    end\nend\n\nmove (-8) steps\n\nwhen flag clicked\nforever\n    if <touching (jack jack v)?> then\n        if <([costume # v] of [jack jack v]) = [18]> then\n            if <([direction v] of [jack jack v]) = [90]> then\n                change [racoon xv v] by (2)\n            else\n                change [racoon xv v] by (-2)\n            end\n        end\n    end\n    if <(costume [number v]) < [7]> then\n        switch costume to (racoon-hitbox v)\n    end\n    set [racoon xv v] to ((Racoon Xv) * (0.9))\n    change x by (Racoon Xv)\n    if <<touching (ground v)?> or <touching (levitation v)?>> then\n        change y by (1)\n        if <<touching (ground v)?> or <touching (levitation v)?>> then\n            change y by (1)\n            if <<touching (ground v)?> or <touching (levitation v)?>> then\n                change y by (1)\n                if <<touching (ground v)?> or <touching (levitation v)?>> then\n                    change y by (1)\n                    if <<touching (ground v)?> or <touching (levitation v)?>> then\n                        change y by (1)\n                        if <<touching (ground v)?> or <touching (levitation v)?>> then\n                            change x by ((Racoon Xv) * (-1))\n                            change y by (-5)\n                            set [racoon xv v] to [0]\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change [racoon yv v] by (-0.8)\n    change y by (Racoon Yv)\n    if <<touching (ground v)?> or <touching (levitation v)?>> then\n        change y by ((Racoon Yv) * (-1))\n        set [racoon yv v] to [0]\n    end\nend\n\nwhen flag clicked\nrepeat (10)\n    hide\nend\nset size to (50) %\nset rotation style [left-right v]\ncreate clone of (_myself_ v)\n\nbroadcast (Next Level v)\n\nwhen I receive [next level v]\nhide\nwait (0) seconds\nif <(Level) = [5]> then\n    set [racoon hp v] to [10]\n    point in direction (-90)\n    repeat (5)\n        go to x: (155) y: (-92)\n    end\n    Stuff-1\nend\nif <(Level) = [6]> then\n    set [racoon hp v] to [10]\n    point in direction (-90)\n    go to x: (159) y: (100)\n    Stuff-1\nend\nif <(Level) = [11]> then\n    set [racoon hp v] to [10]\n    point in direction (-90)\n    go to x: (50) y: (46)\n    Stuff-1\nend\nif <(Level) = [12]> then\n    set [racoon hp v] to [10]\n    point in direction (-90)\n    go to x: (-163) y: (-96)\n    Stuff-1\nend\nif <(Level) = [13]> then\n    set [racoon hp v] to [10]\n    point in direction (-90)\n    go to x: (98) y: (46)\n    Stuff-1\nend\nif <(Level) = [16]> then\n    set [racoon hp v] to [10]\n    point in direction (-90)\n    go to x: (-20) y: (168)\n    Stuff-1\nend\nif <(Level) = [17]> then\n    set [racoon hp v] to [10]\n    point in direction (-90)\n    go to x: (-3) y: (66)\n    Stuff-1\nend\nif <(Level) = [18]> then\n    set [racoon hp v] to [10]\n    point in direction (-90)\n    go to x: (-49) y: (138)\n    Stuff-1\nend\nif <(Level) = [19]> then\n    set [racoon hp v] to [10]\n    point in direction (-90)\n    go to x: (-149) y: (25)\n    Stuff-1\nend\n\ndefine Stuff-1\nset [attack v] to [0]\nshow\nif <(costume [number v]) < [7]> then\n    switch costume to (racoon-1 v)\nend\nforever\n    if <([x position v] of [jack jack v]) > (x position)> then\n        point in direction (90)\n    else\n        point in direction (-90)\n    end\n    if <(costume [number v]) < [7]> then\n        if <(Attack) = [0]> then\n            if <(Racoon Hp) > [0]> then\n                repeat (10)\n                    switch costume to (racoon-1 v)\n                end\n                switch costume to (racoon-1 v)\n            end\n            if <(Racoon Hp) > [0]> then\n                repeat (10)\n                    switch costume to (racoon-2 v)\n                end\n                switch costume to (racoon-2 v)\n            end\n        end\n    end\n    if <(Racoon Hp) < [1]> then\n        forever\n            if <(costume [number v]) < [7]> then\n                switch costume to (racoon-dead v)\n            end\n        end\n    end\nend\n\nwhen I receive [next level v]\nhide\nwait (0) seconds\nif <(Level) = [5]> then\n    Stuff-2\nend\nif <(Level) = [6]> then\n    Stuff-2\nend\nif <(Level) = [11]> then\n    Stuff-2\nend\nif <(Level) = [12]> then\n    wait (0.8) seconds\n    Stuff-2\nend\nif <(Level) = [13]> then\n    Stuff-2\nend\nif <(Level) = [16]> then\n    Stuff-2\nend\nif <(Level) = [17]> then\n    Stuff-2\nend\nif <(Level) = [18]> then\n    Stuff-2\nend\nif <(Level) = [19]> then\n    Stuff-2\nend\n\ndefine Move\nif <touching (jack jack v)?> then\n    if <([costume # v] of [jack jack v]) = [18]> then\n    end\nelse\n    if <(direction) = [90]> then\n        change [racoon xv v] by (0.5)\n    else\n        change [racoon xv v] by (-0.5)\n    end\nend\n\ndefine Stuff-2\nforever\n    if <(Racoon Hp) > [0]> then\n        if <(costume [number v]) < [7]> then\n            if <(distance to [jack jack v]) < [125]> then\n                repeat (5)\n                    set [attack v] to [1]\n                    repeat (2)\n                        switch costume to (racoon-3 v)\n                        Move\n                    end\n                    switch costume to (racoon-3 v)\n                    Attack\n                end\n                repeat (5)\n                    set [attack v] to [1]\n                    repeat (2)\n                        switch costume to (racoon-4 v)\n                        Move\n                    end\n                    switch costume to (racoon-4 v)\n                    Attack\n                end\n                switch costume to (racoon-4 v)\n                set [attack v] to [0]\n                wait (0.8) seconds\n            end\n        end\n    end\nend\n\nwhen I receive [spawn v]\nwait (2) seconds\nStuff-2\n\nwhen I receive [spawn v]\ngo to x: ([x position v] of [jack jack v]) y: (200)\nset [racoon yv v] to [0]\nset [racoon hp v] to [10]\nStuff-1\n\nwhen I start as a clone\nhide\nset size to (100) %\nforever\n    point in direction (90)\n    go to (raccoon v)\n    change y by (50)\n    switch costume to ((Racoon Hp) + (6))\n    if <(Racoon Hp) < [1]> then\n        switch costume to (hp-11 v)\n    end\nend\n\nwhen I receive [laser fight v]\nrepeat until <(Game End) = [1]>\n    hide\nend\n\n@Button\n\nwhen flag clicked\nhide\n\nwhen I receive [next level v]\nwait (0) seconds\nhide\nif <(Level) = [11]> then\n    show\n    go to x: (122) y: (-114)\n    forever\n        if <<touching (raccoon v)?> or <touching (jack jack v)?>> then\n            switch costume to (down v)\n        else\n            switch costume to (up v)\n        end\n    end\nend\nif <(Level) = [15]> then\n    show\n    go to x: (115) y: (-114)\n    forever\n        if <<touching (raccoon v)?> or <touching (jack jack v)?>> then\n            switch costume to (down v)\n        else\n            switch costume to (up v)\n        end\n    end\nend\nif <(Level) = [16]> then\n    show\n    go to x: (-80) y: (-118)\n    forever\n        if <<touching (raccoon v)?> or <touching (jack jack v)?>> then\n            switch costume to (down v)\n        else\n            switch costume to (up v)\n        end\n    end\nend\n\n@Incredi Star\n\nwhen I receive [new level v]\n\ndefine If Level =\nif <(Level) = [1]> then\n    go to x: (-198) y: (50)\nend\nif <(Level) = [2]> then\n    go to x: (-192) y: (154)\nend\nif <(Level) = [3]> then\n    go to x: (222) y: (-111)\nend\nif <(Level) = [4]> then\n    go to x: (57) y: (-127)\nend\nif <(Level) = [5]> then\n    go to x: (-155) y: (65)\nend\nif <(Level) = [6]> then\n    go to x: (2) y: (173)\nend\nif <(Level) = [7]> then\n    go to x: (81) y: (-123)\nend\nif <(Level) = [8]> then\n    go to x: (-74) y: (-92)\nend\nif <(Level) = [9]> then\n    go to x: (124) y: (-189)\nend\nif <(Level) = [10]> then\n    go to x: (-53) y: (-165)\nend\nif <(Level) = [11]> then\n    go to x: (133) y: (-133)\nend\nif <(Level) = [12]> then\n    go to x: (-55) y: (-121)\nend\nif <(Level) = [13]> then\n    go to x: (-235) y: (80)\nend\nif <(Level) = [14]> then\n    go to x: (11) y: (130)\nend\nif <(Level) = [15]> then\n    go to x: (11) y: (115)\nend\nif <(Level) = [16]> then\n    go to x: (126) y: (147)\nend\nif <(Level) = [17]> then\n    go to x: (160) y: (170)\nend\nif <(Level) = [18]> then\n    go to x: (121) y: (38)\nend\nif <(Level) = [19]> then\n    go to x: (0) y: (-100)\nend\nif <(Level) = [20]> then\n    go to x: (191) y: (-127)\nend\n\ngo to x: (0) y: (0)\n\nforever\n    set [ghost v] effect to (0)\nend\n\ngo to x: (157) y: (-162)\n\nwhen flag clicked\ndelete (all) of [collected v]\nforever\n    If Level =\n    if <[collected v] contains (Level)?> then\n        hide\n    else\n        show\n    end\n    switch costume to (incredi symbol-1 v)\n    set [ghost v] effect to (99)\n    if <(distance to [jack jack v]) < [100]> then\n        set [ghost v] effect to (distance to [jack jack v])\n    end\n    if <touching (jack jack v)?> then\n        set [ghost v] effect to (0)\n        add (Level) to [collected v]\n        repeat (2)\n            switch costume to (incredi symbol-1 v)\n            repeat (3)\n                next costume\n            end\n            repeat (3)\n                switch costume to ((costume [number v]) - (1))\n            end\n        end\n    end\nend\n\ngo to x: (-227) y: (12)\n\ngo to x: (-100) y: (0)\n\ngo to x: (145) y: (-118)\n\ndelete (all) of [collected v]\n\nwhen I receive [laser fight v]\nforever\n    if <(Laser Fight) < [-120]> then\n        stop [other scripts in sprite v]\n        show\n        go to [front v] layer\n        set [ghost v] effect to (0)\n        switch costume to ((length of [collected v]) + (4))\n        if <(length of [collected v]) = [0]> then\n            switch costume to (incredi symbol-25 v)\n        end\n        go to x: (171) y: (-97)\n    end\nend\n\n@The Racoon\n\nwhen flag clicked\nforever\n    if <not <(costume [number v]) = [7]>> then\n        go [backward v] (100) layers\n    end\nend\n\nwhen I receive [next level v]\nset rotation style [left-right v]\nhide\nwait (0) seconds\nif <(Level) = [20]> then\n    set [boss hp v] to [10]\n    set [old boss hp v] to [10]\n    create clone of (_myself_ v)\n    switch costume to (racoon-1 v)\n    show\n    point in direction (-90)\n    go to x: (295) y: (-12)\n    repeat until <(Boss HP) < [5]>\n        repeat until <<(x position) > (([x position v] of [jack jack v]) - (100))> and <(x position) < (([x position v] of [jack jack v]) + (100))>>\n            if <(x position) > ([x position v] of [jack jack v])> then\n                point in direction (-90)\n            else\n                point in direction (90)\n            end\n            repeat (20)\n                move (1) steps\n                change y by (-0.5)\n            end\n            repeat (20)\n                move (1) steps\n                change y by (0.5)\n            end\n        end\n        repeat (4)\n            wait (0.1) seconds\n            next costume\n        end\n        broadcast (Raccoon Smash v)\n        repeat (4)\n            switch costume to (racoon-5 v)\n            wait (0.5) seconds\n            next costume\n            wait (0.3) seconds\n        end\n        switch costume to (racoon-1 v)\n        wait (1) seconds\n        switch costume to (racoon-7 v)\n        set [yv v] to [12]\n        if <(x position) > ([x position v] of [jack jack v])> then\n            set [xv v] to [-10]\n        else\n            set [xv v] to [10]\n        end\n        wait (0.5) seconds\n        switch costume to (racoon-1 v)\n        set [old boss hp v] to (Boss HP)\n        wait (0.5) seconds\n    end\n    repeat until <(Boss HP) < [1]>\n        point in direction (90)\n        go to x: (-25) y: (-12)\n        switch costume to (racoon-8 v)\n        wait (0.5) seconds\n        switch costume to (racoon-9 v)\n        wait (0.5) seconds\n        broadcast (Raccoon Throw v)\n        switch costume to (racoon-10 v)\n        wait (5) seconds\n        switch costume to (racoon-8 v)\n        wait (1) seconds\n    end\nend\n\nrepeat (5)\nend\n\npoint towards (jack jack v)\n\nwhen I receive [next level v]\nwait (0) seconds\nif <(Level) = [20]> then\n    wait (4) seconds\n    repeat until <(Boss HP) < [1]>\n        broadcast (Spawn v)\n        wait (pick random (10) to (14)) seconds\n    end\nend\n\nforever\nend\n\nset y to (-12)\n\nwhen I start as a clone\nshow\nforever\n    set size to (300) %\n    go to x: (0) y: (100)\n    change y by (50)\n    switch costume to ((Boss HP) + (7))\n    if <(Boss HP) < [1]> then\n        switch costume to (hp-11 v)\n    end\nend\n\nwait until <(Racoon Hp) < [1]>\n\nset [boss hp v] to [2]\nset [old boss hp v] to [2]\n\nwhen I receive [bam v]\nif <(costume [number v]) > [18]> then\n    switch costume to (racoon-11 v)\n    wait (0.5) seconds\n    switch costume to (racoon-8 v)\nend\n\nwhen I receive [laser fight v]\nset [laser fight v] to [-20]\nset [game end v] to [0]\nrepeat until <(Game End) = [1]>\n    go to x: (170) y: (3)\n    go to [front v] layer\n    show\n    switch costume to (racoon-12 v)\n    point in direction (-90)\n    move (Laser Fight) steps\n    change [laser fight v] by (1)\n    if <(Laser Fight) > [150]> then\n        set [game end v] to [1]\n        broadcast (Next Level v)\n        change [level v] by (-1)\n    end\n    if <(Laser Fight) < [-120]> then\n        set [game end v] to [1]\n        hide\n        stop [all v]\n    end\n    if <key (space v) pressed?> then\n        go to [front v] layer\n        change [laser fight v] by (-6)\n        repeat until <not <key (space v) pressed?>>\n            go to [front v] layer\n            show\n            switch costume to (racoon-12 v)\n            go to x: (170) y: (3)\n            point in direction (-90)\n            move (Laser Fight) steps\n            change [laser fight v] by (1)\n        end\n    end\nend\n\nhide\n\nstop [other scripts in sprite v]\n\nwhen I receive [next level v]\ndelete this clone\n\nforever\nend\n\nwhen I receive [laser fight v]\ndelete this clone\n\nhide\nstop [all v]\n\nwhen I receive [next level v]\nwait (0.1) seconds\nforever\n    if <(Level) = [20]> then\n        if <(Boss HP) < [1]> then\n            broadcast (Laser Fight v)\n            stop [this script v]\n        end\n    end\nend\n\nwhen I receive [laser fight v]\ndelete this clone\n\nif <(Boss HP) < [1]> then\n    broadcast (Laser Fight v)\nend\n\nwait (1) seconds\n\nbroadcast (laser fight v)\n\n@Boss Fight Words\n\nwhen I receive [next level v]\nset [game end v] to [0]\nwait (0) seconds\nif <(Level) = [20]> then\n    show\n    repeat (4)\n        set size to (100) %\n        go to [front v] layer\n        next costume\n        if <(costume [number v]) = [5]> then\n            switch costume to (costume1 v)\n        end\n        go to x: (0) y: (-150)\n        set [ghost v] effect to (100)\n        repeat (20)\n            change y by (2)\n            change [ghost v] effect by (-5)\n        end\n        wait (2) seconds\n        repeat (20)\n            change y by (-2)\n            change [ghost v] effect by (5)\n        end\n        wait (2) seconds\n    end\nend\n\nwhen I receive [laser fight v]\nstop [other scripts in sprite v]\nset [ghost v] effect to (0)\nswitch costume to (costume5 v)\nshow\ngo to x: (0) y: (-15)\nset size to (100) %\nrepeat until <(Game End) = [1]>\n    repeat (2)\n        change size by (-4)\n    end\n    repeat (2)\n        change size by (4)\n    end\nend\nhide\n\nwhen flag clicked\nhide\n\n