Sᴜɴɴʏ Dᴀʏ【Platformer/プラットフォーマー】

Instructions: MUSIC\nnumber 2\nWelcome to Wings of fire platformer (number 2)\n(you don't need to read the book to play this.)\nIn this game, you will have to find the mud kingdom to find Clay's parents (the 2nd part of the book: the dragonet prophecy (book 1).) You can change dragonets by pressing 1,2,3,4,5,46.\n\n1:Clay\n2:Tsunami\n3:Sunny\n4:Glory\n5:Starflight\n6:Peril\nEach dragonet will have a unique power:\nClay: invulnerable to lava or fire,\nTsunami: can swim in water\nSunny: can squeeze into tiny places\nGlory: Becomes camouflaged:(enemy can't see her)\nStarflight: can see in the dark\nPeril: burns wood and trees when touches them\nFor Sunny and Glory, hold "z" to activate the power.\n\nBut most importantly:\nHAVE FUN!\n\n

@Stage\n\nwhen flag clicked\nswitch backdrop to (backdrop2 v)\n\nwhen I receive [end v]\nswitch backdrop to (backdrop2 v)\n\nwhen I receive [start v]\nswitch backdrop to (backdrop1 v)\n\n@Thumbnail\n\nwhen flag clicked\nhide\nforever\n    reset timer\nend\n\nwhen [timer v] > (0.1)\ngo to [front v] layer\nshow\nstop [all v]\n\n@Player\n\nwhen flag clicked\nhide\n\ndefine Touch Ground <up?>\nchange [falling? v] by (1)\nrepeat until <not <touching (ground v)?>>\n    if <up?> then\n        change y by (-1)\n    else\n        change y by (1)\n        set [falling? v] to [0]\n    end\n    set [speed y v] to [0]\nend\n\ndefine Walk (direction) (speed)\npoint in direction (direction)\nchange x by (speed)\nset [slope v] to [0]\nrepeat until <<(Slope) = [8]> or <not <touching (ground v)?>>>\n    change y by (1)\n    change [slope v] by (1)\nend\nif <(Slope) = [8]> then\n    change x by ((0) - (speed))\n    change y by ((0) - (Slope))\nend\nchange [frame v] by (0.5)\n\ndefine Set Costume\nif <(Falling?) < [3]> then\n    if <(Frame) = [0]> then\n        switch costume to (costume1 v)\n    else\n        switch costume to ([floor v] of ((4) + ((Frame) mod (7))) )\n    end\nelse\n    if <(Speed Y) > [0]> then\n        switch costume to (jump v)\n    else\n        switch costume to (fall v)\n    end\nend\n\nrepeat (10)\n    change [ghost v] effect by (10)\nend\n\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\n\nwhen I receive [start v]\npoint in direction (90)\ngo to x: (-226) y: (0)\nshow\nset [falling? v] to [0]\nset [speed y v] to [0]\nset rotation style [left-right v]\ngo to [front v] layer\ngo [backward v] (1) layers\nforever\n    switch costume to (hitbox v)\n    change y by (Speed Y)\n    if <<(Falling?) < [4]> or <<key (w v) pressed?> or <key (up arrow v) pressed?>>> then\n        change [speed y v] by (-1)\n    else\n        change [speed y v] by (-2)\n    end\n    Touch Ground <(Speed Y) > [1]>\n    if <<key (a v) pressed?> or <key (left arrow v) pressed?>> then\n        Walk [-90] [-6]\n    else\n        if <<key (d v) pressed?> or <key (right arrow v) pressed?>> then\n            Walk [90] [6]\n        else\n            set [frame v] to [0]\n        end\n    end\n    if <<key (w v) pressed?> or <key (up arrow v) pressed?>> then\n        if <<(Jump Key) = [0]> and <(Falling?) < [3]>> then\n            set [speed y v] to [12]\n            set [jump key v] to [1]\n            set [falling? v] to [6]\n        end\n    else\n        set [jump key v] to [0]\n    end\n    if <<(x position) > [237]> or <key (p v) pressed?>> then\n        point in direction (90)\n        go to x: (-226) y: (-100)\n        broadcast (Next level v)\n        if <(Level) > [21]> then\n            broadcast (End v)\n            stop [other scripts in sprite v]\n            stop [this script v]\n        else\n            if <key (p v) pressed?> then\n                switch costume to (costume1 v)\n                wait until <not <key (p v) pressed?>>\n            end\n        end\n    end\n    if <<touching (bad v)?> or <touching (moving bad v)?>> then\n        point in direction (90)\n        go to x: (-226) y: (-100)\n    end\n    Set Costume\nend\n\nwhen I receive [start v]\nforever\n    play sound [The Storm - Strange I and II Soundtrack v] until done\n    wait (0.01) seconds\n    play sound [The Storm \(Reprise\) - Strange I and II Soundtrack v] until done\n    wait (1) seconds\nend\n\n@Ground\n\nwhen flag clicked\nhide\n\nwhen I receive [next level v]\nif <(Level) > [3]> then\n    next costume\nend\n\nwhen I receive [end v]\nstop [other scripts in sprite v]\nhide\n\nwhen I receive [start v]\nswitch costume to (1-3 v)\nset [level v] to [0]\nshow\nbroadcast (Next level v)\n\n@Effects\n\nwhen I receive [next level v]\nnext costume\n\ngo [backward v] (1) layers\n\nwhen flag clicked\nhide\n\ngo to [back v] layer\n\nwhen I receive [end v]\nstop [other scripts in sprite v]\nhide\n\nwhen I receive [start v]\nswitch costume to (1 v)\nswitch costume to ((costume [number v]) - (1))\nshow\n\n@Text\n\nwhen I receive [next level v]\nchange [level v] by (1)\nif <<(Level) = [1]> or <<(Level) = [2]> or <<(Level) = [3]> or <<(Level) = [9]> or <<(Level) = [10]> or <<(Level) = [11]> or <<(Level) = [12]> or <<(Level) = [13]> or <<(Level) = [16]> or <<(Level) = [17]> or <<(Level) = [18]> or <(Level) = [19]>>>>>>>>>>>> then\n    forever\n        switch costume to (join [Level] (Level))\n        if <touching (player v)?> then\n            set [ghost v] effect to (100)\n        else\n            show\n            if <([x position v] of [player v]) < [-20]> then\n                set [ghost v] effect to ((-1) * ([x position v] of [player v]))\n            else\n                if <([x position v] of [player v]) > [20]> then\n                    set [ghost v] effect to ([x position v] of [player v])\n                else\n                    set [ghost v] effect to (0)\n                end\n            end\n        end\n    end\nelse\n    hide\nend\n\nwhen I receive [end v]\nstop [other scripts in sprite v]\nhide\n\nwhen flag clicked\nhide\n\ngo [forward v] (1) layers\n\ngo to [front v] layer\n\n@Bad\n\nwhen I receive [next level v]\nif <(Level) > [3]> then\n    forever\n        switch costume to (join [Level] (Level))\n        show\n    end\nelse\n    hide\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [end v]\nstop [other scripts in sprite v]\nhide\n\n@Moving Bad\n\nwhen flag clicked\nhide\n\nwhen I start as a clone\nshow\ngo to x: (0) y: (250)\nchange y by (60)\nif <(Level) = [8]> then\n    repeat (200)\n        change y by (-5)\n    end\n    delete this clone\nelse\n    delete this clone\nend\n\nwhen I receive [next level v]\ndelete this clone\n\nwhen I receive [start v]\ngo to x: (0) y: (0)\nforever\n    switch costume to (join [Level] (Level))\n    if <(Level) = [8]> then\n        hide\n        repeat until <not <(Level) = [8]>>\n            create clone of (_myself_ v)\n            wait (3.1) seconds\n        end\n    else\n        hide\n        delete this clone\n    end\nend\n\n@Cut-scene\n\nwhen I receive [end v]\nset [ghost v] effect to (100)\ngo to [front v] layer\nswitch costume to (clouds1 v)\nshow\nwait (1) seconds\nrepeat (20)\n    change [ghost v] effect by (-5)\nend\nwait (0.5) seconds\nrepeat until <(costume [number v]) = [5]>\n    next costume\n    wait (0.04) seconds\nend\nwait (0.8) seconds\nswitch costume to (buildingview1 v)\nwait (1) seconds\nrepeat until <(costume [number v]) = [9]>\n    next costume\n    wait (0.01) seconds\nend\nwait (0.4) seconds\nrepeat until <(costume [number v]) = [14]>\n    next costume\n    wait (0.001) seconds\nend\nwait (2.5) seconds\nrepeat until <(costume [number v]) = [19]>\n    next costume\n    wait (0.001) seconds\nend\nwait (0.4) seconds\nswitch costume to (lightningrod1 v)\nrepeat until <(costume [number v]) = [40]>\n    next costume\n    wait (0.025) seconds\nend\nswitch costume to (climbtower1 v)\nwait (0.1) seconds\nrepeat until <(costume [number v]) = [44]>\n    next costume\n    wait (0.035) seconds\nend\nwait (0.2) seconds\nrepeat until <(costume [number v]) = [48]>\n    next costume\n    wait (0.035) seconds\nend\nwait (0.4) seconds\nswitch costume to (reachinghand1 v)\nrepeat until <(costume [number v]) = [61]>\n    next costume\n    wait (0.03) seconds\nend\nwait (1) seconds\nswitch costume to (placingrod1 v)\nrepeat until <(costume [number v]) = [75]>\n    next costume\n    wait (0.03) seconds\nend\nwait (1) seconds\nswitch costume to (rodstruck1 v)\nwait (1) seconds\nrepeat until <(costume [number v]) = [79]>\n    next costume\n    wait (0.05) seconds\nend\nwait (0.6) seconds\nrepeat until <(costume [number v]) = [83]>\n    next costume\n    wait (0.06) seconds\nend\nwait (0.6) seconds\nrepeat until <(costume [number v]) = [100]>\n    next costume\n    wait (0.06) seconds\nend\nswitch costume to (closeup1 v)\nwait (0.5) seconds\nrepeat until <(costume [number v]) = [106]>\n    next costume\n    wait (0.001) seconds\nend\nwait (2) seconds\nrepeat until <(costume [number v]) = [111]>\n    next costume\n    wait (0.001) seconds\nend\nwait (0.6) seconds\nswitch costume to (rootsshrinking1 v)\nwait (0.3) seconds\nrepeat until <(costume [number v]) = [123]>\n    next costume\n    wait (0.03) seconds\nend\nwait (0.6) seconds\nswitch costume to (rootsgrableg1 v)\nwait (0.3) seconds\nrepeat until <(costume [number v]) = [141]>\n    next costume\n    wait (0.03) seconds\nend\nwait (0.3) seconds\nswitch costume to (pulledunder1 v)\nwait (0.7) seconds\nrepeat until <(costume [number v]) = [147]>\n    next costume\nend\nswitch costume to (underground1 v)\nrepeat until <(costume [number v]) = [173]>\n    next costume\n    wait (0.02) seconds\nend\nwait (1) seconds\nstop [all v]\n\nwhen flag clicked\nhide\nset [ghost v] effect to (100)\ngo to [front v] layer\nswitch costume to (building1 v)\nshow\nwait (1) seconds\nrepeat (20)\n    change [ghost v] effect by (-5)\nend\nwait (0.5) seconds\nrepeat until <(costume [number v]) = [187]>\n    next costume\n    wait (0.04) seconds\nend\nwait (1) seconds\nhide\nbroadcast (Start v)\n\n