Mountain Dwarf - Platformer
@Stage\n\nwhen I receive [next level v]\nnext backdrop\n\nwhen flag clicked\nwait until <(backdrop [number v]) = [4]>\nchange [ghost v] effect by (25)\n\nwhen flag clicked\nwait until <(backdrop [number v]) = [6]>\nclear graphic effects\n\n@Entry\n\nwhen flag clicked\nset [ghost v] effect to (0)\nswitch backdrop to (backdrop1 v)\ngo [forward v] (2) layers\ngo to x: (0) y: (0)\n\nwhen I receive [start v]\nrepeat (100)\n    change [ghost v] effect by (1)\nend\n\n@START \n\nwhen flag clicked\nshow\ngo [forward v] (2) layers\n\nwhen this sprite clicked\nset volume to (65) %\nstart sound [Ship Bell v]\nbroadcast (START v)\nwait (3.5) seconds\nswitch backdrop to (backdrop2 v)\nhide\n\nwhen flag clicked\nforever\n    if <touching (mouse-pointer v)?> then\n        change [color v] effect by (10)\n        wait until <not <touching (mouse-pointer v)?>>\n    else\n        set [color v] effect to (0)\n    end\nend\n\nwhen flag clicked\nforever\n    point in direction ((90) + (([cos v] of (((timer) - (1)) * (400)) ) * (2.5)))\n    set size to ((120) + (([cos v] of (((timer) - (1)) * (250)) ) * (5))) %\nend\n\n@BLACK\n\nwhen flag clicked\ngo to x: (0) y: (0)\nset [ghost v] effect to (100)\n\nwhen I receive [start v]\nshow\nrepeat (100)\n    change [ghost v] effect by (-1)\nend\nwait (4.25) seconds\nrepeat (100)\n    change [ghost v] effect by (1)\nend\nhide\n\nwhen flag clicked\ngo [forward v] (200) layers\nwait until <(Stage) = [8]>\nshow\nrepeat (100)\n    change [ghost v] effect by (-1)\nend\nwait (4.25) seconds\nrepeat (100)\n    change [ghost v] effect by (1)\nend\nhide\n\ngo to [front v] layer\n\n@The LEVEL ENTRY\n\nwhen flag clicked\nset size to (195) %\ngo to x: (0) y: (0)\nset [ghost v] effect to (100)\nforever\n    point in direction ((90) + (([cos v] of (((timer) - (1)) * (400)) ) * (2.5)))\nend\n\nwhen I receive [start v]\ngo to [front v] layer\nswitch costume to (costume1 v)\nwait (2) seconds\nrepeat (100)\n    change [ghost v] effect by (-1)\nend\nwait (1.2) seconds\nrepeat (100)\n    change [ghost v] effect by (1)\nend\n\nwhen I receive [start v]\ngo [forward v] (201) layers\nwait until <(Stage) = [8]>\nswitch costume to (costume2 v)\nwait (2) seconds\nrepeat (100)\n    change [ghost v] effect by (-1)\nend\nwait (1.2) seconds\nrepeat (100)\n    change [ghost v] effect by (1)\nend\n\n@PLAYER\n\nwhen flag clicked\nswitch costume to (idle v)\ngo to x: (0) y: (0)\nhide\nset [level v] to [0]\nset [stage v] to [0]\n\ndefine Platform Gravity: (gravity) Jump Height: (jump height) Side Movement Speed (side movement) Friction (friction) Slope: (slope)\nchange [y velocity v] by (gravity)\nchange y by (Y Velocity)\nif <touching (level v)?> then\n    repeat until <not <touching (level v)?>>\n        change y by ((([abs v] of (Y Velocity) ) / (Y Velocity)) * (-1))\n    end\n    set [y velocity v] to (<<<key (up arrow v) pressed?> or <key (w v) pressed?>> and <(([abs v] of (Y Velocity) ) / (Y Velocity)) = [-1]>> * (jump height))\nend\nset [x velocity v] to (((X Velocity) + ((<<key (left arrow v) pressed?> or <key (a v) pressed?>> * ((side movement) * (-1))) + (<<key (right arrow v) pressed?> or <key (d v) pressed?>> * (side movement)))) * (friction))\nchange x by (X Velocity)\nset [slope v] to [0]\nrepeat until <<(Slope) = ((slope) * (-1))> or <not <touching (level v)?>>>\n    change y by (1)\n    change [slope v] by (-1)\nend\nif <touching (level v)?> then\n    change y by (Slope)\n    repeat until <not <touching (level v)?>>\n        change x by ((([abs v] of (X Velocity) ) / (X Velocity)) * (-1))\n    end\nend\nif <(Y Velocity) > [2]> then\n    switch costume to (idle v)\nend\nif <(Y Velocity) < [-2]> then\n    switch costume to (idle v)\nend\nif <(X Velocity) > [2]> then\n    switch costume to (walk right v)\nend\nif <(X Velocity) < [-2]> then\n    switch costume to (walk left v)\nend\nif <not <<key (up arrow v) pressed?> or <<key (down arrow v) pressed?> or <<key (right arrow v) pressed?> or <<key (left arrow v) pressed?> or <<key (a v) pressed?> or <<key (s v) pressed?> or <<key (d v) pressed?> or <key (w v) pressed?>>>>>>>>> then\n    switch costume to (idle v)\nend\nif <<key (down arrow v) pressed?> or <key (s v) pressed?>> then\n    switch costume to (squashed v)\nend\n\nwhen I receive [start v]\nwait (8) seconds\nshow\ngo to [front v] layer\ngo to x: (-68) y: (150)\nset [x velocity v] to [0]\nset [y velocity v] to [0]\nforever\n    Platform Gravity: [-1] Jump Height: [12] Side Movement Speed [3] Friction [0.7] Slope: [8]\nend\n\nwhen backdrop switches to [backdrop2 v]\nset [level v] to [1]\nset [stage v] to [1]\n\nwhen flag clicked\nforever\n    if <(Stage) = [1]> then\n        if <touching (finish v)?> then\n            broadcast (Next level v)\n            change [stage v] by (1)\n            go to x: (-180) y: (10)\n        end\n    end\n    if <(Stage) = [2]> then\n        if <touching (finish v)?> then\n            broadcast (Next level v)\n            change [stage v] by (1)\n            go to x: (-180) y: (165)\n        end\n    end\n    if <(Stage) = [3]> then\n        if <touching (finish v)?> then\n            broadcast (Next level v)\n            change [stage v] by (1)\n            go to x: (-180) y: (60)\n        end\n    end\n    if <(Stage) = [4]> then\n        if <touching (finish v)?> then\n            broadcast (Next level v)\n            change [stage v] by (1)\n            go to x: (-180) y: (55)\n        end\n    end\n    if <(Stage) = [5]> then\n        if <touching (finish v)?> then\n            broadcast (Next level v)\n            change [stage v] by (1)\n            go to x: (-200) y: (90)\n        end\n    end\n    if <(Stage) = [6]> then\n        if <touching (finish v)?> then\n            broadcast (Next level v)\n            change [stage v] by (1)\n            go to x: (-190) y: (115)\n        end\n    end\n    if <(Stage) = [7]> then\n        if <touching (finish v)?> then\n            broadcast (Next level v)\n            change [stage v] by (1)\n            go to x: (-190) y: (-45)\n        end\n    end\n    if <(Stage) = [8]> then\n        if <touching (finish v)?> then\n            broadcast (Next level v)\n            change [stage v] by (1)\n            go to x: (-200) y: (60)\n        end\n    end\n    if <(Stage) = [9]> then\n        if <touching (finish v)?> then\n            broadcast (Next level v)\n            change [stage v] by (1)\n            go to x: (-83) y: (28)\n        end\n    end\n    if <(Stage) = [10]> then\n        if <touching (finish v)?> then\n            broadcast (Next level v)\n            change [stage v] by (1)\n            go to x: (-190) y: (45)\n        end\n    end\n    if <(Stage) = [11]> then\n        if <touching (finish v)?> then\n            broadcast (Next level v)\n            change [stage v] by (1)\n            go to x: (-235) y: (-130)\n        end\n    end\n    if <(Stage) = [12]> then\n        if <touching (finish v)?> then\n            broadcast (Next level v)\n            change [stage v] by (1)\n            go to x: (-208) y: (0)\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Stage) = [1]> then\n        if <touching (spikes v)?> then\n            Death Animation\n            go to x: (-170) y: (-20)\n            clear graphic effects\n        end\n    end\n    if <(Stage) = [2]> then\n        if <touching (spikes v)?> then\n            Death Animation\n            go to x: (-170) y: (-20)\n            clear graphic effects\n        end\n    end\n    if <(Stage) = [3]> then\n        if <touching (spikes v)?> then\n            Death Animation\n            go to x: (-165) y: (162)\n            clear graphic effects\n        end\n    end\n    if <(Stage) = [4]> then\n        if <touching (spikes v)?> then\n            Death Animation\n            go to x: (-197) y: (70)\n            clear graphic effects\n        end\n    end\n    if <(Stage) = [5]> then\n        if <touching (spikes v)?> then\n            Death Animation\n            go to x: (-189) y: (10)\n            clear graphic effects\n        end\n    end\n    if <(Stage) = [6]> then\n        if <touching (spikes v)?> then\n            Death Animation\n            go to x: (-176) y: (37)\n            clear graphic effects\n        end\n    end\n    if <(Stage) = [7]> then\n        if <touching (spikes v)?> then\n            Death Animation\n            go to x: (-190) y: (120)\n            clear graphic effects\n        end\n    end\n    if <(Stage) = [8]> then\n        if <touching (spikes v)?> then\n            Death Animation\n            go to x: (-209) y: (-35)\n            clear graphic effects\n        end\n    end\n    if <(Stage) = [9]> then\n        if <touching (spikes v)?> then\n            Death Animation\n            go to x: (-200) y: (85)\n            clear graphic effects\n        end\n    end\n    if <(Stage) = [9]> then\n        if <touching (spikes v)?> then\n            Death Animation\n            go to x: (-190) y: (90)\n            clear graphic effects\n        end\n    end\n    if <(Stage) = [10]> then\n        if <touching (spikes v)?> then\n            Death Animation\n            go to x: (-190) y: (13)\n            clear graphic effects\n        end\n    end\n    if <(Stage) = [11]> then\n        if <touching (spikes v)?> then\n            Death Animation\n            go to x: (-190) y: (45)\n            clear graphic effects\n        end\n    end\n    if <(Stage) = [12]> then\n        if <touching (spikes v)?> then\n            Death Animation\n            go to x: (-200) y: (-130)\n            clear graphic effects\n        end\n    end\n    if <(Stage) = [13]> then\n        if <touching (spikes v)?> then\n            Death Animation\n            go to x: (-208) y: (0)\n            clear graphic effects\n        end\n    end\nend\n\nwhen flag clicked\nwait until <(Stage) = [8]>\nset [level v] to [2]\nrepeat (100)\n    change [ghost v] effect by (1)\nend\nwait (4.25) seconds\nrepeat (100)\n    change [ghost v] effect by (-1)\nend\nclear graphic effects\n\nwhen I receive [start v]\nset volume to (120) %\nforever\n    play sound [Hall of the Mountain King \(1\) v] until done\n    wait (pick random (3) to (5)) seconds\nend\n\ndefine Death Animation\nrepeat (5)\n    change [brightness v] effect by (20)\nend\n\nwhen flag clicked\nforever\n    if <touching (spikes v)?> then\n        Death Animation\n    end\nend\n\n@LEVEL\n\nwhen flag clicked\nshow\nset [ghost v] effect to (100)\n\nwhen backdrop switches to [backdrop2 v]\nwait (2.7) seconds\ngo [forward v] (50) layers\nswitch costume to (1 v)\nrepeat (100)\n    change [ghost v] effect by (-1)\nend\n\nwhen I receive [next level v]\nnext costume\n\nwhen flag clicked\nwait until <(Stage) = [8]>\nrepeat (100)\n    change [ghost v] effect by (1)\nend\nwait (4.25) seconds\nrepeat (100)\n    change [ghost v] effect by (-1)\nend\nclear graphic effects\n\n@Spikes\n\nwhen flag clicked\nhide\nswitch costume to (1 v)\n\nwhen I receive [next level v]\nnext costume\n\nwhen backdrop switches to [backdrop2 v]\nshow\n\n@Coins\n\nwhen flag clicked\nforever\n    if <(Stage) = [1]> then\n        go to x: (160) y: (-100)\n        go to [back v] layer\n        show\n        forever\n            if <touching (player v)?> then\n                wait (0.15) seconds\n                hide\n            end\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Stage) = [2]> then\n        go to x: (174) y: (140)\n        go to [back v] layer\n        show\n        forever\n            if <touching (player v)?> then\n                wait (0.15) seconds\n                hide\n            end\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Stage) = [3]> then\n        go to x: (175) y: (51)\n        go to [back v] layer\n        show\n        forever\n            if <touching (player v)?> then\n                wait (0.15) seconds\n                hide\n            end\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Stage) = [4]> then\n        go to x: (-70) y: (57)\n        go to [back v] layer\n        show\n        forever\n            if <touching (player v)?> then\n                wait (0.15) seconds\n                hide\n            end\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Stage) = [5]> then\n        go to x: (100) y: (-140)\n        go to [back v] layer\n        show\n        forever\n            if <touching (player v)?> then\n                wait (0.15) seconds\n                hide\n            end\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Stage) = [6]> then\n        go to x: (120) y: (60)\n        go to [back v] layer\n        show\n        forever\n            if <touching (player v)?> then\n                wait (0.15) seconds\n                hide\n            end\n        end\n    end\nend\n\nwhen flag clicked\n\nforever\n    if <(Stage) = [6]> then\n        go to x: (120) y: (60)\n        go to [front v] layer\n        show\n        forever\n            if <touching (player v)?> then\n                wait (0.15) seconds\n                hide\n            end\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Stage) = [7]> then\n        go to x: (205) y: (-84)\n        go to [back v] layer\n        show\n        forever\n            if <touching (player v)?> then\n                wait (0.15) seconds\n                hide\n            end\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    point in direction ((90) + (([cos v] of (((timer) - (1)) * (270)) ) * (14)))\n    set size to ((20) + (([cos v] of (((timer) - (1)) * (250)) ) * (5))) %\nend\n\nwhen flag clicked\nforever\n    if <(Stage) = [8]> then\n        go to x: (143) y: (26)\n        go to [back v] layer\n        show\n        forever\n            if <touching (player v)?> then\n                wait (0.15) seconds\n                hide\n            end\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Stage) = [9]> then\n        go to x: (59) y: (-91)\n        go to [back v] layer\n        show\n        forever\n            if <touching (player v)?> then\n                wait (0.15) seconds\n                hide\n            end\n        end\n    end\nend\n\nwhen flag clicked\nhide\nset volume to (10) %\nforever\n    if <touching (player v)?> then\n        play sound [Collect v] until done\n    end\nend\n\n@Finish\n\nwhen flag clicked\nhide\n\nwhen I receive [start v]\ngo to [back v] layer\nwait (6) seconds\ngo to x: (0) y: (0)\nshow\n\nwhen flag clicked\nforever\n    if <(Stage) = [7]> then\n        wait until <touching (player v)?>\n        hide\n        wait (4) seconds\n        show\n    end\nend\n\n@Special\n\nwhen flag clicked\ngo to [front v] layer\nswitch costume to (costume1 v)\n\nwhen I receive [next level v]\nnext costume\n\n@Thumnail\n\nwhen flag clicked\nhide\n\ngo to [front v] layer\n\n@Like and Love\n\nwhen I receive [start v]\nclear graphic effects\nwait (6.5) seconds\ngo [forward v] (130) layers\ngo to x: (0) y: (-150)\nshow\nrepeat (30)\n    change y by (((0) - ((y position) * (0.2))) * (1))\n    change [ghost v] effect by (-4)\nend\nwait (2) seconds\nrepeat (30)\n    change y by (((5) - ((y position) * (0.2))) * (1))\n    change [ghost v] effect by (7)\nend\n\nwhen flag clicked\nhide\n\n@Без названия - 2019-11-24T155709\n\n