3D Platformer Tutorial


@Stage\n\nwhen flag clicked\nset volume to (50) %\nforever\n    play sound [Winter Master v] until done\nend\n\n@Thumbnail\n\nwhen flag clicked\ngo to x: (0) y: (0)\nforever\n    go to [front v] layer\n    set [ghost v] effect to (100)\n    show\nend\n\n@Icey\n\nwhen flag clicked\nforever\n    create clone of (_myself_ v)\n    wait (0.01) seconds\nend\n\nwhen I start as a clone\nset [ghost v] effect to (70)\nrepeat (4)\n    wait (0.01) seconds\n    change [ghost v] effect by (5)\nend\ndelete this clone\n\nwhen I receive [dead v]\ngo to x: (-180) y: (-50)\n\nwhen I receive [levelup v]\nchange [level v] by (1)\ngo to x: (-180) y: (-50)\n\nwhen flag clicked\nset [level v] to [1]\nforever\n    if <touching (spikes v)?> then\n        broadcast (dead v)\n    end\n    if <(x position) > [242]> then\n        if <not <([costume # v] of [sentences v]) = [14]>> then\n            broadcast (levelup v)\n        end\n    end\nend\n\ndefine CheckFallingOffScreen\nif <(y position) < [-170]> then\n    go to x: (-180) y: (-50)\nend\n\ndefine CheckTouchingEnemy\nif <touching (enemy v)?> then\n    go to x: (-180) y: (-50)\nend\n\ndefine CheckTouchingWater/lava\nif <touching (ice v)?> then\n    go to x: (-180) y: (-50)\nend\n\nwhen flag clicked\nhide\n\nwhen flag clicked\nhide\n\nwhen flag clicked\nset rotation style [left-right v]\ngo to [front v] layer\nswitch costume to (icey v)\nset [ghost v] effect to (0)\nshow\ngo to x: (-180) y: (-50)\nset [x v] to [0]\nset [y v] to [0]\npoint in direction (90)\nforever\n    change [y v] by (-1)\n    CheckFallingOffScreen\n    CheckTouchingWater/lava\n    CheckTouchingEnemy\n    CheckTouchingNitroIcey\n    if <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <(x position) > (mouse x)>>> then\n        change [x v] by (-0.8)\n        point in direction (-90)\n    end\n    if <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <(mouse x) > (x position)>>> then\n        point in direction (90)\n        change [x v] by (0.8)\n    end\n    set [x v] to ((x) * (0.9))\n    change x by (x)\n    if <touching (level v)?> then\n        change y by (1)\n    end\n    if <touching (level v)?> then\n        change y by (1)\n    end\n    if <touching (level v)?> then\n        change y by (1)\n    end\n    if <touching (level v)?> then\n        change y by (1)\n    end\n    if <touching (level v)?> then\n        change y by (-4)\n        change x by ((x) * (-1))\n        if <<<key (w v) pressed?> or <key (up arrow v) pressed?>> or <<mouse down?> and <(mouse y) > (y position)>>> then\n            set [y v] to [10]\n            if <([abs v] of (x) ) = (x)> then\n                set [x v] to [-5]\n            else\n                set [x v] to [5]\n            end\n        else\n            set [x v] to [0]\n        end\n    end\n    change y by (y)\n    if <touching (level v)?> then\n        change y by ((0) - (y))\n        set [y v] to [0]\n    end\n    change y by (-1)\n    if <<<<key (w v) pressed?> or <key (up arrow v) pressed?>> or <<mouse down?> and <(mouse y) > (y position)>>> and <touching (level v)?>> then\n        set [y v] to [15]\n    end\n    change y by (1)\n    if <(y position) > [180]> then\n        set [y v] to [0]\n    end\nend\n\ndefine CheckTouchingNitroIcey\nif <touching (nitro icey v)?> then\n    broadcast (Nitro Icey v)\n    switch costume to (nitro icey v)\nend\n\n@Level\n\nwhen flag clicked\nhide\n\nwhen flag clicked\nshow\n\nwhen I receive [levelup v]\nnext costume\nchange [level v] by (1)\n\nwhen flag clicked\nswitch costume to (l1 v)\ngo to x: (0) y: (0)\nchange [level v] by (1)\n\n@Spikes\n\nwhen I receive [levelup v]\nnext costume\n\nwhen flag clicked\nshow\nswitch costume to (l1 v)\ngo to [back v] layer\n\n@Enemy\n\nwhen I receive [levelup v]\nnext costume\n\nwhen flag clicked\nshow\nswitch costume to (l1 v)\ngo to [back v] layer\n\n@Ice\n\nwhen flag clicked\nset y to (0)\nforever\n    repeat (20)\n        change y by (0.5)\n    end\n    repeat (20)\n        change y by (-0.5)\n    end\nend\n\nwhen flag clicked\nshow\nswitch costume to (l1 v)\ngo to [front v] layer\n\nwhen I receive [levelup v]\nnext costume\n\n@Nitro Icey\n\nwhen I receive [nitro icey v]\nhide\n\nwhen flag clicked\nshow\nswitch costume to (l1 v)\ngo to [back v] layer\n\nwhen I receive [levelup v]\nnext costume\n\n@Ad\n\nwhen flag clicked\nhide\nforever\n    wait (pick random (15) to (25)) seconds\n    go to x: (0) y: (50)\n    show\n    go to [front v] layer\n    start sound [pop v]\n    repeat (9)\n        change y by (-6)\n    end\n    repeat (5)\n        change y by (3)\n    end\n    repeat (5)\n        change y by (-1)\n    end\n    wait (2.7) seconds\n    repeat (15)\n        change y by (7)\n    end\n    hide\nend\n\n@Snow\n\nwhen flag clicked\nerase all\nhide\nforever\n    create clone of (_myself_ v)\n    wait (0.3) seconds\nend\n\nwhen I start as a clone\ngo to x: (pick random (-220) to (220)) y: (170)\nchange size by (pick random (0) to (3))\nshow\nforever\n    change y by (-3)\n    change x by (pick random (-1) to (1))\n    if <(y position) < [-179]> then\n        delete this clone\n    end\n    if <<not <touching color (#747474)?>> and <not <touching (icey v)?>>> then\n        delete this clone\n    end\nend\n\n@Portal\n\nwhen flag clicked\nforever\n    hide\n    if <([costume name v] of [level v]) = [L9]> then\n        show\n        if <touching (icey v)?> then\n            start sound [Crunch v]\n            broadcast (levelup v)\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    if <([costume name v] of [level v]) = [L16]> then\n        show\n        if <touching (icey v)?> then\n            start sound [Water Drop v]\n            broadcast (levelup v)\n        end\n    end\nend\n\n