Blue Cube (Platformer)

Instructions: -Cách chơi: Nhấn các phím mũi tên để di chuyển.\nNhấp vào lá cờ để chơi.\n

@Stage\n\nwhen I receive [start v]\nswitch backdrop to (blue sky 2  v)\n\nwhen flag clicked\nswitch backdrop to (backdrop1 v)\n\nwhen I receive [music v]\nif <(volume) = [100]> then\n    set volume to (0) %\nelse\n    set volume to (100) %\nend\n\nwhen flag clicked\nforever\n    play sound [TevoOriginalMix-Vexento-4515378 v] until done\n    play sound [We Are One - Vexento_ Micco \[128kbps_MP3\] \(1\) v] until done\n    play sound [bensound-adventure v] until done\nend\n\n@Blue Cube\n\nwhen I start as a clone\npoint in direction (90)\nswitch costume to (pick random (3) to (5))\nset size to (120) %\nset [ghost v] effect to (0)\nrepeat (10)\n    turn right (5) degrees\n    change [ghost v] effect by (10)\n    change size by (-10)\nend\ndelete this clone\n\nwhen I receive [start v]\npoint in direction (90)\nshow\nforever\n    change [y velocity v] by (-0.5)\n    if <<key (right arrow v) pressed?> or <<key (d v) pressed?> or <<mouse down?> and <(mouse x) > (x position)>>>> then\n        switch costume to (costume1 v)\n        point in direction (90)\n        change [x velocity v] by (0.9)\n    end\n    if <<key (left arrow v) pressed?> or <<key (a v) pressed?> or <<mouse down?> and <(mouse x) < (x position)>>>> then\n        point in direction (-90)\n        change [x velocity v] by (-0.9)\n    end\n    set [x velocity v] to ((X Velocity) * (0.9))\n    change x by (X Velocity)\n    if <touching (platformer v)?> then\n        change y by (1)\n        if <touching (platformer v)?> then\n            change y by (1)\n            if <touching (platformer v)?> then\n                change y by (1)\n                if <touching (platformer v)?> then\n                    change y by (1)\n                    if <touching (platformer v)?> then\n                        change y by (1)\n                        if <touching (platformer v)?> then\n                            change x by ((X Velocity) * (-1))\n                            change x by (-1)\n                            change y by (-5)\n                            change x by (1)\n                            if <<key (up arrow v) pressed?> or <<key (w v) pressed?> or <<mouse down?> and <(mouse y) > (y position)>>>> then\n                                if <(X Velocity) > [0]> then\n                                    set [x velocity v] to [-6.5]\n                                else\n                                    set [x velocity v] to [6.5]\n                                end\n                                set [y velocity v] to [7]\n                            else\n                                set [x velocity v] to [0]\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change y by (Y Velocity)\n    if <touching (platformer v)?> then\n        change y by ((Y Velocity) * (-1))\n        set [y velocity v] to [0]\n    end\n    change y by (-1)\n    if <touching (platformer v)?> then\n        if <<key (up arrow v) pressed?> or <<key (w v) pressed?> or <<mouse down?> and <(mouse y) > (y position)>>>> then\n            set [y velocity v] to [7]\n        end\n    end\n    change y by (1)\nend\n\nwhen I receive [start v]\nforever\n    if <<(x position) = [235]> or <(x position) > [235]>> then\n        broadcast (Lever s v)\n        broadcast (Next Level v)\n        start sound [Magic Spell v]\n        go to x: (-210) y: (0)\n    end\n    if <<(y position) = [-180]> or <(y position) < [-180]>> then\n        broadcast (Lever s v)\n        broadcast (Next Level v)\n        start sound [Magic Spell v]\n        go to x: (-210) y: (0)\n    end\nend\n\nwhen I receive [start v]\ngo to [front v] layer\ngo to x: (-210) y: (0)\nswitch costume to (costume1 v)\nset size to (150) %\nset [x velocity v] to [0]\nset [y velocity v] to [0]\n\nwhen I receive [start v]\nforever\n    if <<touching color (#c80404)?> or <touching color (#ff0000)?>> then\n        go to x: (-210) y: (0)\n    end\nend\n\nwhen I receive [start v]\nforever\n    create clone of (_myself_ v)\n    wait (.025) seconds\nend\n\nwhen I receive [start v]\nset size to (150) %\nforever\n    clear graphic effects\nend\n\nwhen I receive [start v]\nforever\n    if <touching (springs v)?> then\n        set [y velocity v] to [13.5]\n    end\nend\n\nwhen flag clicked\nhide\n\n@Platformer\n\nwhen I receive [next level v]\nchange [level v] by (1)\n\nwhen I receive [start v]\ngo to [front v] layer\nset [level v] to [1]\ngo [forward v] (3) layers\nshow\ngo to x: (0) y: (0)\nforever\n    switch costume to (Level)\nend\n\nwhen flag clicked\nhide\n\n@The scene\n\nwhen I receive [lever s v]\nchange [level s v] by (1)\n\nwhen I receive [start v]\ngo to [back v] layer\ngo [forward v] (2) layers\nset [level s v] to [1]\nshow\ngo to x: (0) y: (0)\nforever\n    switch costume to (Level s)\nend\n\nwhen flag clicked\nhide\n\n@Clouds\n\nwhen I start as a clone\ngo to [back v] layer\ngo [forward v] (1) layers\nshow\nswitch costume to (pick random (1) to (3))\nset size to (pick random (90) to (100)) %\nset [ghost v] effect to (pick random (20) to (40))\nset y to (pick random (95) to (180))\nset x to (320)\nshow\nrepeat until <<(x position) = [-300]> or <(x position) < [-300]>>\n    change x by (-1.2)\nend\ndelete this clone\n\nwhen [timer v] > (.01)\nbroadcast (Stop v)\n\nwhen I receive [stop v]\nforever\n    reset timer\nend\n\nwhen flag clicked\nshow\n\nwhen flag clicked\nforever\n    reset timer\nend\n\nwhen flag clicked\nhide\nforever\n    create clone of (_myself_ v)\n    wait (13) seconds\nend\n\n@Thumbnail\n\nwhen flag clicked\ngo to x: (0) y: (0)\nshow\nset [ghost v] effect to (100)\nforever\n    go to [front v] layer\nend\n\n@springs\n\nwhen I receive [start v]\nforever\n    go to [front v] layer\n    if <touching (blue cube v)?> then\n        switch costume to (costume1 v)\n        repeat (6)\n            next costume\n        end\n        repeat (6)\n            switch costume to ((costume [number v]) - (1))\n        end\n    end\nend\n\nwhen I receive [start v]\nhide\nwait until <(Level) = [6]>\nshow\ngo to x: (-3) y: (-92)\nwait until <(Level) = [7]>\nhide\nwait until <(Level) = [10]>\nshow\ngo to x: (40) y: (-107)\nwait until <(Level) = [11]>\nhide\ngo to x: (40) y: (-107)\n\nwhen flag clicked\nhide\n\n@Let\n\ngo to [back v] layer\n\nwhen I receive [start v]\nhide\nwait until <<(Level) = [10]> or <(Level) = [11]>>\nshow\ngo [forward v] (4) layers\nrepeat until <(Level) = [12]>\n    go to (blue cube v)\nend\nhide\n\nwhen flag clicked\nhide\n\n@Button\n\nwhen flag clicked\ngo to x: (0) y: (-110)\nshow\nset [ghost v] effect to (100)\ngo to [front v] layer\nforever\n    if <touching (mouse-pointer v)?> then\n        change size by (((120) - (size)) / (3))\n        set [ghost v] effect to (20)\n        point in direction (([sin v] of ((timer) * (1000)) ) + (93))\n        if <mouse down?> then\n            broadcast (Start v)\n            start sound [A Bass v]\n            stop [other scripts in sprite v]\n            repeat until <(size) < [5]>\n                change size by (((size) - (140)) / (10))\n            end\n        end\n    else\n        point in direction (90)\n        change size by (((100) - (size)) / (3))\n        set [ghost v] effect to (-10)\n    end\nend\n\nwhen flag clicked\nset size to (4) %\nrepeat until <(size) > [99]>\n    change size by (((100) - (size)) / (10))\nend\n\nwhen flag clicked\nforever\n\nwhen I receive [start v]\n\n@logo\n\nwhen flag clicked\npoint in direction (90)\nset size to (0) %\nshow\ngo to x: (0) y: (40)\nrepeat (30)\n    change size by (3.333)\nend\nforever\nend\n\nwhen I receive [start v]\nrepeat (10)\n    change size by (-10)\nend\nhide\n\nchange size by (5)\nwait (0.1) seconds\nchange size by (-5)\n\n@Sprite1\n\nwhen I receive [start v]\nset [score v] to [0]\nforever\n    wait (1) seconds\n    change [score v] by (1)\nend\n\nwhen flag clicked\nhide variable [score v]\n\n@Sprite2\n\n@number\n\ndefine print\nshow\nbroadcast (click v)\ngo to x: (-220) y: (-162)\nset [element v] to [1]\nrepeat (length of (Score))\n    switch costume to (letter (element) of (Score))\n    change x by (19)\n    change [element v] by (1)\n    create clone of (_myself_ v)\nend\n\nwhen I receive [click v]\nchange [digit v] by (1)\nforever\n    delete this clone\nend\n\nwhen I receive [start v]\ngo to [front v] layer\nset [score v] to [0]\nhide\nforever\n    print\nend\n\n@Sun k\n\nwhen flag clicked\nhide\n\nwhen I start as a clone\nswitch costume to (costume2 v)\nforever\n    turn right (0.5) degrees\nend\n\nwhen I receive [start v]\nshow\npoint in direction (90)\ngo to [back v] layer\ncreate clone of (_myself_ v)\ngo to x: (227) y: (158)\nswitch costume to (costume1 v)\nforever\n    turn right (0.5) degrees\nend\n\n@Sprite3\n\n