2.5d Platformer Test


@Stage\n\nwhen I receive [finish intro v]\nforever\n    play sound [bensound-creativeminds v] until done\nend\n\n@Blank\n\n@Assets\n\nwhen flag clicked\nhide\ngo to [back v] layer\n\n@Thumbnail\n\nwhen flag clicked\nbroadcast (Intro v)\nwait (2.2) seconds\nbroadcast (Finish Intro v)\n\nwhen flag clicked\nwait (0.001) seconds\nrepeat (20)\n    change [ghost v] effect by (5)\nend\n\nwhen flag clicked\ngo to x: (0) y: (0)\nshow\nforever\n    go to [front v] layer\n    set [ghost v] effect to (100)\nend\n\nshow\ngo to [front v] layer\nset [ghost v] effect to (0)\n\n@Player\n\ndefine Vertical movement\nchange y by (Y Speed)\nVertical Colition\nGravity\n\ndefine Vertical Colition\nif <touching (level v)?> then\n    if <[0] > (Y Speed)> then\n        repeat until <not <touching (level v)?>>\n            change y by (1)\n        end\n    end\n    set [above the platform? v] to [Yes]\n    if <(Y Speed) > [0]> then\n        repeat until <not <touching (level v)?>>\n            change y by (-1)\n        end\n    end\n    set [y speed v] to [0]\nend\n\ndefine Gravity\nchange [y speed v] by (-1)\n\nwhen I receive [finish intro v]\nset x to (-196)\nset y to (10)\nshow\nrepeat (4)\n    change [ghost v] effect by (-25)\nend\nforever\n    Horizontal Movement\n    Vertical movement\nend\n\nwhen flag clicked\npoint in direction (90)\nhide\nset [ghost v] effect to (100)\n\ndefine Horizontal Movement\nchange x by (X Speed)\nHorizontal Collision\nFriction\n\ndefine Friction\nset [x speed v] to ((X Speed) * (0.8))\n\ndefine Horizontal Collision\nif <touching (level v)?> then\n    repeat (3)\n        change y by (1)\n        if <not <touching (level v)?>> then\n            stop [this script v]\n        end\n    end\n    change y by (-3)\n    if <[0] > (X Speed)> then\n        repeat until <not <touching (level v)?>>\n            change x by (1)\n        end\n    end\n    if <(X Speed) > [0]> then\n        repeat until <not <touching (level v)?>>\n            change x by (-1)\n        end\n    end\n    set [x speed v] to [0]\nend\n\nwhen flag clicked\nforever\n    if <<<key (up arrow v) pressed?> or <<<key (space v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > (y position)>>>> and <(Above the platform?) = [Yes]>> then\n        change [y speed v] by (13)\n        set [above the platform? v] to [No]\n    end\n    if <<<key (d v) pressed?> or <key (right arrow v) pressed?>> or <<mouse down?> and <(mouse x) > (x position)>>> then\n        point in direction (90)\n        change [x speed v] by (2)\n    end\n    if <<<key (a v) pressed?> or <key (left arrow v) pressed?>> or <<mouse down?> and <(mouse x) < (x position)>>> then\n        point in direction (-90)\n        change [x speed v] by (-2)\n    end\nend\n\nwhen I receive [next level v]\ngo to x: (-196) y: (10)\n\nwhen I receive [death v]\ngo to x: (-196) y: (10)\n\nwhen I receive [death v]\nplay sound [Punch Sound Effect v] until done\n\nwhen I receive [finish intro v]\nset [levels v] to [1]\n\nwhen I receive [play v]\nforever\n    if <not <(LEVELS) = [10]>> then\n        if <(x position) > [235]> then\n            broadcast (Next Level v)\n            start sound [Ding Sound Effect v]\n            change [levels v] by (1)\n            set [x speed v] to [0]\n            set [y speed v] to [0]\n        end\n    end\nend\n\n@Level\n\nwhen I receive [finish intro v]\nshow\ngo to x: (0) y: (0)\nswitch costume to (level 1 v)\n\nwhen I receive [next level v]\nnext costume\n\n@Words\n\nwhen I receive [intro v]\nset size to (150) %\ngo to [front v] layer\nset [ghost v] effect to (100)\nswitch costume to (intro v)\nwait (0.01) seconds\nshow\nrepeat (20)\n    change [ghost v] effect by (-5)\nend\nwait (0.8) seconds\nrepeat (20)\n    change [ghost v] effect by (5)\nend\nset [ghost v] effect to (20)\nset size to (130) %\nswitch costume to (level 1 v)\ngo to x: (-69) y: (159)\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\n\nwhen I receive [play v]\nforever\n    if <(LEVELS) = [2]> then\n        switch costume to (level 2 v)\n        go to x: (-81) y: (141)\n    end\n    if <(LEVELS) = [3]> then\n        switch costume to (level 3 v)\n        go to x: (-56) y: (129)\n    end\n    if <(LEVELS) = [4]> then\n        switch costume to (level 4 v)\n        go to x: (-158) y: (160)\n    end\n    if <(LEVELS) = [5]> then\n        switch costume to (level 5 v)\n        go to x: (-77) y: (145)\n    end\n    if <(LEVELS) = [6]> then\n        switch costume to (level 6 v)\n        go to x: (-193) y: (159)\n    end\n    if <(LEVELS) = [7]> then\n        switch costume to (level 7 v)\n        go to x: (-66) y: (160)\n    end\n    if <(LEVELS) = [8]> then\n        switch costume to (level 8 v)\n        go to x: (-132) y: (162)\n    end\n    if <(LEVELS) = [9]> then\n        switch costume to (level 9 v)\n        go to x: (-139) y: (163)\n    end\n    if <(LEVELS) = [10]> then\n        switch costume to (level 10 v)\n        go to x: (0) y: (120)\n    end\nend\n\nwhen I receive [play v]\nforever\n    if <touching (player v)?> then\n        set [ghost v] effect to (40)\n    else\n        set [ghost v] effect to (20)\n    end\nend\n\n@Trampoline\n\nwhen flag clicked\nhide\nset [ghost v] effect to (100)\nswitch costume to (trampoline 1 v)\nwait until <(LEVELS) = [5]>\nset [ghost v] effect to (30)\nshow\n\nwhen flag clicked\nforever\n    if <(LEVELS) = [5]> then\n        go to x: (-83) y: (-71)\n    end\n    if <(LEVELS) = [6]> then\n        go to x: (-97) y: (-71)\n    end\n    if <(LEVELS) = [7]> then\n        go to x: (-145) y: (-71)\n    end\n    if <(LEVELS) = [8]> then\n        hide\n    end\nend\n\nwhen I receive [bounce v]\nswitch costume to (trampoline 2 v)\nwait (0.01) seconds\nswitch costume to (trampoline 3 v)\nwait (0.01) seconds\nswitch costume to (trampoline 2 v)\nwait (0.01) seconds\nswitch costume to (trampoline 1 v)\n\nwhen flag clicked\nhide\nset [ghost v] effect to (100)\n\n@Clouds\n\nwhen flag clicked\nset [ghost v] effect to (100)\ngo to [back v] layer\nhide\n\nwhen I receive [play v]\nwait (0.5) seconds\nforever\n    set [ghost v] effect to (pick random (10) to (20))\nend\n\nwhen I receive [play v]\nset [ghost v] effect to (0)\nforever\n    wait (pick random (1) to (1.5)) seconds\n    switch costume to (pick random (1) to (2))\n    go to x: (240) y: (pick random (65) to (150))\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nshow\nrepeat ((236) / (2.5))\n    change x by (-3)\n    change x by (-3)\nend\ndelete this clone\n\n@Spike\n\nwhen flag clicked\ngo to [back v] layer\nhide\n\nwhen I start as a clone\nshow\nforever\n    if <touching (player v)?> then\n        broadcast (Death v)\n    end\nend\n\ndefine Create Spike with X: (x) Y: (y)\ngo to x: (x) y: (y)\ncreate clone of (_myself_ v)\n\nwhen I receive [finish intro v]\nCreate Spike with X: [-105] Y: [-76]\nCreate Spike with X: [84] Y: [-76]\n\nwhen I receive [next level v]\nif <(LEVELS) = [2]> then\n    Create Spike with X: [77] Y: [-76]\n    Create Spike with X: [-43] Y: [-76]\nend\nif <(LEVELS) = [4]> then\n    Create Spike with X: [-125] Y: [-76]\n    Create Spike with X: [-86] Y: [-76]\n    Create Spike with X: [40] Y: [-76]\n    Create Spike with X: [80] Y: [-76]\nend\nif <(LEVELS) = [5]> then\n    Create Spike with X: [72] Y: [-76]\n    Create Spike with X: [110] Y: [-76]\nend\nif <(LEVELS) = [6]> then\n    Create Spike with X: [-20] Y: [95]\n    Create Spike with X: [184] Y: [-76]\nend\nif <(LEVELS) = [8]> then\n    Create Spike with X: [10] Y: [-76]\nend\nif <(LEVELS) = [9]> then\n    Create Spike with X: [-137] Y: [-76]\n    Create Spike with X: [-102] Y: [-76]\n    Create Spike with X: [-65] Y: [-76]\n    Create Spike with X: [65] Y: [-76]\n    Create Spike with X: [102] Y: [-76]\n    Create Spike with X: [137] Y: [-76]\nend\n\nwhen I receive [next level v]\ndelete this clone\n\n@Lava\n\nwhen flag clicked\ngo to [back v] layer\nhide\n\nwhen I start as a clone\nshow\nforever\n    change [move v] by (5)\n    change y by ([sin v] of (Move) )\nend\n\ndefine Create Lava with X: (x) Y: (y)\ngo to x: (x) y: (y)\ncreate clone of (_myself_ v)\n\nwhen I receive [next level v]\nif <(LEVELS) = [3]> then\n    Create Lava with X: [82] Y: [-213]\nend\nif <(LEVELS) = [6]> then\n    Create Lava with X: [82] Y: [-213]\nend\nif <(LEVELS) = [7]> then\n    Create Lava with X: [82] Y: [-214]\nend\nif <(LEVELS) = [8]> then\n    Create Lava with X: [0] Y: [-213]\nend\n\nwhen I receive [next level v]\ndelete this clone\n\nwhen I start as a clone\nforever\n    if <touching (player v)?> then\n        broadcast (Death v)\n    end\nend\n\n@Trampoline (Program)\n\nwhen flag clicked\nhide\nset [ghost v] effect to (99)\nwait until <(LEVELS) = [5]>\nset [ghost v] effect to (99)\nshow\n\nwhen flag clicked\nforever\n    if <(LEVELS) = [5]> then\n        go to x: (-83) y: (-52)\n    end\n    if <(LEVELS) = [6]> then\n        go to x: (-97) y: (-52)\n    end\n    if <(LEVELS) = [7]> then\n        go to x: (-145) y: (-52)\n    end\n    if <(LEVELS) = [8]> then\n        hide\n    end\nend\n\nwhen flag clicked\nforever\n    if <touching (player v)?> then\n        if <<not <(Y Speed) = [1]>> and <not <(Y Speed) = [6]>>> then\n            broadcast (Bounce v)\n            set [above the trampoline? v] to [Yes]\n            set [y speed v] to [17]\n            start sound [Jump v]\n        end\n    end\nend\n\n@Walk particles\n\nwhen flag clicked\nhide\n\nwhen I receive [play v]\nhide\nforever\n    if <(Y Speed) < [0]> then\n        wait until <(Y Speed) = [-1]>\n        repeat until <(Y Speed) > [0]>\n            repeat (2)\n                move (0) steps\n            end\n            create clone of (_myself_ v)\n        end\n    end\nend\n\nwhen I start as a clone\ngo to [back v] layer\nset [ghost v] effect to (0)\nset size to (pick random (130) to (150)) %\nshow\npoint in direction (pick random (-360) to (360))\ngo to (player v)\nchange x by (X Speed)\nchange y by (-15)\nwait (0.075) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\nend\ndelete this clone\n\n@INTRO, DEATH, NEXT LEVEL\n\nwhen I receive [death v]\ngo to x: (0) y: (0)\nswitch costume to (death v)\ngo to [front v] layer\nset [ghost v] effect to (100)\nshow\nrepeat (7)\n    change [ghost v] effect by (-14)\nend\nwait (0.1) seconds\nrepeat (7)\n    change [ghost v] effect by (14)\nend\nset [ghost v] effect to (0)\nhide\n\nwhen flag clicked\ngo to x: (36) y: (28)\nhide\n\nwhen I receive [next level v]\ngo to x: (0) y: (0)\nswitch costume to (next v)\ngo to [front v] layer\nset [ghost v] effect to (100)\nshow\nrepeat (7)\n    change [ghost v] effect by (-14)\nend\nwait (0.1) seconds\nrepeat (7)\n    change [ghost v] effect by (14)\nend\nset [ghost v] effect to (0)\nhide\n\nwhen flag clicked\ngo to x: (0) y: (0)\ngo to [front v] layer\ngo [backward v] (1) layers\nswitch costume to (death v)\nset [ghost v] effect to (100)\nshow\nrepeat (5)\n    change [ghost v] effect by (-20)\nend\nwait (0.47) seconds\nplay sound [Connect v] until done\nwait (0.47) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nset [ghost v] effect to (0)\nhide\nbroadcast (Play v)\n\n@Decoration\n\nwhen flag clicked\nhide\n\nwhen I receive [finish intro v]\nswitch costume to (level 1 v)\nshow\n\nwhen I receive [play v]\nforever\n    go to x: (-12) y: (-90)\n    if <(LEVELS) = [2]> then\n        switch costume to (level 2 v)\n    end\n    if <(LEVELS) = [3]> then\n        switch costume to (level 3 v)\n    end\n    if <(LEVELS) = [4]> then\n        switch costume to (level 4 v)\n    end\n    if <(LEVELS) = [5]> then\n        switch costume to (level 5 v)\n    end\n    if <(LEVELS) = [6]> then\n        switch costume to (level 6 v)\n    end\n    if <(LEVELS) = [7]> then\n        switch costume to (level 7 v)\n    end\n    if <(LEVELS) = [8]> then\n        switch costume to (level 8 v)\n    end\n    if <(LEVELS) = [9]> then\n        switch costume to (level 9 v)\n    end\nend\n\n