ᴛʜᴇ ʙᴇᴇ'ꜱ ᴛʀᴏᴜʙʟᴇ | a platformer | second part of knight's platformer series | #all #games
@Stage\n\n@Fade\n\nwhen I receive [fade v]\nset [ghost v] effect to (0)\nshow\nwait (2) seconds\nbroadcast (animation v)\nwait (12) seconds\nbroadcast (Start v)\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\n\nwhen flag clicked\nswitch costume to (black v)\nhide\n\nshow\ngo to [front v] layer\ngo [backward v] (9) layers\n\nwhen I receive [avioneta v]\nset [ghost v] effect to (0)\nset [brightness v] effect to (100)\ngo to [front v] layer\nshow\nrepeat (10)\n    change [brightness v] effect by (-10)\nend\nrepeat (10)\n    change [ghost v] effect by (10)\nend\n\nwhen I receive [terremoto v]\nwait (3) seconds\nswitch costume to (black2 v)\nset [brightness v] effect to (0)\nset [ghost v] effect to (100)\nshow\nrepeat (20)\n    change [ghost v] effect by (-5)\nend\n\n@[level]\n\nwhen flag clicked\nshow\nforever\n    go to [back v] layer\nend\n\nwhen I receive [new start v]\nforever\n    switch costume to (Level)\nend\n\nwhen I receive [new start v]\nset volume to (100) %\nstop all sounds\nforever\n    if <(Level) = [14]> then\n        play sound [Boss level v] until done\n    else\n        play sound [Vexento-Pollen.mp3 v] until done\n    end\nend\n\nwhen I receive [die v]\n\nwhen I receive [boss level v]\nwait (0.1) seconds\nbroadcast (New start v)\n\nwhen I receive [boss defeated v]\nrepeat (10)\n    change volume by (-10)\nend\n\nwhen flag clicked\n\nwhen I receive [avioneta v]\nstop [other scripts in sprite v]\nhide\n\n@Backdrop\n\nwhen flag clicked\n\nwhen I receive [start v]\ngo to [back v] layer\n\n@Player\n\nwhen flag clicked\nforever\n    go to (hitbox v)\nend\n\nwhen flag clicked\nforever\n    set rotation style [left-right v]\nend\n\nwhen flag clicked\nforever\n    if <<key (d v) pressed?> or <key (right arrow v) pressed?>> then\n        point in direction (90)\n        switch costume to (2 v)\n        repeat (6)\n            next costume\n        end\n    else\n        if <<key (a v) pressed?> or <key (left arrow v) pressed?>> then\n            point in direction (-90)\n            switch costume to (2 v)\n            repeat (6)\n                next costume\n            end\n        else\n            switch costume to (1 v)\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    if <(yv) < [0]> then\n        switch costume to (10 v)\n    else\n        if <(yv) > [0]> then\n            switch costume to (9 v)\n        end\n    end\nend\n\nwhen I receive [start v]\nshow\nforever\n    if <(costume [number v]) = [7]> then\n        start sound [Foot Steps Sound v]\n    else\n        if <(costume [number v]) = [2]> then\n            start sound [Low Whoosh v]\n            wait until <not <(costume [number v]) = [2]>>\n        end\n    end\nend\n\nwhen I receive [die v]\ncreate clone of (_myself_ v)\nhide\nwait (3) seconds\nshow\n\nwhen I start as a clone\nshow\nrepeat (999)\n    set rotation style [all around v]\n    turn right (20) degrees\n    if <(y position) < [-165]> then\n        delete this clone\n    end\nend\n\nwhen I start as a clone\ngo to [front v] layer\nwait (3) seconds\ndelete this clone\n\nwhen I start as a clone\nstart sound [Punch v]\n\nwhen I receive [die v]\nset [die gravity v] to [20]\nwait (0.05) seconds\nset [die gravity v] to [12]\nwait (0.05) seconds\nset [die gravity v] to [4]\nwait (0.05) seconds\nset [die gravity v] to [-4]\nwait (0.05) seconds\nset [die gravity v] to [-12]\nwait (0.05) seconds\nset [die gravity v] to [-20]\n\nwhen I start as a clone\nforever\n    change y by (die gravity)\nend\n\nwhen flag clicked\nwait until <(Level) = [?]>\nhide\n\nwhen I receive [avioneta v]\nhide\nstop [other scripts in sprite v]\n\n@Hitbox\n\nwhen flag clicked\nhide\nset [level v] to [1]\nset [last checkpoint v] to [1]\n\nwhen I receive [start v]\nbroadcast (New start v)\nshow\nforever\n    change [xv v] by (<<key (right arrow v) pressed?> or <key (d v) pressed?>> - <<key (left arrow v) pressed?> or <key (a v) pressed?>>)\n    set [xv v] to ((xv) * (0.85))\n    change x by (xv)\n    change x by (((0) - (xv)) * <touching (\[level\] v)?>)\n    change y by (-1)\n    if <<touching (\[level\] v)?> and <<key (w v) pressed?> or <key (up arrow v) pressed?>>> then\n        set [yv v] to [15]\n    end\n    change [yv v] by (-1)\n    change y by ((yv) + (1))\n    if <touching (\[level\] v)?> then\n        change y by ((0) - (yv))\n        set [yv v] to [0]\n    end\nend\n\nwhen flag clicked\nforever\n    if <(x position) > [239]> then\n        change [level v] by (1)\n        set x to (-238)\n        change y by (2)\n        broadcast (change level v)\n    end\nend\n\nwhen flag clicked\nforever\n    if <[-239] > (x position)> then\n        change [level v] by (-1)\n        set x to (238)\n        change y by (2)\n        broadcast (change level v)\n    end\nend\n\ndefine Die\nset [level v] to (last checkpoint)\ngo to x: (-200) y: (-40)\nbroadcast (New start v)\n\nwhen I receive [new start v]\ngo to x: (-200) y: (0)\nwait until <<touching (dangerous v)?> or <<touching (boss v)?> or <<touching (fly v)?> or <touching (wisp v)?>>>>\nstart sound [Punch v]\nbroadcast (die v)\n\nwhen flag clicked\nforever\n    if <key (r v) pressed?> then\n        Die\n    end\nend\n\nwhen I receive [die v]\nrepeat (80)\n    set [yv v] to [1]\n    set [xv v] to [0]\nend\n\nwhen I receive [boss level v]\nwait (0.2) seconds\nrepeat (80)\n    go to x: (-200) y: (-50)\nend\n\nwhen I receive [new start v]\nwait until <(y position) < [-194]>\nstart sound [Slide Whistle v]\nbroadcast (die v)\n\nwhen I receive [start v]\nrepeat (10)\n    go to [back v] layer\nend\n\nwhen I receive [die v]\nhide\nwait (3) seconds\nshow\nDie\n\nwhen I receive [change level v]\nwait until <touching (cloudy v)?>\nif <(yv) < [0]> then\n    broadcast (cloudy dies v)\n    set [yv v] to [15]\nelse\n    broadcast (die v)\nend\n\nwhen I receive [avioneta v]\nstop [other scripts in sprite v]\nhide\n\nwhen I receive [tp v]\ngo to x: (-160) y: (8)\nset [xv v] to [0]\nset [yv v] to [0]\n\n@Sword\n\nwhen flag clicked\nforever\n    go to (hitbox v)\nend\n\nwhen I receive [die v]\nhide\nwait (3) seconds\nshow\n\nwhen I receive [start v]\nforever\n    if <not <(Level) = [?]>> then\n        if <<key (s v) pressed?> or <key (down arrow v) pressed?>> then\n            if <([direction v] of [player v]) = [90]> then\n                point in direction (90)\n                Attack\n                wait (0.3) seconds\n            else\n                if <([direction v] of [player v]) = [-90]> then\n                    point in direction (-90)\n                    Attack\n                    wait (0.3) seconds\n                else\n                    hide\n                end\n            end\n        else\n            hide\n        end\n    end\nend\n\ndefine Attack\nswitch costume to (1 v)\nshow\nwait (0.01) seconds\nswitch costume to (2 v)\nwait (0.01) seconds\nstart sound [High Whoosh v]\nswitch costume to (3 v)\nwait (0.1) seconds\nswitch costume to (2 v)\nwait (0.01) seconds\nswitch costume to (1 v)\n\nwhen I receive [die v]\nrepeat (45)\n    switch costume to (4 v)\n    set volume to (0) %\n    hide\nend\nset volume to (100) %\n\ngo [backward v] (1) layers\n\n@dangerous\n\nset [level v] to [9]\n\nwhen I receive [start v]\nforever\n    switch costume to (Level)\nend\n\n@cloudy\n\ndefine Mushroom (position x) (position y) (x times)\nshow\ngo to x: (position x) y: (position y)\nforever\n    repeat (x times)\n        point in direction (90)\n        change x by (1)\n    end\n    repeat (x times)\n        point in direction (-90)\n        change x by (-1)\n    end\nend\n\nwhen I receive [change level v]\nif <(Level) = [3]> then\n    Mushroom [60] [-80] [40]\nelse\n    if <(Level) = [4]> then\n        Mushroom [-30] [-80] [40]\n    else\n        if <(Level) = [5]> then\n            Mushroom [-40] [0] [90]\n        else\n            if <(Level) = [7]> then\n                Mushroom [0] [-30] [90]\n            else\n                if <(Level) = [8]> then\n                    Mushroom [50] [-30] [30]\n                else\n                    if <(Level) = [10]> then\n                        Mushroom [150] [-100] [30]\n                    else\n                        if <(Level) = [11]> then\n                            Mushroom [50] [-130] [100]\n                        else\n                            if <(Level) = [12]> then\n                                Mushroom [-50] [-130] [100]\n                            else\n                                hide\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen flag clicked\nhide\nforever\n    set rotation style [left-right v]\n    next costume\nend\n\nwhen I receive [new start v]\nbroadcast (change level v)\n\nwhen I receive [cloudy dies v]\nhide\nbroadcast (mush died v)\n\nset [level v] to [9]\n\n@cloudy dead\n\nwhen I receive [mush died v]\nstart sound [Punch v]\nset [brightness v] effect to (-50)\nshow\ngo to [front v] layer\ngo to (cloudy v)\nrepeat (5)\n    change y by (-5)\nend\nrepeat (5)\n    change y by (-10)\nend\nrepeat until <touching (_edge_ v)?>\n    change y by (-20)\nend\nhide\n\nwhen flag clicked\nhide\n\n@Coin\n\ndefine coin (x) (y) (level)\ngo to x: (x) y: (y)\nif <(Level) = (level)> then\n    if <[collected coins v] contains (level)?> then\n        hide\n    else\n        show\n        wait until <touching (hitbox v)?>\n        start sound [Coin v]\n        hide\n        add (level) to [collected coins v]\n        change [coins v] by (1)\n    end\nelse\n    hide\nend\n\nwhen I receive [change level v]\nif <(Level) = [2]> then\n    coin [120] [0] [2]\nelse\n    if <(Level) = [4]> then\n        coin [10] [100] [4]\n    else\n        if <(Level) = [5]> then\n            coin [95] [-30] [5]\n        else\n            if <(Level) = [8]> then\n                coin [-100] [150] [8]\n            else\n                if <(Level) = [10]> then\n                    coin [-150] [50] [10]\n                else\n                    hide\n                end\n            end\n        end\n    end\nend\n\nhide\n\nwhen flag clicked\ndelete all of [collected coins v]\nhide\n\nwhen I receive [die v]\nbroadcast (change level v)\n\n@Checkpoint\n\nwhen I receive [change level v]\nforever\n    if <(Level) = [7]> then\n        show\n        checkpoint generate [-180] [0] [7]\n    else\n        hide\n    end\nend\n\ndefine checkpoint generate (x) (y) (checkpoint)\nset [color v] effect to (0)\ngo to x: (x) y: (y)\nif <touching (hitbox v)?> then\n    set [color v] effect to (100)\n    set [last checkpoint v] to (checkpoint)\n    show\nend\n\nwhen I receive [start v]\nset size to (100) %\nset [brightness v] effect to (0)\nforever\n    repeat (20)\n        change size by (-1)\n        change [brightness v] effect by (-1)\n    end\n    repeat (20)\n        change size by (1)\n        change [brightness v] effect by (1)\n    end\nend\n\nwhen I receive [new start v]\nbroadcast (change level v)\n\n@fly\n\ndefine fly (position x) (position y) (x times)\nshow\ngo to x: (position x) y: (position y)\nforever\n    repeat (x times)\n        change y by (3)\n    end\n    repeat (x times)\n        change y by (-3)\n    end\nend\n\nwhen I receive [change level v]\nif <(Level) = [6]> then\n    fly [30] [-90] [30]\nelse\n    if <(Level) = [7]> then\n        fly [120] [90] [0]\n    else\n        if <(Level) = [8]> then\n            fly [-60] [-40] [10]\n        else\n            if <(Level) = [10]> then\n                fly [0] [-40] [10]\n            else\n                if <(Level) = [12]> then\n                    fly [150] [-40] [10]\n                else\n                    hide\n                end\n            end\n        end\n    end\nend\n\nwhen flag clicked\nhide\nforever\n    set rotation style [left-right v]\n    point towards (hitbox v)\nend\n\nwhen I receive [change level v]\nwait until <touching (sword v)?>\nhide\nbroadcast (spicky died v)\n\nwhen I receive [die v]\nhide\n\nwhen flag clicked\nforever\n    next costume\n    wait (0.01) seconds\nend\n\n@fly died\n\nwhen I receive [spicky died v]\nstart sound [Punch v]\nset [brightness v] effect to (-50)\nshow\ngo to [front v] layer\ngo to (fly v)\nrepeat (3)\n    change y by (10)\nend\nrepeat (5)\n    change y by (5)\nend\nrepeat (1)\n    change y by (0)\nend\nrepeat (5)\n    change y by (-5)\nend\nrepeat (5)\n    change y by (-10)\nend\nrepeat until <touching (_edge_ v)?>\n    repeat (4)\n        change y by (-20)\n    end\nend\nhide\n\nwhen flag clicked\nhide\n\n@Objeto1\n\nwhen flag clicked\nhide\n\nwhen I receive [animation v]\ngo to [front v] layer\nset [ghost v] effect to (100)\nshow\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\n\nwhen I receive [start v]\nhide\n\n@Objeto2\n\nwhen flag clicked\nhide\n\nwhen I receive [animation v]\nwait (3) seconds\ngo to [front v] layer\nset [ghost v] effect to (100)\nshow\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\n\nwhen I receive [start v]\nhide\n\n@Objeto3\n\nwhen I receive [animation v]\nwait (6) seconds\ngo to [front v] layer\nset [ghost v] effect to (100)\nshow\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [start v]\nhide\n\n@Objeto4\n\nwhen flag clicked\nrepeat (3)\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nshow\nset [ghost v] effect to (10)\nforever\n    if <(pick random (1) to (2)) = [2]> then\n        go to x: (-999) y: (pick random (-120) to (150))\n        if <(pick random (1) to (2)) = [2]> then\n            repeat until <(x position) > [285]>\n                change x by (1)\n            end\n            repeat (10)\n                change [ghost v] effect by (10)\n            end\n            create clone of (_myself_ v)\n            delete this clone\n        else\n            repeat until <(x position) > [285]>\n                change x by (0.5)\n            end\n            repeat (10)\n                change [ghost v] effect by (10)\n            end\n            create clone of (_myself_ v)\n            delete this clone\n        end\n    else\n        go to x: (999) y: (pick random (-120) to (150))\n        if <(pick random (1) to (2)) = [2]> then\n            repeat until <[-285] > (x position)>\n                change x by (-1)\n            end\n            repeat (10)\n                change [ghost v] effect by (10)\n            end\n            create clone of (_myself_ v)\n            delete this clone\n        else\n            repeat until <[-285] > (x position)>\n                change x by (-0.5)\n            end\n            repeat (10)\n                change [ghost v] effect by (10)\n            end\n            create clone of (_myself_ v)\n            delete this clone\n        end\n    end\nend\n\nwhen flag clicked\nhide\nforever\n    next costume\nend\n\n@Intro\n\nwhen flag clicked\nstart sound [intro music v]\npoint in direction (90)\nhide\nset [sine v] to [0]\nset [intro done? v] to [0]\nset [clone size v] to [0]\nset [clone rectangle horizontal type v] to [0]\nset [clone square type v] to [0]\nset [clone type v] to [0]\ncreate clone of (_myself_ v)\nwait (0.7) seconds\nrepeat (12)\n    change [clone square type v] by (1)\n    set [clone type v] to [1]\n    create clone of (_myself_ v)\n    wait (0.05) seconds\nend\nwait (1) seconds\nrepeat (4)\n    change [clone rectangle horizontal type v] by (1)\n    set [clone type v] to [2]\n    create clone of (_myself_ v)\n    wait (0.05) seconds\nend\nwait (0.7) seconds\nset [clone type v] to [3]\ncreate clone of (_myself_ v)\nwait (0.7) seconds\nshow\nset rotation style [don't rotate v]\nset size to (5) %\nswitch costume to (costume6 v)\nrepeat until <[100] < (size)>\n    change size by (((110) - (size)) * (0.15))\n    go to x: (0) y: (0)\n    point in direction (pick random (-179) to (180))\n    move (5) steps\nend\nbroadcast (intro part 2 v)\nrepeat (6)\n    change [clone square type v] by (1)\n    set [clone type v] to [4]\n    create clone of (_myself_ v)\nend\nrepeat until <(intro done?) = [1]>\n    set rotation style [all around v]\n    change size by (([sin v] of (sine) ) * (3))\n    change y by (([sin v] of (sine) ) * (3))\n    point in direction ((([sin v] of (sine) ) * (6)) + (90))\n    change [sine v] by (15)\n    go to x: (0) y: (0)\n    move (5) steps\nend\nset [clone size v] to [0]\nrepeat until <(size) < [10]>\n    change size by (clone size)\n    change [clone size v] by (-2)\nend\nswitch costume to (costume7 v)\npoint in direction (90)\nset [sine v] to [0]\nrepeat (35)\n    change size by (([sin v] of (sine) ) * (6))\n    change [sine v] by (10)\nend\nhide\n\nwhen I start as a clone\nif <(clone type) = [0]> then\n    set size to (100) %\n    show\n    set [ghost v] effect to (0)\n    switch costume to (costume1 v)\n    go to x: (0) y: (0)\n    wait (3) seconds\n    delete this clone\nend\nif <(clone type) = [1]> then\n    if <(clone square type) = [1]> then\n        go to x: (-176) y: (124)\n    end\n    if <(clone square type) = [2]> then\n        go to x: (-51) y: (124)\n    end\n    if <(clone square type) = [3]> then\n        go to x: (74) y: (124)\n    end\n    if <(clone square type) = [4]> then\n        go to x: (198) y: (124)\n    end\n    if <(clone square type) = [5]> then\n        go to x: (-176) y: (3)\n    end\n    if <(clone square type) = [6]> then\n        go to x: (-51) y: (3)\n    end\n    if <(clone square type) = [7]> then\n        go to x: (74) y: (3)\n    end\n    if <(clone square type) = [8]> then\n        go to x: (198) y: (3)\n    end\n    if <(clone square type) = [9]> then\n        go to x: (-176) y: (-119)\n    end\n    if <(clone square type) = [10]> then\n        go to x: (-51) y: (-119)\n    end\n    if <(clone square type) = [11]> then\n        go to x: (74) y: (-119)\n    end\n    if <(clone square type) = [12]> then\n        go to x: (198) y: (-119)\n    end\n    show\n    set [ghost v] effect to (0)\n    switch costume to (costume2 v)\n    set size to (5) %\n    repeat until <[100] < (size)>\n        change size by (((110) - (size)) * (0.2))\n    end\n    wait (3) seconds\n    repeat (12)\n        delete this clone\n    end\nend\nif <(clone type) = [2]> then\n    switch costume to (costume3 v)\n    set [ghost v] effect to (0)\n    show\n    set size to (100) %\n    if <(clone rectangle horizontal type) = [1]> then\n        go to x: (472) y: (135)\n    end\n    if <(clone rectangle horizontal type) = [2]> then\n        go to x: (472) y: (46)\n    end\n    if <(clone rectangle horizontal type) = [3]> then\n        go to x: (472) y: (-40)\n    end\n    if <(clone rectangle horizontal type) = [4]> then\n        go to x: (472) y: (-133)\n    end\n    repeat until <(intro done?) = [2]>\n        change x by (((0) - (x position)) * (0.15))\n    end\n    repeat until <(x position) < [-470]>\n        change x by (((-472) - (x position)) * (0.2))\n    end\n    delete this clone\nend\nif <(clone type) = [3]> then\n    show\n    go to x: (0) y: (0)\n    switch costume to (costume5 v)\n    set size to (200) %\n    switch costume to (costume4 v)\n    repeat until <(size) < [10]>\n        change size by (clone size)\n        change [clone size v] by (-1)\n    end\n    hide\nend\nif <(clone type) = [4]> then\n    show\n    switch costume to (costume7 v)\n    set size to (5) %\n    if <(clone square type) = [13]> then\n        go to x: (-157) y: (92)\n        repeat until <(intro done?) = [1]>\n            set rotation style [don't rotate v]\n            repeat until <[35] < (size)>\n                show\n                change size by (((40) - (size)) * (0.15))\n                point in direction (pick random (-179) to (180))\n                go to x: (-157) y: (92)\n                move (5) steps\n            end\n            set [clone size v] to [0]\n            repeat until <(size) < [10]>\n                change size by (clone size)\n                change [clone size v] by (-2)\n            end\n            hide\n            wait (0.4) seconds\n        end\n        delete this clone\n    end\n    if <(clone square type) = [14]> then\n        go to x: (157) y: (92)\n        repeat until <(intro done?) = [1]>\n            set rotation style [don't rotate v]\n            repeat until <[35] < (size)>\n                show\n                change size by (((40) - (size)) * (0.15))\n                point in direction (pick random (-179) to (180))\n                go to x: (157) y: (92)\n                move (5) steps\n            end\n            set [clone size v] to [0]\n            repeat until <(size) < [10]>\n                change size by (clone size)\n                change [clone size v] by (-2)\n            end\n            hide\n            wait (0.4) seconds\n        end\n        delete this clone\n    end\n    if <(clone square type) = [15]> then\n        go to x: (-157) y: (-92)\n        repeat until <(intro done?) = [1]>\n            set rotation style [don't rotate v]\n            repeat until <[35] < (size)>\n                show\n                change size by (((40) - (size)) * (0.15))\n                point in direction (pick random (-179) to (180))\n                go to x: (-157) y: (-92)\n                move (5) steps\n            end\n            set [clone size v] to [0]\n            repeat until <(size) < [10]>\n                change size by (clone size)\n                change [clone size v] by (-2)\n            end\n            hide\n            wait (0.4) seconds\n        end\n        delete this clone\n    end\n    if <(clone square type) = [16]> then\n        go to x: (157) y: (-92)\n        repeat until <(intro done?) = [1]>\n            set rotation style [don't rotate v]\n            repeat until <[35] < (size)>\n                show\n                change size by (((40) - (size)) * (0.15))\n                point in direction (pick random (-179) to (180))\n                go to x: (157) y: (-92)\n                move (5) steps\n                set [clone size v] to [0]\n            end\n            repeat until <(size) < [10]>\n                change size by (clone size)\n                change [clone size v] by (-2)\n            end\n            hide\n            wait (0.4) seconds\n        end\n        delete this clone\n    end\n    if <(clone square type) = [17]> then\n        go to x: (0) y: (-122)\n        repeat until <(intro done?) = [1]>\n            repeat until <[15] < (size)>\n                show\n                change size by (((20) - (size)) * (0.15))\n                turn right (5) degrees\n            end\n            set [clone size v] to [0]\n            repeat until <(size) < [10]>\n                turn right (5) degrees\n                change size by (clone size)\n                change [clone size v] by (-2)\n            end\n            hide\n            wait (0.4) seconds\n        end\n        delete this clone\n    end\n    if <(clone square type) = [18]> then\n        go to x: (0) y: (122)\n        repeat until <(intro done?) = [1]>\n            repeat until <[15] < (size)>\n                show\n                change size by (((20) - (size)) * (0.15))\n                turn right (5) degrees\n            end\n            set [clone size v] to [0]\n            repeat until <(size) < [10]>\n                turn right (5) degrees\n                change size by (clone size)\n                change [clone size v] by (-2)\n            end\n            hide\n            wait (0.4) seconds\n        end\n        delete this clone\n    end\nend\n\nwhen I receive [intro part 2 v]\nwait (6) seconds\nset [intro done? v] to [1]\nwait (1) seconds\nbroadcast (Fade v)\nset [intro done? v] to [2]\n\nwhen [s v] key pressed\nif <<(intro done?) = [0]> or <(intro done?) = [1]>> then\n    stop [other scripts in sprite v]\n    set [intro done? v] to [2]\n    broadcast (Fade v)\n    hide\n    stop all sounds\nend\n\nwhen I start as a clone\nwait until <(intro done?) = [2]>\ndelete this clone\n\n@wisp\n\ndefine wisp (position x) (position y) (rango)\nswitch costume to (1 v)\nset [ghost v] effect to (0)\nset [bee attack v] to [0]\nshow\ngo to x: (position x) y: (position y)\npoint in direction (90)\nwait until <(distance to [hitbox v]) < (rango)>\nset [bee attack v] to [1]\npoint towards (hitbox v)\nswitch costume to (3 v)\nrepeat until <touching (_edge_ v)?>\n    move (6) steps\nend\nrepeat (10)\n    move (6) steps\n    change [ghost v] effect by (10)\nend\nhide\nstop [this script v]\n\nwhen I receive [change level v]\nif <(Level) = [9]> then\n    wisp [100] [-40] [200]\nelse\n    if <(Level) = [10]> then\n        wisp [0] [100] [200]\n    else\n        if <(Level) = [11]> then\n            wisp [100] [60] [200]\n        else\n            if <(Level) = [12]> then\n                wisp [100] [60] [200]\n            else\n                hide\n            end\n        end\n    end\nend\n\nwhen I receive [die v]\nhide\n\nwhen flag clicked\n\nwhen I receive [change level v]\nrepeat until <(bee attack) = [1]>\n    switch costume to (pick random (1) to (2))\nend\nswitch costume to (3 v)\n\nwhen I receive [die v]\nswitch costume to (1 v)\n\n@avioneta fase\n\nwhen flag clicked\nforever\n    if <(Level) = [13]> then\n        show\n    else\n        hide\n    end\nend\n\nwhen flag clicked\nwait until <touching (player v)?>\nbroadcast (avioneta v)\nset [level v] to [?]\n\n@avioneta\n\nwhen I receive [avioneta v]\nwait (1) seconds\nforever\n    if <[190] < (y position)> then\n        change y by (-9999999)\n    else\n        if <(y position) < [-190]> then\n            change y by (99999)\n        end\n    end\nend\n\nwhen I receive [avioneta v]\nwait (1) seconds\nset [y velocity v] to [0]\nforever\n    if <key (any v) pressed?> then\n        if <(y velocity) < [10]> then\n            change [y velocity v] by (0.5)\n        end\n    else\n        if <[-10] < (y velocity)> then\n            change [y velocity v] by (-0.5)\n        end\n    end\nend\n\nwhen I receive [avioneta v]\npoint in direction (90)\nwait (1) seconds\nforever\n    change y by (y velocity)\n    point in direction ((90) - ((y velocity) * (2)))\nend\n\nwhen I receive [avioneta v]\nshow\nforever\n    next costume\nend\n\nwhen flag clicked\nhide\nforever\n    if <(Level) = [?]> then\n        play sound [Helicopter v] until done\n    end\nend\n\nwhen I receive [avioneta v]\nforever\n    set [y position v] to (y position)\nend\n\nwhen I receive [avioneta v]\nset [reset 2 v] to [0]\nshow\ngo to x: (-190) y: (0)\nwait until <<touching (wisp boss v)?> or <touching (púa v)?>>\nstart sound [Punch v]\nbroadcast (reset v)\nset [reset 2 v] to [1]\nwait (0.01) seconds\nbroadcast (avioneta v)\n\nbroadcast (avioneta v)\nset [level v] to [?]\n\nwhen I receive [explosión v]\npoint in direction (90)\nstop [other scripts in sprite v]\nglide (1) secs to x: (-190) y: (0)\n\nwhen I receive [terremoto v]\nrepeat (10)\n    go to x: (pick random (-185) to (-195)) y: (pick random (5) to (-5))\nend\ngo to x: (-190) y: (0)\n\n@Láser\n\nwhen flag clicked\nforever\n    if <(Level) = [?]> then\n        if <mouse down?> then\n            create clone of (_myself_ v)\n            wait (0.5) seconds\n        end\n    else\n        hide\n        delete this clone\n    end\nend\n\nwhen I start as a clone\nforever\n    change [color v] effect by (10)\nend\n\nwhen I start as a clone\nstart sound [Laser2 v]\ngo to (avioneta v)\nset rotation style [all around v]\npoint towards (avioneta v)\nshow\nrepeat until <touching (_edge_ v)?>\n    move (10) steps\nend\ndelete this clone\n\nchange x by (10)\n\n@wisp boss\n\nwhen I receive [avioneta v]\nset [attack v] to [0]\nhide\nwait (3) seconds\nshow\ngo to x: (100) y: (300)\nglide (3) secs to x: (100) y: (0)\nwait (4) seconds\nset [dead v] to [0]\nrepeat until <[0.01] > (boss life)>\n    first attack\n    first attack\n    first attack\n    wait (1) seconds\n    set [attack v] to [0]\n    wait (2) seconds\n    second attack\n    second attack\n    second attack\n    wait (1) seconds\n    set [attack v] to [0]\n    glide (1) secs to x: (100) y: (0)\n    wait (2) seconds\n    third attack\n    wait (2) seconds\n    set [attack v] to [0]\n    wait (1) seconds\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [avioneta v]\nforever\n    if <(attack) = [0]> then\n        switch costume to (1 v)\n        wait (0.0001) seconds\n        switch costume to (2 v)\n        wait (0.0001) seconds\n    end\nend\n\ndefine first attack\nif <(dead) = [0]> then\n    set [attack v] to [1]\n    wait (0.0002) seconds\n    switch costume to (4 v)\n    wait (1) seconds\n    repeat (3)\n        wait (0.01) seconds\n        next costume\n    end\n    start sound [Laser1 v]\n    switch costume to (8 v)\n    broadcast (púas v)\n    wait (0.01) seconds\n    switch costume to (4 v)\nelse\n    stop [this script v]\nend\n\ndefine second attack\nif <(dead) = [0]> then\n    set [attack v] to [1]\n    switch costume to (4 v)\n    glide (0.5) secs to x: (100) y: (y position)\n    repeat (50)\n        switch costume to (4 v)\n        set y to (y position)\n    end\n    wait (1) seconds\n    start sound [High Whoosh v]\n    repeat (10)\n        switch costume to (9 v)\n        move (-20) steps\n    end\n    repeat (10)\n        switch costume to (9 v)\n        move (20) steps\n    end\n    switch costume to (4 v)\nelse\n    stop [this script v]\nend\n\ndefine third attack\nif <(dead) = [0]> then\n    point in direction (90)\n    set [attack v] to [1]\n    switch costume to (4 v)\n    repeat (47)\n        turn right (30) degrees\n    end\n    broadcast (púa v)\n    point in direction (90)\nelse\n    stop [this script v]\nend\n\nwhen I receive [avioneta v]\nset [boss life v] to [15]\nforever\n    if <touching (láser v)?> then\n        change [boss life v] by (-0.01)\n        set [brightness v] effect to (30)\n    else\n        set [brightness v] effect to (0)\n    end\nend\n\nwhen I receive [reset v]\nstop [other scripts in sprite v]\n\nwhen I receive [avioneta v]\nset [brightness v] effect to (0)\nwait (3) seconds\nplay sound [2019-04-18_-_The_Epic_Boss_Fight_-_David_Fesliyan v] until done\n\nwhen I receive [avioneta v]\nset [brightness v] effect to (0)\nwait until <(boss life) < [0.01]>\nswitch costume to (1 v)\nshow\nglide (0.5) secs to x: (100) y: (0)\nstop all sounds\nstop [other scripts in sprite v]\nswitch costume to (1 v)\nrepeat (10)\n    change [brightness v] effect by (10)\nend\nbroadcast (explosión v)\nset [brightness v] effect to (0)\nswitch costume to (10 v)\nwait (1) seconds\nrepeat (6)\n    change y by (5)\nend\nstart sound [Slide Whistle v]\nrepeat (10)\n    change y by (2.5)\nend\nrepeat (1)\n    change y by (0)\nend\nrepeat (10)\n    change y by (-2.5)\nend\nrepeat (50)\n    change y by (-5)\nend\nhide\nwait (1) seconds\nbroadcast (terremoto v)\nstart sound [Slide Whistle2 v]\n\nglide (1) secs to x: (100) y: (-999)\n\n@Púa\n\nwhen I receive [púas v]\nset [brightness v] effect to (0)\nhide\npoint in direction (90)\ncreate clone of (_myself_ v)\npoint in direction (135)\ncreate clone of (_myself_ v)\npoint in direction (45)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\ngo to x: (0) y: (0)\nshow\nrepeat until <touching (_edge_ v)?>\n    move (-8) steps\nend\ndelete this clone\n\nwhen I receive [púa v]\nset [brightness v] effect to (100)\nrepeat (15)\n    turn right (50) degrees\n    create clone of (_myself_ v)\nend\n\nwhen I receive [reset v]\nstop [other scripts in sprite v]\n\nwhen I start as a clone\nwait until <(reset 2) = [1]>\ndelete this clone\n\n@silueta2\n\nwhen I receive [explosión v]\ngo to (wisp boss v)\nswitch costume to (explode-05-june\[2 v)\nshow\nstart sound [wut2 v]\nrepeat (25)\n    next costume\nend\nhide\n\n@Objeto5\n\nwhen I receive [avioneta v]\nswitch costume to (disfraz15 v)\nset [ghost v] effect to (100)\nshow\nrepeat (50)\n    change [ghost v] effect by (-2)\nend\nswitch costume to (disfraz15 v)\nstart sound [Connect v]\nrepeat (15)\n    next costume\nend\nrepeat until <(boss life) < [0.01]>\n    switch costume to (round ((boss life) + (1)))\nend\n\nwhen flag clicked\nhide\n\n@[level]2\n\nwhen I receive [new start v]\nforever\n    switch costume to (Level)\nend\n\nwhen flag clicked\nset [brightness v] effect to (-5)\nshow\ngo to [back v] layer\ngo [forward v] (7) layers\n\nwhen I receive [avioneta v]\nhide\n\n@Objeto6\n\nwhen flag clicked\ngo to x: (0) y: (0)\nset [ghost v] effect to (30)\nswitch costume to (disfraz1 v)\nset [brightness v] effect to (20)\nset [ghost v] effect to (-10)\nshow\ngo to [back v] layer\ngo [forward v] (3) layers\nforever\n    set y to (([y position v] of [player v]) * (-0.1))\n    set x to (([x position v] of [player v]) * (-0.2))\nend\n\nwhen I receive [avioneta v]\nhide\n\nwhen I receive [change level v]\nnext costume\n\n@Sign\n\nwhen I receive [change level v]\nforever\n    if <(Level) = [1]> then\n        Position [80] [0] (translate [Welcome to ''THE BEES TROUBLE'' the second part of the knight's platformer series, in this platformer you can go left or right, move with w,a and d or arrow keys.] to ((language::translate) v)::translate)\n    else\n        if <(Level) = [2]> then\n            Position [-105] [20] (translate [Avoid spikes, JUMP!] to ((language::translate) v)::translate)\n        else\n            if <(Level) = [3]> then\n                Position [-100] [-20] (translate [Here there is an enemie, this enemie is invurnerable but you can jump over him] to ((language::translate) v)::translate)\n            else\n                if <(Level) = [6]> then\n                    Position [-150] [-20] (translate [Here there is another enemie, this enemie is vurnerable, so, press down key or 's' and use your sword] to ((language::translate) v)::translate)\n                else\n                    if <(Level) = [7]> then\n                        Position [-100] [-20] (translate [Nice, you get a checkpoint, if you die, you will respawn here] to ((language::translate) v)::translate)\n                    else\n                        if <(Level) = [9]> then\n                            Position [-150] [-49] (translate [Esto es una avispa, ten cuidado es invurlnerable, y si te acercas te atacará, engáñala saltando] to ((language::translate) v)::translate)\n                        else\n                            if <(Level) = [13]> then\n                                Position [-159] [-60] (translate [Bien, llega la hora de enfrentarse al jefe final, salta a la avioneta, te hará falta] to ((language::translate) v)::translate)\n                            else\n                                hide\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\ndefine Position (x) (y) (text)\nshow\ngo to x: (x) y: (y)\nif <touching (hitbox v)?> then\n    say (text) for (0.01) seconds\nend\n\nwhen flag clicked\ngo to [back v] layer\ngo [forward v] (6) layers\n\n@Objeto7\n\nwhen I receive [avioneta v]\nset [ghost v] effect to (0)\nshow\ngo to x: (0) y: (0)\nwait (4) seconds\nrepeat (20)\n    change [ghost v] effect by (5)\nend\n\nwhen flag clicked\nhide\n\n@Objeto8\n\nwhen flag clicked\nhide\n\nshow\ngo to [front v] layer\n\n@Objeto9\n\nwhen flag clicked\nshow\npoint in direction (90)\nset size to (100) %\nforever\n    if <touching (mouse-pointer v)?> then\n        set [brightness v] effect to (20)\n        set size to (120) %\n    else\n        set size to (100) %\n        set [brightness v] effect to (0)\n    end\nend\n\nwhen this sprite clicked\nhide\nbroadcast (tp v)\nbroadcast (change level v)\nchange [level v] by (1)\nshow\n\nwhen flag clicked\ngo to [back v] layer\ngo [forward v] (10) layers\nforever\n    if <(Level) = [25]> then\n        wait (0.5) seconds\n        hide\n    end\nend\n\nwhen I receive [mobile mode v]\ngo to x: (0) y: (-150)\n\nwhen I receive [selected mode v]\ngo to x: (-200) y: (-150)\n\nwhen flag clicked\nhide variable [seconds: v]\n\nwhen flag clicked\nshow\nwait until <(Level) = [13]>\nhide\n\n
ENGLISH:\nWelcome to ''THE BEE'S TROUBLE'' the second part of my platformer series.\nPlease don't forget to leave a ❤ and a⭐\nThis game took me so many time, I hope you enjoy ;)\nFollow me for more games :D\nFirst part: https://scratch.mit.edu/projects/445876232/\nThere is two parts of the game.\n100% code mine @RafaVc2006\n99% art mine, except 1% is from explosion that i picked from a @yuseford project.\nINSTRUCTIONS:\n-Arrow keys or wasd to move.\n-Down key or s to attack.\n-Avoid spikes.\n-You can kill some enemies.\n-In the second part press any key to fly and click to shoot. Try to kill the bee queen.