SketchBook || A Platformer (Story Mode!!)                  #games #all
@Stage\n\n@Hitbox⛏️\n\nwhen flag clicked\nset volume to (100) %\nhide\nforever\n    switch costume to (hitbox⛏️ v)\n    if <(x position) > [238]> then\n        start sound [Connect v]\n        broadcast (next v)\n        wait (1) seconds\n        set [deaths v] to [0]\n        respawn\n        change [level v] by (1)\n    end\nend\n\nwhen I receive [respawn v]\nrespawn\n\ndefine respawn\nerase all\nset x to (-195)\nset y to (-40)\n\nwhen I receive [start v]\nset [level v] to [1]\nforever\n    change y by (-3)\n    if <<touching (platform v)?> and <(y position) > ([y position v] of [platform v])>> then\n        change x by ((([x position v] of [platform v]) - (x position)) / (2))\n    end\n    change y by (3)\nend\n\nwhen I receive [start v]\nforever\n    if <not <[9] < (level)>> then\n        play sound [Vexento - Lights v] until done\n    end\nend\n\nwhen I receive [start v]\nset [-speed v] to [-0.7]\npoint in direction (90)\nshow\nrespawn\nset [x v] to [0]\nset [y v] to [0]\nforever\n    set [ghost v] effect to (100)\n    change [y v] by (-0.5)\n    if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n        change [x v] by (-speed)\n    end\n    if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n        change [x v] by ([abs v] of (-speed) )\n    end\n    set [x v] to ((x) * (0.85))\n    change x by (x)\n    if <<touching (platform v)?> or <<touching (gound v)?> or <touching color (#120035)?>>> then\n        change y by (1)\n        if <<touching (platform v)?> or <<touching (gound v)?> or <touching color (#120035)?>>> then\n            change y by (1)\n            if <<touching (platform v)?> or <<touching (gound v)?> or <touching color (#120035)?>>> then\n                change y by (1)\n                if <<touching (platform v)?> or <<touching (gound v)?> or <touching color (#120035)?>>> then\n                    change y by (1)\n                    if <<touching (platform v)?> or <<touching (gound v)?> or <touching color (#120035)?>>> then\n                        change y by (1)\n                        if <<touching (platform v)?> or <<touching (gound v)?> or <touching color (#120035)?>>> then\n                            change y by (1)\n                            if <<touching (platform v)?> or <<touching (gound v)?> or <touching color (#120035)?>>> then\n                                change y by (-6)\n                                if <<touching (platform v)?> or <<touching (gound v)?> or <touching color (#120035)?>>> then\n                                    change y by (0.5)\n                                    change x by ((x) * (-1))\n                                    set [x v] to [0]\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change y by (y)\n    if <<touching (platform v)?> or <<touching (gound v)?> or <touching color (#120035)?>>> then\n        change y by ((y) * (-1))\n        set [y v] to [0]\n    end\n    change y by (-0.5)\n    if <<<touching (platform v)?> or <<touching (gound v)?> or <touching color (#120035)?>>> and <<key (up arrow v) pressed?> or <key (w v) pressed?>>> then\n        set [y v] to [10]\n        set [jump v] to [True]\n    else\n        set [jump v] to [False]\n    end\n    change y by (0.5)\n    if <<touching (ladder v)?> and <<key (up arrow v) pressed?> or <key (w v) pressed?>>> then\n        set [y v] to [3]\n    else\n    end\n    if <<touching (danger v)?> or <<touching color (#ff0000)?> or <(y position) < [-185]>>> then\n        hide\n        start sound [Roblox Death Sound - OOF Sound Effect v]\n        respawn\n        show\n    end\n    if <touching (trampoline v)?> then\n        start sound [Boing v]\n        set [y v] to [13]\n    end\n    if <touching (enemies v)?> then\n        respawn (enemy touching)\n    end\nend\n\nwhen I receive [touched him >:\( v]\nrespawn (enemy touching)\n\ndefine respawn (enemy touching)\nbroadcast (next/died v)\nhide\nstart sound [Roblox Death Sound - OOF Sound Effect v]\nrespawn\nshow\n\nwhen I receive [start v]\nset [level v] to [1]\nforever\nend\n\nchange y by (-3)\n\nchange y by ((([y position v] of [platform v]) - (y position)) / (2))\n\nwhen I receive [show enemy v]\nset volume to (0) %\n\nset [pitch v] effect to (0)\nset [stopped? v] to [1]\n\nset [pitch v] effect to (200)\n\nset [stopped? v] to [0]\n\nwhen I receive [play on! v]\nset volume to (100) %\n\nwhen flag clicked\nrespawn\n\nwhen I receive [sword v]\nset volume to (0) %\n\n@Player\n\nwhen I receive [start v]\nerase all\ngo to [front v] layer\nforever\n    if <key (space v) pressed?> then\n        if <[7] < (level)> then\n            switch costume to (sword v)\n            repeat (4)\n                next costume\n                wait (0.03) seconds\n            end\n        end\n    else\n        if <key (z v) pressed?> then\n            if <(gun?) = [yup]> then\n                switch costume to (bullet v)\n                create clone of (_myself_ v)\n                switch costume to (gun v)\n                play sound [Gunfire_Long_Distance2 v] until done\n                switch costume to (gun3 v)\n                wait (0.1) seconds\n                switch costume to (gun2 v)\n                play sound [1 v] until done\n                switch costume to (gun3 v)\n                play sound [2 v] until done\n            end\n        end\n        if <<key (w v) pressed?> or <key (up arrow v) pressed?>> then\n            switch costume to (jump v)\n            if <touching (ladder v)?> then\n                switch costume to (ladder v)\n                wait (0.3) seconds\n                next costume\n                wait (0.3) seconds\n            end\n        else\n            if <<<key (left arrow v) pressed?> or <key (right arrow v) pressed?>> or <<key (a v) pressed?> or <key (d v) pressed?>>> then\n                if <(costume [number v]) > [6]> then\n                    switch costume to (costume2 v)\n                end\n                next costume\n                wait (0.04) seconds\n            else\n                if <<key (w v) pressed?> or <key (up arrow v) pressed?>> then\n                    switch costume to (jump v)\n                else\n                    switch costume to (still v)\n                end\n            end\n            if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n                point in direction (90)\n            else\n                if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n                    point in direction (-90)\n                end\n            end\n        end\n    end\nend\n\nwhen flag clicked\nshow\nforever\n    if <<touching (danger v)?> or <<touching color (#ff0000)?> or <(y position) < [-185]>>> then\n        hide\n        reset\n        respawn\n        show\n    end\n    if <touching (trampoline v)?> then\n        set [y v] to [13]\n    end\n    if <touching (enemies v)?> then\n        broadcast (touched him >:\( v)\n        reset\n        respawn\n        broadcast (next/died v)\n    end\n    show\n    set [fall v] to [nope]\n    if <(stopped?) = [True]> then\n        hide\n    end\nend\n\nwhen flag clicked\nforever\n    if <(x position) > [238]> then\n        hide\n        wait (1.4) seconds\n        show\n    end\nend\n\nif <[7] > (costume [number v])> then\nif <(costume [number v]) > [10]> then\nnext costume\nwait (0.04) seconds\n\nwhen flag clicked\nhide\n\nwhen I receive [start v]\npoint in direction (90)\nforever\n    go to (hitbox⛏️ v)\nend\n\nwhen flag clicked\npoint in direction (90)\nswitch costume to (still v)\nshow\n\nwhen I receive [play on! v]\nshow\n\nwhen I receive [show enemy v]\nhide\n\nwhen I receive [start v]\nforever\n    if <(level) = [7]> then\n        if <(x position) > [-28]> then\n            broadcast (sword v)\n            hide\n            stop [this script v]\n        end\n    end\nend\n\ndefine previous costume\nswitch costume to ((costume [number v]) - (1))\n\nwhen I receive [speed for 1 level v]\nrepeat until <not <(#) = (level)>>\n\nwhen I start as a clone\nif <not <(costume [name v]) = [bullet]>> then\n    show\n    repeat (8)\n        change [ghost v] effect by (30)\n    end\n    delete this clone\nelse\n    if <(direction) = [90]> then\n        point in direction (90)\n    else\n        point in direction (-90)\n    end\n    repeat until <<<touching (_edge_ v)?> or <touching (gound v)?>> or <touching (enemies v)?>>\n        move (10) steps\n    end\n    delete this clone\nend\n\nwhen I receive [start v]\nwait (1) seconds\nset [# v] to [0]\nforever\n    if <(#) = (level)> then\n        repeat until <not <(#) = (level)>>\n            create clone of (_myself_ v)\n        end\n        stop [this script v]\n    end\nend\n\nwhen flag clicked\nforever\n\nif <key (z v) pressed?> then\n    switch costume to (bullet v)\n    create clone of (_myself_ v)\n    switch costume to (gun v)\n    play sound [Gunfire_Long_Distance2 v] until done\n    play sound [Bolt Action Sniper Reload Sound Gaming Sound Effects v] until done\nend\n\nwhen flag clicked\nforever\n    if <[11] < (level)> then\n        stop [other scripts in sprite v]\n        broadcast (Last v)\n        hide\n        stop all sounds\n        stop [this script v]\n    end\nend\n\n@Gound\n\nwhen flag clicked\nset [ghost v] effect to (100)\n\nwhen flag clicked\nhide\nforever\n    switch costume to (level)\nend\n\nwhen I receive [start v]\nshow\n\n@Danger\n\nwhen flag clicked\nhide\nforever\n    hide\n    if <(level) = [2]> then\n        show\n        switch costume to (costume1 v)\n        repeat (3)\n            next costume\n            wait (0.06) seconds\n        end\n        wait (1) seconds\n        repeat (3)\n            previous\n            wait (0.06) seconds\n        end\n        wait (1) seconds\n    end\n    if <(level) = [6]> then\n        show\n        switch costume to (costume5 v)\n        repeat (3)\n            next costume\n            wait (0.06) seconds\n        end\n        wait (1) seconds\n        repeat (3)\n            previous\n            wait (0.06) seconds\n        end\n        wait (1) seconds\n    end\n    if <(level) = [8]> then\n        show\n        switch costume to (costume10 v)\n        repeat (3)\n            next costume\n            wait (0.06) seconds\n        end\n        wait (1) seconds\n        repeat (3)\n            previous\n            wait (0.06) seconds\n        end\n        wait (1) seconds\n    end\nend\n\ndefine previous\nswitch costume to ((costume [number v]) - (1))\n\n@effect of drawn\n\nwhen flag clicked\nhide\nforever\n    switch costume to (level)\nend\n\nwhen I receive [start v]\nshow\n\nset [ghost v] effect to (100)\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\n\n@platform\n\nwhen flag clicked\nforever\n    hide\n    if <(level) = [1]> then\n        show\n        set [ghost v] effect to (100)\n        go to x: (-107) y: (-130)\n        glide (2) secs to x: (113) y: (-130)\n        glide (2) secs to x: (-107) y: (-130)\n    end\n    if <(level) = [6]> then\n        show\n        set [ghost v] effect to (100)\n        go to x: (-153) y: (-26)\n        glide (2) secs to x: (116) y: (74)\n        glide (2) secs to x: (-153) y: (-26)\n    end\nend\n\n@Enemies\n\nwhen I receive [restart v]\ndelete this clone\n\ndefine Clone (type) (x) (y)\ngo to x: (x) y: (y)\nswitch costume to (type)\nset [clone# v] to (type)\ncreate clone of (_myself_ v)\n\nswitch costume to (weapon1 v)\nset [katana rotation v] to (() * (90))\ncreate clone of (_myself_ v)\nswitch costume to (costume1 v)\n\nwhen I receive [restart v]\nhide\nif  then\n    delete this clone\nend\nrepeat (Amount)\n    Clone [1] [194] [-60]\n    wait (1) seconds\nend\n\nwhen I start as a clone\ngo to x: (180) y: (-60)\npoint in direction (90)\nclear graphic effects\nset size to (100) %\nshow\nset [enemies: enemyx v] to [0]\nset [enemies: enemyy v] to [0]\ngo to [front v] layer\nforever\n    if <<touching (danger v)?> or <<[-175] > (y position)> or <touching color (#6eedff)?>>> then\n        delete this clone\n    end\n    change [enemies: enemyy v] by (-1)\n    if <([x position v] of [player v]) < ((x position) - (10))> then\n        change [enemies: enemyx v] by ((0) - ((Speed) / (10)))\n        point in direction (-90)\n    end\n    if <((x position) - (-10)) < ([x position v] of [player v])> then\n        change [enemies: enemyx v] by ((Speed) / (10))\n        point in direction (90)\n    end\n    set [enemies: enemyx v] to ((Enemies: Enemyx) * (0.9))\n    change x by (Enemies: Enemyx)\n    if <touching (gound v)?> then\n        change y by (1)\n    end\n    if <touching (gound v)?> then\n        change y by (1)\n    end\n    if <touching (gound v)?> then\n        change y by (1)\n    end\n    if <touching (gound v)?> then\n        change y by (1)\n    end\n    if <touching (gound v)?> then\n        change y by (-4)\n        change x by ((Enemies: Enemyx) * (-1))\n        if <(y position) < ([y position v] of [player v])> then\n            set [enemies: enemyy v] to [10]\n            if <([abs v] of (x) ) = (x)> then\n                set [enemies: enemyx v] to [-10]\n            else\n                set [enemies: enemyx v] to [10]\n            end\n        else\n            set [enemies: enemyx v] to [0]\n        end\n    end\n    change y by (Enemies: Enemyy)\n    if <touching (gound v)?> then\n        change y by ((Enemies: Enemyy) - ((Enemies: Enemyy) * (2)))\n        set [enemies: enemyy v] to [0]\n    end\n    change y by (1)\n    if <<((y position) - (-50)) < ([y position v] of [player v])> and <touching (level v)?>> then\n        set [enemies: enemyy v] to [14]\n    end\n    show\n    if <(stopped?) = [True]> then\n        hide\n    end\n    change y by (-1)\nend\n\nwhen flag clicked\nset [speed v] to [4]\nset [amount v] to [1]\n\nset [speed v] to [4]\n\nwhen I receive [die v]\nclear graphic effects\nset rotation style [left-right v]\nrepeat (20)\n    turn right (15) degrees\n    change y by (10)\n    change [ghost v] effect by (5)\nend\ndelete this clone\n\nwhen I receive [next/died v]\nbroadcast (Restart v)\ndelete this clone\n\nwhen I receive [next v]\ndelete this clone\n\nwhen flag clicked\nhide\nset [level v] to [0]\n\nforever\n    hide\n    if <(level) = [4]> then\n        broadcast (Restart v)\n        stop [this script v]\n    end\nend\n\nswitch costume to (still v)\n\nswitch costume to (still v)\n\nwhen I receive [play on! v]\nif <(level) = [4]> then\n    broadcast (Restart v)\nend\n\nif <(costume [number v]) < [7]> then\n    next costume\nelse\n    next costume\nend\n\nwhen flag clicked\nhide\nset [level v] to [0]\nforever\n\nwhen flag clicked\nforever\n    hide\n    if <(level) = [6]> then\n        broadcast (Restart v)\n        stop [this script v]\n    end\nend\n\nwhen flag clicked\nforever\n    hide\n    if <(level) = [11]> then\n        broadcast (Restart v)\n        stop [this script v]\n    end\nend\n\n@platform drawn\n\nwhen flag clicked\nforever\n    go to (platform v)\nend\n\nwhen flag clicked\nforever\n    hide\n    if <(level) = [1]> then\n        show\n    end\n    if <(level) = [6]> then\n        show\n    end\nend\n\n@next level\n\nwhen I receive [next v]\nshow\nswitch costume to (costume10 v)\nstart sound [page-flip v]\nrepeat (10)\n    next costume\nend\nwait (1) seconds\nstart sound [page-flip2 v]\nrepeat (10)\n    switch costume to ((costume [number v]) - (1))\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [start v]\nshow\nswitch costume to (costume10 v)\nforever\n    go to [front v] layer\n    go to [front v] layer\n    go to [front v] layer\n    go to [front v] layer\n    go to [front v] layer\n    go to [front v] layer\n    go to [front v] layer\n    go to [front v] layer\nend\n\n@thumb\n\nwhen flag clicked\nshow\nforever\n    go to [front v] layer\n    go to [front v] layer\n    go to [front v] layer\n    go to [front v] layer\n    go to [front v] layer\n    go to [front v] layer\n    go to x: (0) y: (0)\n    set [ghost v] effect to (100)\nend\n\nwhen I receive [win! v]\nhide\n\nwhen I receive [game over v]\nhide\n\n@animation\n\nwhen I receive [show animation part 2 v]\nshow\ngo to [front v] layer\nrepeat (8)\n    next costume\n    wait (0.05) seconds\nend\nplay sound [Crunch v] until done\nwait (1) seconds\nrepeat (6)\n    next costume\n    wait (0.07) seconds\nend\nwait (1) seconds\nbroadcast (show text part 2 v)\nhide\n\nwhen flag clicked\nset size to (100) %\nhide\n\nwhen I receive [show animation part 1 v]\nshow\ngo to [front v] layer\nswitch costume to (costume1 v)\nset size to (100) %\nset size to (100) %\nwait (1) seconds\nrepeat (4)\n    next costume\n    wait (0.04) seconds\nend\nwait (1) seconds\nstart sound [High Whoosh v]\nrepeat (7)\n    next costume\n    wait (0.015) seconds\nend\nwait (1) seconds\nstart sound [Low Whoosh v]\nrepeat (6)\n    next costume\n    wait (0.03) seconds\nend\nwait (1) seconds\nnext costume\nrepeat (420)\n    change size by (0.04)\nend\nhide\nset size to (100) %\nbroadcast (show text part 1 v)\n\nwhen I receive [stop v]\nstop [other scripts in sprite v]\nhide\nforever\n    if <<[4] < (level)> or <(level) = [4]>> then\n        broadcast (show enemy v)\n        stop [this script v]\n    end\nend\n\nwhen I receive [show enemy v]\ngo to x: (0) y: (0)\nswitch costume to (resize v)\nshow\nset size to (100) %\nset size to (100) %\ngo to [front v] layer\nset [stopped? v] to [True]\nset size to (100) %\nshow\nset size to (100) %\nswitch costume to (level 3 4 v)\ngo to [front v] layer\nwait (1) seconds\nplay sound [Ring Tone v] until done\ngo to [front v] layer\nrepeat (4)\n    next costume\n    wait (0.04) seconds\nend\nset voice to (giant v)::tts\nspeak [hello?]::tts\nnext costume\nset voice to (tenor v)::tts\nspeak [A prisoner is trying to escape. Take some action immediately.]::tts\nwait (0.3) seconds\nspeak [Also, Don't forget to wear your hover boards. They will help you.]::tts\nswitch costume to (level 3 2 v)\nwait (0.04) seconds\nrepeat (3)\n    previous costume\n    wait (0.04) seconds\nend\nwait (1) seconds\nswitch costume to (level 3 8 v)\nrepeat (6)\n    next costume\n    wait (0.04) seconds\nend\nplay sound [Siren Whistle v] until done\nrepeat (4)\n    next costume\n    wait (0.04) seconds\nend\nwait (1) seconds\nhide\nset [level v] to [4]\nset [stopped? v] to [False]\nbroadcast (play on! v)\n\ndefine previous costume\nswitch costume to ((costume [number v]) - (1))\n\nwhen flag clicked\nset [level v] to [0]\nset [stopped? v] to [False]\n\nwhen I receive [sword v]\nswitch costume to (resize v)\nset size to (100) %\ngo to [front v] layer\nset [stopped? v] to [True]\nshow\nswitch costume to (costume21 v)\ngo to [front v] layer\nwait (1) seconds\nrepeat (3)\n    next costume\n    wait (0.04) seconds\nend\nwait (0.96) seconds\nset y to (62)\nnext costume\nwait (1) seconds\nrepeat (2)\n    next costume\n    wait (0.04) seconds\nend\nstart sound [Crunch v]\nrepeat (4)\n    next costume\n    wait (0.04) seconds\nend\nbroadcast (next v)\nwait (1) seconds\nbroadcast (respawn v)\nchange [level v] by (1)\nif <(level) = [4]> then\n    broadcast (next/died v)\nend\nset [level v] to [8]\nset y to (0)\nset [stopped? v] to [False]\nbroadcast (play on! v)\nhide\nbroadcast (Restart v)\n\nwhen I start as a clone\ngo to x: (0) y: (0)\ngo to [front v] layer\nset [ghost v] effect to (100)\nshow\ngo to [front v] layer\nswitch costume to (costume41 v)\nrepeat (25)\n    go to [front v] layer\n    change [ghost v] effect by (-4)\nend\nwait (1) seconds\nhide\ndelete this clone\n\nwhen I receive [last v]\ngo to [front v] layer\nshow\nset voice to (giant v)::tts\nswitch costume to (costume46 v)\nspeak [Sir, that escaper is really smart. No one in our army could stop him, but you can, sir.]::tts\nrepeat (2)\n    next costume\n    wait (0.03) seconds\nend\nrepeat (2)\n    next costume\n    wait (0.03) seconds\nend\nset voice to (tenor v)::tts\nspeak [Okay then. I WILL have to stop him..]::tts\nrepeat (2)\n    next costume\n    wait (0.03) seconds\nend\ncreate clone of (_myself_ v)\nwait (1.4) seconds\nswitch costume to (main v)\nwait (1) seconds\nnext costume\nspeak [Hey kid, Wanna escape huh?]::tts\nprevious costume\nwait (0.5) seconds\nswitch costume to (costume53 v)\nset voice to (alto v)::tts\nspeak [Hey general, don't act smart. I have a sword. I can escape anytime.]::tts\nstart sound [Low Whoosh v]\nrepeat (7)\n    next costume\n    wait (0.05) seconds\nend\nnext costume\nset voice to (tenor v)::tts\nspeak [Hey, kid, stop]::tts\nnext costume\nspeak [You can escape, but u gotta hear this first, okay?]::tts\nnext costume\nset voice to (alto v)::tts\nspeak [Okay fine, speak up]::tts\nnext costume\nset voice to (tenor v)::tts\nspeak [The door behind me is your freedom. but it is locked. Here are three keys. Only one opens the lock. I'll  ask a riddle,]::tts\nspeak [ then you can choose which key will  open the lock. Remember, you have only one  chance. If you fail, you lose your freedom.]::tts\nspeak [deal?]::tts\nstart sound [Low Whoosh v]\nswitch costume to (costume67 v)\nrepeat (5)\n    next costume\n    wait (0.09) seconds\nend\nset voice to (alto v)::tts\nspeak [Fine.]::tts\nnext costume\nspeak [But mind this: If you betray, you will face consequences.]::tts\nnext costume\nbroadcast (ek sath bolo bhai v)\nwait (1) seconds\nrepeat (3)\n    next costume\n    wait (0.06) seconds\nend\nwait (1) seconds\nset voice to (tenor v)::tts\nswitch costume to (costume76 v)\nspeak [Okay, here's the riddle.]::tts\nnext costume\nThe riddle\nbroadcast (now what kiddo? v)\n\nwait (1) seconds\n\nwhen I receive [ek sath bolo bhai v]\nset voice to (tenor v)::tts\nspeak [I understand, I won't betray you.]::tts\n\ndefine The riddle\nswitch costume to (costume77 v)\nspeak [There are these 3 keys,]::tts\nnext costume\nspeak [a]::tts\nnext costume\nspeak [b, n]::tts\nnext costume\nspeak [c.]::tts\nnext costume\nspeak [I'll tell you three statements for each.]::tts\nwait (1) seconds\nnext costume\nspeak [Two statements are false and only 1 is true.]::tts\nwait (1) seconds\nnext costume\nspeak [Statement for key a, 'This key won't open the lock']::tts\nnext costume\nspeak [Statement for key b, 'This key will open the lock']::tts\nnext costume\nspeak [Statement for key c, 'The key eh, will open the lock']::tts\nwait (1) seconds\nspeak [Now you have to decide which statement is false or true. Use your brain, Take the  key and then try your luck.]::tts\n\nwhen I receive [fir se dikhao v]\nThe riddle\nbroadcast (now what kiddo? v)\n\nwhen I receive [game over v]\nset voice to (tenor v)::tts\nswitch costume to (costume90 v)\nspeak [Sorry kid, you lose.]::tts\nswitch costume to (costume86 v)\nspeak [The key was the eh key.]::tts\nswitch costume to (costume90 v)\nspeak [You've lost your freedom...]::tts\ngo to [front v] layer\nswitch costume to (costume87 v)\nstop [all v]\n\nwhen I receive [win! v]\nset voice to (tenor v)::tts\nswitch costume to (costume90 v)\nspeak [Congrats kid! You got it right!]::tts\nswitch costume to (costume86 v)\nspeak [Now as promised, you can go home!]::tts\nswitch costume to (costume90 v)\nspeak [Hope you never get drawn in this book again...]::tts\ngo to [front v] layer\nswitch costume to (costume88 v)\nstop [all v]\n\nwhen flag clicked\nhide\nforever\n    if <<[4] < (level)> or <(level) = [4]>> then\n        broadcast (show enemy v)\n        stop [this script v]\n    end\nend\n\n@Text\n\nwhen flag clicked\nset [fade v] to [nope]\nbroadcast (Clear v)\nerase all\nType [ONCE, THERE WAS THIS] in size (1) on line (1)\nType [STICK WHO WAS LOST...] in size (1) on line (2)\nwait (1) seconds\nType [HIS FAMILY WAS OUT OF] in size (1) on line (4)\nType [THE BOOK...] in size (1) on line (5)\nwait (1) seconds\nType [HE USED TO RECEIVE] in size (1) on line (7)\nType [LETTERS FROM HIS FAMILY] in size (1) on line (8)\nwait (1) seconds\nbroadcast (show animation part 1 v)\nhide\nbroadcast (Clear v)\n\ndefine Type (text) in size (size) on line (line)\ngo to [front v] layer\nset size to ((400) * (size)) %\nhide\ngo to x: (-225) y: ((180) - (((24) * (size)) * (line)))\nset [text v] to (text)\nset [num v] to [1]\nrepeat (length of (Text))\n    if <not <(length of (Text)) < (num)>> then\n        if <not <(letter (num) of (Text)) = [ ]>> then\n            switch costume to (letter (num) of (Text))\n            if <<(letter ((num) - (1)) of (Text)) = [M]> or <<(letter ((num) - (1)) of (Text)) = [W]> or <(letter ((num) - (1)) of (Text)) = [0]>>> then\n                move ((24) * (size)) steps\n            else\n                move ((20) * (size)) steps\n            end\n            create clone of (_myself_ v)\n            start sound [text v]\n            change [num v] by (1)\n        else\n            move ((16) * (size)) steps\n            change [num v] by (1)\n        end\n    end\n    if <[220] < (x position)> then\n        go to x: (-225) y: ((y position) - ((24) * (size)))\n    end\nend\n\nwhen I start as a clone\nshow\ngo to [front v] layer\nclear graphic effects\nforever\nend\n\nwhen I receive [clear v]\ndelete this clone\n\nwhen I receive [fading v]\n\nset [fade v] to [yup]\n\nwhen I receive [show text part 1 v]\nset [fade v] to [nope]\nType [EVERYONE IN HIS FAMILY] in size (1) on line (1)\nType [WAS DRAWN TOO, BUT THEY] in size (1) on line (2)\nType [HAD ESCAPED THE BOOK] in size (1) on line (3)\nType [BEFORE HIM.] in size (1) on line (4)\nwait (1) seconds\nbroadcast (show animation part 2 v)\nbroadcast (Clear v)\n\nwhen I receive [show text part 2 v]\nType [HE DECIDED TO ESCAPE..] in size (1) on line (5)\nwait (3) seconds\nbroadcast (Clear v)\nbroadcast (fading v)\nbroadcast (end v)\n\nif <(fade) = [yup]> then\n    repeat (20)\n        change [ghost v] effect by (5)\n    end\n    broadcast (Clear v)\n    delete this clone\nelse\nend\n\nwhen I receive [stop v]\nstop [other scripts in sprite v]\nbroadcast (Clear v)\nbroadcast (end v)\nhide\n\n@black window\n\nwhen I receive [show text part 1 v]\nshow\n\nwhen I receive [show text part 2 v]\nshow\n\nwhen I receive [end v]\nhide\nbroadcast (start v)\n\nwhen I receive [stop v]\nstop [other scripts in sprite v]\n\nwhen I receive [start v]\nswitch costume to (costume1 v)\nstop [other scripts in sprite v]\nwait (2) seconds\nhide\nforever\n    play sound [Vexento - Lights v] until done\nend\n\nwhen flag clicked\nclear graphic effects\ngo to [front v] layer\nswitch costume to (costume1 v)\nshow\nforever\n    if <key (space v) pressed?> then\n        stop [other scripts in sprite v]\n        broadcast (stop v)\n        broadcast (end v)\n        hide\n        broadcast (start v)\n        stop [this script v]\n    end\nend\n\nwhen I receive [fading v]\nhide\n\n@settings\n\nwhen flag clicked\ngo to x: (-200) y: (140)\nhide\nswitch costume to (restart v)\ngo to [front v] layer\n\nwhen I start as a clone\nshow\nswitch costume to (next v)\ngo to x: (-140) y: (140)\nforever\n    if <touching (mouse-pointer v)?> then\n        set [fisheye v] effect to (20)\n        if <mouse down?> then\n            wait until <not <mouse down?>>\n            broadcast (next v)\n            wait (1) seconds\n            broadcast (respawn v)\n            change [level v] by (1)\n            if <(level) = [4]> then\n                broadcast (next/died v)\n            end\n        end\n    else\n        set [fisheye v] effect to (0)\n    end\nend\n\nwhen I receive [start v]\nshow\ncreate clone of (_myself_ v)\n\nwhen flag clicked\nforever\n    if <touching (mouse-pointer v)?> then\n        set [fisheye v] effect to (20)\n        if <mouse down?> then\n            wait until <not <mouse down?>>\n            broadcast (respawn v)\n            if <(level) = [4]> then\n                broadcast (next/died v)\n            end\n        end\n    else\n        set [fisheye v] effect to (0)\n    end\nend\n\nif <<(level) = [4]> and <(stopped?) = [True]>> then\n    hide\n    delete this clone\nelse\n    show\nend\ncreate clone of (_myself_ v)\ndelete this clone\n\nstop [this script v]\n\nwhen I receive [start v]\nforever\nend\n\n@trampoline\n\nwhen flag clicked\nforever\n    hide\n    if <(level) = [5]> then\n        go to x: (70) y: (-85)\n        show\n    end\nend\n\nwhen flag clicked\nforever\n    switch costume to (costume3 v)\n    if <touching (hitbox⛏️ v)?> then\n        switch costume to (costume2 v)\n        wait (0.2) seconds\n    end\nend\n\n@powers\n\nwhen flag clicked\nset [# v] to [0]\nset [powerups v] to [whatever]\nset [powerups? v] to [whatever]\ngo to x: (-183) y: (-152)\nhide\nswitch costume to (restart v)\ngo to [front v] layer\ncreate button(s)\n\nwhen I receive [start v]\n\nwhen I receive [start v]\nshow\nset [# v] to [0]\nforever\n    if <(costume [number v]) = [1]> then\n        if <touching (mouse-pointer v)?> then\n            set [fisheye v] effect to (5)\n            if <mouse down?> then\n                wait until <not <mouse down?>>\n                if <not <(powerups?) = [done]>> then\n                    set [# v] to (level)\n                end\n                repeat until <not <(#) = (level)>>\n                    set [-speed v] to [-1.3]\n                    hide\n                end\n                set [powerups? v] to [done]\n                set [-speed v] to [-0.7]\n                hide\n                set [# v] to [0]\n                stop [this script v]\n            end\n        else\n            set [fisheye v] effect to (0)\n        end\n    end\nend\n\nwhen I start as a clone\nshow\ngo to x: (183) y: (-152)\nset [gun? v] to [Nope]\nswitch costume to (next v)\nset [#onceagain v] to [0]\nforever\n    if <(costume [number v]) = [2]> then\n        go to [back v] layer\n        go [forward v] (4) layers\n        if <touching (mouse-pointer v)?> then\n            set [fisheye v] effect to (5)\n            if <mouse down?> then\n                wait until <not <mouse down?>>\n                if <not <(powerups) = [done]>> then\n                    set [#onceagain v] to (level)\n                end\n                repeat until <not <(#OnceAgain) = (level)>>\n                    set [gun? v] to [yup]\n                    hide\n                end\n                set [powerups v] to [done]\n                set [gun? v] to [Nope]\n                hide\n                stop [this script v]\n            end\n        else\n            set [fisheye v] effect to (0)\n        end\n    end\nend\n\ncreate clone of (_myself_ v)\nshow\n\ndefine create button(s)\ncreate clone of (_myself_ v)\n\n@ladder\n\nwhen flag clicked\nforever\n    hide\n    if <(level) = [8]> then\n        switch costume to (costume1 v)\n        show\n    end\n    if <(level) = [9]> then\n        switch costume to (costume2 v)\n        show\n    end\nend\n\n@end (phew)\n\nwhen I receive [now what kiddo? v]\ngo to [front v] layer\nswitch costume to (costume1 v)\nrepeat (4)\n    next costume\n    create clone of (_myself_ v)\nend\n\nwhen flag clicked\nhide\nset [won or lost v] to [null]\n\nwhen I start as a clone\nforever\n    if <(costume [number v]) = [2]> then\n        go to x: (-180) y: (143)\n        if <<mouse down?> and <touching (mouse-pointer v)?>> then\n            broadcast (fir se dikhao v)\n        end\n    end\n    if <(costume [number v]) = [3]> then\n        go to x: (-141) y: (-158)\n        if <<mouse down?> and <touching (mouse-pointer v)?>> then\n            set [won or lost v] to [w]\n            broadcast (WIN! v)\n        end\n    end\n    if <(costume [number v]) = [4]> then\n        go to x: (0) y: (-158)\n        if <<mouse down?> and <touching (mouse-pointer v)?>> then\n            set [won or lost v] to [l]\n            broadcast (GAME OVER v)\n            hide\n        end\n    end\n    if <(costume [number v]) = [5]> then\n        go to x: (141) y: (-158)\n        if <<mouse down?> and <touching (mouse-pointer v)?>> then\n            set [won or lost v] to [l]\n            broadcast (GAME OVER v)\n            hide\n        end\n    end\nend\n\nwhen I start as a clone\nshow\nforever\n    set [brightness v] effect to (0)\n    if <touching (mouse-pointer v)?> then\n        set [brightness v] effect to (15)\n    end\nend\n\nwhen I receive [fir se dikhao v]\ndelete this clone\n\nwhen I receive [win! v]\ndelete this clone\n\nwhen I receive [game over v]\ndelete this clone\n\n