Crazy - A Platformer v0.1

Instructions: Crazy - A Platformer\n===========================================\nWARNING!!! PRESS THE GREEN FLAG TWICE!!!\n===========================================\nArrow Keys - Move\nOther Basics - In Game\n===========================================\nThe Fire Gem has been shattered and spread across\nthe land. It needs to be put back together!\n===========================================

@Stage\n\nwhen flag clicked\nswitch backdrop to (title v)\n\nwhen I receive [play v]\nswitch backdrop to (backdrop1 v)\n\nwhen I receive [finish v]\nif <(Deaths:) = [0]> then\n    switch backdrop to (backdrop21 v)\n    wait (20) seconds\n    stop [all v]\nelse\n    switch backdrop to (backdrop20 v)\n    wait (20) seconds\n    stop [all v]\nend\n\nwhen [c v] key pressed\nif <(backdrop [number v]) = [1]> then\n    ask [Code?] and wait\n    if <(answer) = [cvx193]> then\n        play sound [Doorbell v] until done\n        broadcast (o'riaBack v)\n    else\n        play sound [incorrect v] until done\n    end\nend\n\n@startButton\n\nwhen flag clicked\ngo to x: (-5) y: (15)\nshow\n\nwhen this sprite clicked\nbroadcast (play v)\nshow variable [deaths: v]\nhide\n\nwhen I receive [story v]\nhide\n\n@?\n\nwhen flag clicked\nhide\n\ndefine Platformer engine\nif on edge, bounce\nchange [y v] by (-0.5)\nif <key (left arrow v) pressed?> then\n    change [x v] by (-1)\nend\nif <key (right arrow v) pressed?> then\n    change [x v] by (1)\nend\nset [x v] to ((x) * (0.9))\nchange x by (x)\nif <touching color (#000000)?> then\n    change y by (1)\n    if <touching color (#000000)?> then\n        change y by (1)\n        if <touching color (#000000)?> then\n            change y by (1)\n            if <touching color (#000000)?> then\n                change y by (1)\n                if <touching color (#000000)?> then\n                    change y by (1)\n                    if <touching color (#000000)?> then\n                        change y by (1)\n                        if <touching color (#000000)?> then\n                            change y by (-6)\n                            change x by ((x) * (-1))\n                            if <key (up arrow v) pressed?> then\n                                set [y v] to [10]\n                                if <(x) > [0]> then\n                                    set [x v] to [-10]\n                                else\n                                    set [x v] to [10]\n                                end\n                            else\n                                set [x v] to [0]\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\nchange y by (y)\nif <touching color (#000000)?> then\n    change y by ((y) * (-1))\n    set [y v] to [0]\nend\nchange y by (-0.5)\nif <<touching color (#000000)?> and <key (up arrow v) pressed?>> then\n    set [y v] to [10]\nend\nchange y by (0.5)\nif <touching color (#ff0000)?> then\n    if <(backdrop [number v]) = [20]> then\n        broadcast (bossFight v)\n        change [deaths: v] by (1)\n        go to x: (0) y: (-102)\n    else\n        change [deaths: v] by (1)\n        go to x: (X Spawn) y: (Y Spawn)\n    end\nend\nif <touching color (#0021ff)?> then\n    set [y v] to [16]\nend\nif <touching (lefthandhitbox v)?> then\n    set [y v] to [5]\nend\nif <touching (righthandhitbox v)?> then\n    set [y v] to [5]\nend\nif <touching (headhitbox v)?> then\n    set [y v] to [10]\nend\n\nwhen I receive [play v]\nset [y spawn v] to [-129]\nset [x spawn v] to [-218]\ngo to x: (X Spawn) y: (Y Spawn)\nshow\nset size to (50) %\nset [x v] to [0]\nset [y v] to [0]\nforever\n    Platformer engine\n    go to [front v] layer\n    point in direction (90)\nend\n\nwhen I receive [2 v]\ngo to x: (X Spawn) y: (Y Spawn)\n\nwhen I receive [3 v]\ngo to x: (X Spawn) y: (Y Spawn)\n\nwhen I receive [4 v]\ngo to x: (X Spawn) y: (Y Spawn)\n\nwhen I receive [5 v]\ngo to x: (X Spawn) y: (Y Spawn)\n\nwhen I receive [6 v]\ngo to x: (X Spawn) y: (Y Spawn)\n\nwhen I receive [7 v]\ngo to x: (X Spawn) y: (Y Spawn)\n\nwhen I receive [8 v]\ngo to x: (X Spawn) y: (Y Spawn)\n\nwhen I receive [9 v]\ngo to x: (X Spawn) y: (Y Spawn)\n\nwhen I receive [10 v]\ngo to x: (X Spawn) y: (Y Spawn)\n\nwhen I receive [11 v]\ngo to x: (X Spawn) y: (Y Spawn)\n\nwhen I receive [12 v]\ngo to x: (X Spawn) y: (Y Spawn)\n\nwhen I receive [13 v]\ngo to x: (X Spawn) y: (Y Spawn)\n\nwhen I receive [14 v]\ngo to x: (X Spawn) y: (Y Spawn)\n\nwhen I receive [15 v]\ngo to x: (X Spawn) y: (Y Spawn)\n\nwhen I receive [16 v]\ngo to x: (X Spawn) y: (Y Spawn)\n\nwhen I receive [17 v]\ngo to x: (X Spawn) y: (Y Spawn)\n\nwhen I receive [18 v]\ngo to x: (X Spawn) y: (Y Spawn)\nhide\n\nwhen I receive [bossfight v]\ngo to x: (10) y: (Y Spawn)\nhide\n\nwhen I receive [bossfight v]\nset size to (50) %\ngo to x: (0) y: (-144)\nshow\n\nwhen I receive [finish v]\nhide\n\n@gem1\n\nwhen flag clicked\nhide\n\nwhen I receive [play v]\ngo to x: (216) y: (-141)\nshow\nforever\n    if <touching (? v)?> then\n        switch backdrop to (backdrop2 v)\n        broadcast (2 v)\n    end\nend\n\nwhen I receive [2 v]\ngo to x: (216) y: (-141)\nshow\nforever\n    if <touching (? v)?> then\n        switch backdrop to (backdrop3 v)\n        broadcast (3 v)\n    end\nend\n\nwhen I receive [3 v]\ngo to x: (216) y: (-141)\nshow\nforever\n    if <touching (? v)?> then\n        switch backdrop to (backdrop4 v)\n        broadcast (4 v)\n    end\nend\n\nwhen I receive [4 v]\ngo to x: (216) y: (-141)\nshow\nforever\n    if <touching (? v)?> then\n        switch backdrop to (backdrop5 v)\n        broadcast (5 v)\n    end\nend\n\nwhen I receive [5 v]\ngo to x: (216) y: (-141)\nshow\nforever\n    if <touching (? v)?> then\n        switch backdrop to (backdrop7 v)\n        broadcast (6 v)\n    end\nend\n\nwhen I receive [6 v]\ngo to x: (216) y: (-141)\nshow\nforever\n    if <touching (? v)?> then\n        switch backdrop to (backdrop8 v)\n        broadcast (7 v)\n    end\nend\n\nwhen I receive [7 v]\ngo to x: (216) y: (-141)\nshow\nforever\n    if <touching (? v)?> then\n        switch backdrop to (backdrop9 v)\n        broadcast (8 v)\n    end\nend\n\nwhen I receive [8 v]\ngo to x: (216) y: (-141)\nshow\nforever\n    if <touching (? v)?> then\n        switch backdrop to (backdrop10 v)\n        broadcast (9 v)\n    end\nend\n\nwhen I receive [9 v]\ngo to x: (216) y: (-141)\nshow\nforever\n    if <touching (? v)?> then\n        switch backdrop to (backdrop6 v)\n        broadcast (10 v)\n    end\nend\n\nwhen I receive [10 v]\ngo to x: (216) y: (-141)\nshow\nforever\n    if <touching (? v)?> then\n        switch backdrop to (backdrop11 v)\n        broadcast (11 v)\n    end\nend\n\nwhen I receive [11 v]\ngo to x: (216) y: (-141)\nshow\nforever\n    if <touching (? v)?> then\n        switch backdrop to (backdrop12 v)\n        broadcast (12 v)\n    end\nend\n\nwhen I receive [12 v]\ngo to x: (216) y: (-141)\nshow\nforever\n    if <touching (? v)?> then\n        switch backdrop to (backdrop13 v)\n        broadcast (13 v)\n    end\nend\n\nwhen I receive [13 v]\ngo to x: (216) y: (-141)\nshow\nforever\n    if <touching (? v)?> then\n        switch backdrop to (backdrop14 v)\n        broadcast (14 v)\n    end\nend\n\nwhen I receive [14 v]\ngo to x: (216) y: (-141)\nshow\nforever\n    if <touching (? v)?> then\n        switch backdrop to (backdrop15 v)\n        broadcast (15 v)\n    end\nend\n\nwhen I receive [15 v]\ngo to x: (216) y: (-141)\nshow\nforever\n    if <touching (? v)?> then\n        switch backdrop to (backdrop16 v)\n        broadcast (16 v)\n    end\nend\n\nwhen I receive [16 v]\ngo to x: (216) y: (-141)\nshow\nforever\n    if <touching (? v)?> then\n        switch backdrop to (backdrop17 v)\n        broadcast (17 v)\n    end\nend\n\nwhen I receive [17 v]\ngo to x: (216) y: (-141)\nshow\nforever\n    if <touching (? v)?> then\n        switch backdrop to (backdrop18 v)\n        broadcast (18 v)\n    end\nend\n\nwhen I receive [18 v]\nhide\n\n@bossCutscene\n\nwhen I receive [18 v]\nset [ghost v] effect to (0)\nswitch costume to (costume1 v)\npoint in direction (90)\nhide\nwait (2) seconds\nshow\ngo to x: (0) y: (146)\nset size to (10) %\nrepeat until <(size) = [100]>\n    turn right (20) degrees\n    change size by (1)\n    change y by (-1)\nend\nswitch costume to (costume2 v)\nwait (2) seconds\nswitch costume to (costume1 v)\nrepeat (30)\n    change size by (10)\n    change y by (-4)\n    change [ghost v] effect by (3.33)\nend\nbroadcast (bossFight v)\n\nwhen I receive [bossfight v]\nhide\n\n@o'rine\n\nwhen I receive [bossfight v]\nset [hands? v] to [2]\nstop [other scripts in sprite v]\npoint in direction (90)\nswitch costume to (costume1 v)\nswitch backdrop to (backdrop19 v)\nset size to (100) %\nset [ghost v] effect to (0)\nshow\ngo to x: (0) y: (228)\nglide (3) secs to x: (0) y: (80)\n\nbroadcast (bossFight v)\n\nwhen flag clicked\nhide\n\nwhen I receive [bossstart v]\ngo to x: (0) y: (80)\nrepeat until <(hands?) = [0]>\n    repeat (5)\n        wait (0.05) seconds\n        change y by (1)\n    end\n    repeat (5)\n        wait (0.05) seconds\n        change y by (-1)\n    end\nend\ngo to x: (0) y: (80)\nbroadcast (phase2 v)\n\nwhen I receive [phase2 v]\nswitch costume to (costume1 v)\npoint in direction (90)\nrepeat (36)\n    turn right (30) degrees\n    switch costume to (pick random (1) to (2))\nend\nswitch costume to (costume2 v)\nbroadcast (finalFight v)\n\nwhen I receive [finalfight v]\nset [headattack v] to [0]\nforever\n    go to [front v] layer\n    switch costume to (costume2 v)\n    repeat until <<(headAttack) = [169]> or <<(headAttack) = [121]> or <(headAttack) = [42]>>>\n        switch costume to (pick random (1) to (2))\n        set [headattack v] to (pick random (0) to (350))\n    end\n    if <(headAttack) = [169]> then\n        switch costume to (costume3 v)\n        wait (1) seconds\n        go to x: (0) y: (80)\n        point in direction (90)\n        repeat (18)\n            turn right (10) degrees\n            change y by (-11)\n        end\n        wait (3) seconds\n        repeat (18)\n            turn right (10) degrees\n            change y by (11)\n        end\n        broadcast (finalFight v)\n    end\n    if <(headAttack) = [121]> then\n        switch costume to (costume2 v)\n        go to x: (0) y: (80)\n        repeat (10)\n            change y by (2)\n        end\n        wait (1) seconds\n        repeat (6)\n            change y by (-5)\n        end\n        broadcast (headBalls v)\n        repeat (10)\n            change y by (1)\n        end\n        wait (5) seconds\n        broadcast (finalFight v)\n    end\n    if <(headAttack) = [42]> then\n        switch costume to (costume4 v)\n        wait (2) seconds\n        broadcast (wallClose v)\n        wait (4) seconds\n        switch costume to (pick random (5) to (6))\n        if <(costume [number v]) = [5]> then\n            wait (1) seconds\n            broadcast (leftFinish v)\n        else\n            wait (1) seconds\n            broadcast (rightFinish v)\n        end\n        wait (2) seconds\n        broadcast (finalFight v)\n    end\nend\n\nwhen I receive [o'rionbeaten v]\nstop [other scripts in sprite v]\nset size to (100) %\npoint in direction (90)\nswitch costume to (costume2 v)\nglide (2) secs to x: (0) y: (0)\nwait (2) seconds\nrepeat (12)\n    turn right (15) degrees\n    change y by (10)\n    change size by (-5)\nend\nrepeat (20)\n    turn right (15) degrees\n    change y by (-7)\n    change size by (-5)\nend\nswitch costume to (costume7 v)\nrepeat (10)\n    turn left (15) degrees\n    change size by (10)\nend\nrepeat (10)\n    turn left (15) degrees\n    change size by (-10)\n    change [ghost v] effect by (10)\nend\nhide\nwait (3) seconds\nbroadcast (finish v)\n\nwhen flag clicked\nset [deaths: v] to [0]\nhide variable [deaths: v]\n\n@leftHand\n\nwhen I receive [bossfight v]\nstop [other scripts in sprite v]\nhide\nwait (4) seconds\npoint in direction (90)\ngo to (o'rine v)\nswitch costume to (costume1 v)\ngo [backward v] (2) layers\nshow\nrepeat (20)\n    change x by (7)\nend\nwait (1) seconds\nbroadcast (bossStart v)\n\nwhen flag clicked\nhide\n\nwhen I receive [bossstart v]\nif <(leftHand?) = [1]> then\n    set [lefthanddown v] to [0]\n    forever\n        go to [front v] layer\n        switch costume to (costume1 v)\n        repeat until <<(leftHandDown) = [25]> or <<(leftHandDown) = [13]> or <(leftHandDown) = [190]>>>\n            turn left (15) degrees\n            set [lefthanddown v] to (pick random (0) to (350))\n        end\n        if <(leftHandDown) = [25]> then\n            point in direction (90)\n            repeat (10)\n                change y by (1)\n            end\n            switch costume to (costume2 v)\n            wait (0.05) seconds\n            switch costume to (costume3 v)\n            repeat until <touching color (#000000)?>\n                change y by (-10)\n            end\n            change y by (5)\n            wait (2) seconds\n            glide (3) secs to x: (140) y: (80)\n            broadcast (bossStart v)\n        end\n        if <(leftHandDown) = [13]> then\n            point in direction (90)\n            switch costume to (costume4 v)\n            go to x: (140) y: (80)\n            glide (0.5) secs to x: (167) y: (104)\n            glide (0.2) secs to x: (162) y: (38)\n            glide (0.2) secs to x: (159) y: (-22)\n            glide (0.2) secs to x: (121) y: (-72)\n            glide (0.2) secs to x: (58) y: (-112)\n            glide (0.2) secs to x: (-2) y: (-124)\n            glide (0.2) secs to x: (-85) y: (-114)\n            glide (0.2) secs to x: (-154) y: (-73)\n            switch costume to (costume1 v)\n            go to [front v] layer\n            glide (3) secs to x: (140) y: (80)\n            broadcast (bossStart v)\n        end\n        if <(leftHandDown) = [190]> then\n            point in direction (90)\n            switch costume to (costume5 v)\n            go to x: (140) y: (80)\n            glide (1) secs to x: (196) y: (80)\n            glide (1) secs to x: (126) y: (80)\n            broadcast (fireDrop v)\n            glide (1) secs to x: (-4) y: (80)\n            broadcast (fireDrop v)\n            glide (1) secs to x: (-148) y: (80)\n            broadcast (fireDrop v)\n            glide (3) secs to x: (140) y: (80)\n            broadcast (bossStart v)\n        end\n    end\nelse\n    set [lefthand? v] to [0]\n    hide\nend\n\nbroadcast (bossFight v)\nset [lefthand? v] to [1]\n\nset [lefthand? v] to [0]\n\nwhen I receive [lefthandgone v]\nstop [other scripts in sprite v]\npoint in direction (90)\nrepeat (20)\n    wait (0.01) seconds\n    switch costume to (pick random (6) to (15))\nend\nhide\nchange [hands? v] by (-1)\n\nwhen I receive [bossfight v]\nset [hands? v] to [2]\n\n@fireLeft\n\nwhen I receive [firedrop v]\nwait (0.1) seconds\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nshow\ngo to (lefthand v)\nrepeat until <touching color (#000000)?>\n    change y by (-10)\n    next costume\nend\nrepeat (30)\n    wait (0.1) seconds\n    next costume\nend\ndelete this clone\n\nwhen I receive [bossstart v]\ndelete this clone\n\nwhen I receive [bossfight v]\ndelete this clone\n\n@rightHand\n\nwhen I receive [bossfight v]\nstop [other scripts in sprite v]\nhide\nwait (4) seconds\npoint in direction (90)\ngo to (o'rine v)\nswitch costume to (costume1 v)\ngo [backward v] (2) layers\nshow\nrepeat (20)\n    change x by (-7)\nend\nwait (1) seconds\nbroadcast (bossStart2 v)\n\nwhen flag clicked\nhide\n\nwhen I receive [bossstart2 v]\nif <(leftHand?) = [1]> then\n    set [righthanddown v] to [0]\n    forever\n        go to [front v] layer\n        switch costume to (costume1 v)\n        repeat until <<(rightHandDown) = [25]> or <<(rightHandDown) = [13]> or <(rightHandDown) = [190]>>>\n            turn left (-15) degrees\n            set [righthanddown v] to (pick random (0) to (350))\n        end\n        if <(rightHandDown) = [25]> then\n            point in direction (90)\n            repeat (10)\n                change y by (1)\n            end\n            switch costume to (costume2 v)\n            wait (0.05) seconds\n            switch costume to (costume3 v)\n            repeat until <touching color (#000000)?>\n                change y by (-10)\n            end\n            change y by (5)\n            wait (2) seconds\n            glide (3) secs to x: (-140) y: (80)\n            broadcast (bossStart2 v)\n        end\n        if <(rightHandDown) = [13]> then\n            point in direction (90)\n            switch costume to (costume4 v)\n            go to x: (-140) y: (80)\n            glide (0.5) secs to x: (-167) y: (104)\n            glide (0.2) secs to x: (-162) y: (38)\n            glide (0.2) secs to x: (-159) y: (-22)\n            glide (0.2) secs to x: (-121) y: (-72)\n            glide (0.2) secs to x: (-58) y: (-112)\n            glide (0.2) secs to x: (2) y: (-124)\n            glide (0.2) secs to x: (85) y: (-114)\n            glide (0.2) secs to x: (154) y: (-73)\n            switch costume to (costume1 v)\n            go to [front v] layer\n            glide (3) secs to x: (-140) y: (80)\n            broadcast (bossStart2 v)\n        end\n        if <(rightHandDown) = [190]> then\n            point in direction (90)\n            switch costume to (costume5 v)\n            go to x: (-140) y: (80)\n            glide (1) secs to x: (-196) y: (80)\n            glide (1) secs to x: (-126) y: (80)\n            broadcast (fireDrop2 v)\n            glide (1) secs to x: (4) y: (80)\n            broadcast (fireDrop2 v)\n            glide (1) secs to x: (148) y: (80)\n            broadcast (fireDrop2 v)\n            glide (3) secs to x: (-140) y: (80)\n            broadcast (bossStart2 v)\n        end\n    end\nelse\n    set [righthand? v] to [0]\n    hide\nend\n\nbroadcast (bossFight v)\nset [lefthand? v] to [1]\n\nset [lefthand? v] to [0]\n\nwhen I receive [righthandgone v]\nstop [other scripts in sprite v]\npoint in direction (90)\nrepeat (20)\n    wait (0.01) seconds\n    switch costume to (pick random (6) to (15))\nend\nhide\nchange [hands? v] by (-1)\n\n@fireRight\n\nwhen I receive [firedrop2 v]\nwait (0.1) seconds\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nshow\ngo to (righthand v)\nrepeat until <touching color (#000000)?>\n    change y by (-10)\n    next costume\nend\nrepeat (30)\n    wait (0.1) seconds\n    next costume\nend\ndelete this clone\n\nwhen I receive [bossstart2 v]\ndelete this clone\n\nwhen I receive [bossfight v]\ndelete this clone\n\n@leftHandHitBox\n\nwhen flag clicked\nhide\n\nwhen I receive [bossstart v]\nshow\nset [ghost v] effect to (100)\nforever\n    go to (lefthand v)\nend\n\nwhen I receive [bossstart v]\nforever\n    if <touching (? v)?> then\n        wait (0.01) seconds\n        hide\n        wait (2) seconds\n        show\n        change [lefthandhealth v] by (-1)\n    end\n    if <(leftHandHealth) = [0]> then\n        broadcast (leftHandGone v)\n        hide\n        stop [this script v]\n    end\nend\n\nwhen I receive [bossfight v]\nset [lefthandhealth v] to [3]\n\n@rightHandHitBox\n\nwhen flag clicked\nhide\n\nwhen I receive [bossstart v]\nshow\nset [ghost v] effect to (100)\nforever\n    go to (righthand v)\nend\n\nwhen I receive [bossstart v]\nforever\n    if <touching (? v)?> then\n        wait (0.01) seconds\n        hide\n        wait (2) seconds\n        show\n        change [righthandhealth v] by (-1)\n    end\n    if <(rightHandHealth) = [0]> then\n        broadcast (rightHandGone v)\n        hide\n        stop [this script v]\n    end\nend\n\nwhen I receive [bossfight v]\nset [righthandhealth v] to [3]\n\n@headBall\n\nwhen flag clicked\nhide\n\nwhen I receive [headballs v]\nset size to (100) %\nshow\ngo to (o'rine v)\nrepeat (175)\n    point towards (? v)\n    move (5) steps\nend\nrepeat (10)\n    change size by (-10)\nend\nhide\nbroadcast (finalFight v)\n\nwhen I receive [bossfight v]\nhide\n\n@walls\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\n\nwhen I receive [wallclose v]\ngo to x: (0) y: (0)\nswitch costume to (costume1 v)\ngo to [front v] layer\nshow\nrepeat (3)\n    wait (0.05) seconds\n    next costume\nend\n\nwhen I receive [leftfinish v]\ngo to x: (0) y: (0)\nswitch costume to (costume5 v)\nwait (2) seconds\nhide\n\nwhen I receive [rightfinish v]\ngo to x: (0) y: (0)\nswitch costume to (costume6 v)\nwait (2) seconds\nhide\n\nwhen I receive [bossfight v]\nhide\n\n@headHitBox\n\nwhen flag clicked\nhide\n\nwhen I receive [finalfight v]\nshow\nset [ghost v] effect to (100)\nforever\n    go to (o'rine v)\nend\n\nwhen I receive [bossstart v]\nforever\n    if <touching (? v)?> then\n        wait (0.01) seconds\n        hide\n        wait (2) seconds\n        show\n        change [headhelth v] by (-1)\n    end\n    if <(headHelth) = [0]> then\n        broadcast (o'rionBeaten v)\n        hide\n        stop [this script v]\n    end\nend\n\nwhen I receive [bossfight v]\nset [headhelth v] to [3]\n\n@storyButton\n\nwhen flag clicked\ngo to x: (-5) y: (-100)\nhide\n\nwhen this sprite clicked\nbroadcast (story v)\nswitch backdrop to (backdrop22 v)\nhide\n\nwhen I receive [play v]\nhide\n\nwhen I receive [o'riaback v]\nshow\n\nwhen I receive [story v]\nwait (30) seconds\nstop [all v]\n\n@thumbnail\n\nwhen flag clicked\nforever\n    go to x: (0) y: (0)\n    set [ghost v] effect to (100)\n    show\n    go to [front v] layer\nend\n\n