Platformer Tutorial - Super Easy!


@Stage\n\ndefine Set Up X Spawn\ndelete all of [x spawn v]\nadd [-205] to [x spawn v]\nadd [-220] to [x spawn v]\nadd [-30] to [x spawn v]\nadd [-205] to [x spawn v]\nadd [-200] to [x spawn v]\nadd [-198] to [x spawn v]\nadd [-150] to [x spawn v]\nadd [-150] to [x spawn v]\nadd [-150] to [x spawn v]\nadd [-150] to [x spawn v]\nadd [-150] to [x spawn v]\nadd [-175] to [x spawn v]\nadd [-175] to [x spawn v]\nadd [-175] to [x spawn v]\nadd [-175] to [x spawn v]\nadd [-105] to [x spawn v]\nadd [-165] to [x spawn v]\nadd [0] to [x spawn v]\nadd [-100] to [x spawn v]\nadd [-185] to [x spawn v]\n\ndefine Set Up Y Spawn\ndelete all of [y spawn v]\nadd [15] to [y spawn v]\nadd [15] to [y spawn v]\nadd [15] to [y spawn v]\nadd [-160] to [y spawn v]\nadd [-40] to [y spawn v]\nadd [-40] to [y spawn v]\nadd [-15] to [y spawn v]\nadd [-160] to [y spawn v]\nadd [-160] to [y spawn v]\nadd [0] to [y spawn v]\nadd [0] to [y spawn v]\nadd [0] to [y spawn v]\nadd [-150] to [y spawn v]\nadd [-50] to [y spawn v]\nadd [-50] to [y spawn v]\nadd [120] to [y spawn v]\nadd [-50] to [y spawn v]\nadd [-100] to [y spawn v]\nadd [100] to [y spawn v]\nadd [-153] to [y spawn v]\n\nwhen I receive [start v]\nshow variable [level v]\n\nwhen flag clicked\nset [level v] to [1]\nhide variable [level v]\nSet Up X Spawn\nSet Up Y Spawn\n\nwhen flag clicked\nwait until <(Level) > [20]>\nbroadcast (End v)\n\n@Intro\n\ndefine Set Up\npoint in direction (90)\nclear graphic effects\nshow\ngo to x: (0) y: (0)\nset size to (100) %\n\nwhen flag clicked\nSet Up\nIN\nwait (1) seconds\nOUT\nbroadcast (Start v)\n\ndefine OUT\nrepeat (10)\n    turn right ((3.45) - ((direction) * (0.2))) degrees\n    change size by ((-2) - ((size) / (5)))\n    change [ghost v] effect by (10)\nend\nhide\npoint in direction (90)\n\ndefine IN\ngo to x: (0) y: (-180)\nset size to (1) %\nset [ghost v] effect to (100)\nrepeat (25)\n    change y by (((0) - (y position)) * (0.25))\n    change size by (((100) - (size)) * (0.25))\n    change [ghost v] effect by (-10)\nend\n\n@Thumbnail\n\nwhen flag clicked\nswitch costume to (sfondo v)\nset [counter v] to [0]\nhide variable [counter v]\nclear graphic effects\ngo to x: (0) y: (0)\nhide\nforever\n    go to [front v] layer\n    set [counter v] to ((timer) + (0.5))\nend\n\nwhen [timer v] > (Counter)\nhide variable [level v]\nset [ghost v] effect to (100)\nshow\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\n\nwhen I receive [end v]\nhide variable [level v]\nset [ghost v] effect to (100)\nshow\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\n\n@Player\n\nwhen flag clicked\nset [deaths v] to [0]\nset size to (100) %\nhide\n\nwhen I receive [start v]\nclear graphic effects\ngo to x: (item (Level) of [x spawn v]) y: (item (Level) of [y spawn v])\nset [ghost v] effect to (100)\nshow\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nforever\n    change [y v] by (-0.5)\n    if <<key (d v) pressed?> or <key (right arrow v) pressed?>> then\n        change [x v] by (0.75)\n    end\n    if <<key (a v) pressed?> or <key (left arrow v) pressed?>> then\n        change [x v] by (-0.75)\n    end\n    set [x v] to ((x) * (0.9))\n    change x by (x)\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 (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 (w v) pressed?> or <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\n                    end\n                end\n            end\n        end\n    end\n    change y by (y)\n    if <touching color (#000000)?> then\n        change y by ((y) * (-1))\n        set [y v] to [0]\n    end\n    change y by (-0.5)\n    if <<touching color (#000000)?> and <<key (w v) pressed?> or <key (up arrow v) pressed?>>> then\n        set [y v] to [10]\n    end\n    change y by (0.5)\n    if <touching color (#ff0000)?> then\n        change [deaths v] by (1)\n        repeat (15)\n            change [ghost v] effect by ((100) / (15))\n        end\n        set [x v] to [0]\n        set [y v] to [0]\n        go to x: (item (Level) of [x spawn v]) y: (item (Level) of [y spawn v])\n        repeat (10)\n            change [ghost v] effect by (-10)\n        end\n    end\n    if <touching (_edge_ v)?> then\n        broadcast (next level v)\n    end\nend\n\nwhen I receive [next level v]\nchange [level v] by (1)\nset [x v] to [0]\nset [y v] to [0]\ngo to x: (item (Level) of [x spawn v]) y: (item (Level) of [y spawn v])\n\nwhen I receive [end v]\nstop [other scripts in sprite v]\n\n@Levels\n\nwhen flag clicked\nswitch costume to (level 1 v)\ngo to x: (0) y: (0)\nhide\n\nwhen I receive [start v]\nclear graphic effects\nset [ghost v] effect to (100)\nshow\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nforever\n    switch costume to (Level)\nend\n\nwhen I receive [end v]\nstop [other scripts in sprite v]\n\n@SQPDj\n\nwhen flag clicked\nset [i v] to [0]\nhide variable [random v]\nhide variable [i v]\nshow list [bruno mars v]\nshow list [songs queue v]\nSet Playlist\nPlay\n\ndefine Set Playlist\ndelete all of [songs queue v]\nrepeat (length of [bruno mars v])\n    set [random v] to (pick random (1) to (length of [bruno mars v]))\n    repeat until <not <[songs queue v] contains (Random)?>>\n        set [random v] to (pick random (1) to (length of [bruno mars v]))\n    end\n    add (Random) to [songs queue v]\nend\n\nwhen flag clicked\nforever\n    if <key (n v) pressed?> then\n        stop all sounds\n        stop [other scripts in sprite v]\n        change [i v] by (1)\n        wait until <not <key (n v) pressed?>>\n        broadcast (Play v)\n    end\n    if <key (p v) pressed?> then\n        stop all sounds\n        stop [other scripts in sprite v]\n        change [i v] by (-1)\n        if <(i) < [1]> then\n            set [i v] to (length of [songs queue v])\n        end\n        wait until <not <key (p v) pressed?>>\n        broadcast (Play v)\n    end\nend\n\ndefine Play\nforever\n    repeat (length of [songs queue v])\n        play sound (item (i) of [songs queue v]) until done\n        change [i v] by (1)\n        if <(i) > (length of [songs queue v])> then\n            set [i v] to [1]\n        end\n    end\nend\n\nwhen I receive [play v]\nPlay\n\ndefine Show\ngo to x: (180) y: (120)\npoint in direction (100)\nhide\nset size to (60) %\nclear graphic effects\nset [ghost v] effect to (100)\nshow\nrepeat (10)\n    turn right (36) degrees\n    change [ghost v] effect by (-10)\nend\nwait (1) seconds\nrepeat (10)\n    change y by (10)\n    change x by (10)\n    change [ghost v] effect by (10)\n    change size by (-5)\nend\n\nwhen flag clicked\nswitch costume to (a v)\nShow\nwait (3) seconds\nswitch costume to (b v)\nset size to (100) %\npoint in direction (90)\ngo to x: (230) y: (150)\nrepeat (10)\n    change x by (-8)\n    change [ghost v] effect by (-10)\nend\nwait (3) seconds\nrepeat (10)\n    change x by (8)\n    change [ghost v] effect by (10)\nend\n\n