Journey To The Lost (A  Platformer - Beta)


@Stage\n\n@Player\n\nwhen flag clicked\nforever\n    change [costume v] by ((7) / (Costumes))\n    if <<<not <key (right arrow v) pressed?>> and <not <key (left arrow v) pressed?>>> and <<not <<(mouse x) > (x position)> and <mouse down?>>> and <not <<(mouse x) < (x position)> and <mouse down?>>>>> then\n        set [costume v] to [0]\n    end\n    Walk Cycle\nend\n\nwhen flag clicked\nset [dir v] to [90]\nforever\n    if <<key (right arrow v) pressed?> or <<(mouse x) > (x position)> and <mouse down?>>> then\n        set [dir v] to [90]\n    end\n    if <<key (left arrow v) pressed?> or <<(mouse x) < (x position)> and <mouse down?>>> then\n        set [dir v] to [-90]\n    end\n    point in direction (Dir)\nend\n\ndefine Walk Cycle\nif <not <touching (water v)?>> then\n    if <(Jump/Fall) < [3]> then\n        if <(Costume) = [0]> then\n            switch costume to (stand v)\n        else\n            switch costume to ([floor v] of ((2) + ((Costume) mod (Costumes))) )\n        end\n    else\n        if <(Y Velocity) > [7]> then\n            switch costume to (jump v)\n        else\n            if <(Y Velocity) < [-5]> then\n                switch costume to (stand v)\n            end\n        end\n    end\nelse\n    if <(Y Velocity) > [0]> then\n        switch costume to (jump v)\n    end\n    if <(Y Velocity) < [0]> then\n        switch costume to (stand v)\n    end\n    switch costume to ([floor v] of ((2) + ((Costume) mod (Costumes))) )\nend\n\nwhen flag clicked\nset size to (105) %\nforever\n    go to (hitbox v)\nend\n\nwhen flag clicked\nforever\n    set [ghost v] effect to (Ghost Effect)\nend\n\nwhen flag clicked\nforever\n    set size to ([size v] of [hitbox v]) %\nend\n\n@HitBox\n\nwhen flag clicked\nset [ghost v] effect to (100)\nswitch costume to (stand v)\nset [ghost effect v] to [0]\nset [x velocity v] to [0]\nset [y velocity v] to [0]\nset [right key v] to [0]\nset [costumes v] to [11]\nset [costume v] to [0]\nset [left key v] to [0]\ngo to x: (-185) y: (-30)\nset size to (105) %\nforever\n    if <touching (spikes v)?> then\n        Fade\n    end\n    if <touching (flag v)?> then\n        broadcast (Slide v)\n        Fade\n        change [level v] by (1)\n    end\nend\n\ndefine Trampoline\nif <touching (trampoline v)?> then\n    set [y velocity v] to [14]\nend\n\ndefine Fade\nrepeat (10)\n    change [ghost effect v] by (10)\nend\ngo to x: (-185) y: (-30)\nset [costume v] to [0]\nset [jump/fall v] to [0]\nset [left key v] to [0]\nset [right key v] to [0]\nset [x velocity v] to [0]\nset [y velocity v] to [0]\nset [dir v] to [90]\nrepeat (10)\n    change [ghost effect v] by (-10)\nend\nset [ghost effect v] to [0]\n\ndefine Player Physics (addition) (division) (friction) (gravity)\nset [right key v] to (<<key (right arrow v) pressed?> or <<(mouse x) > (x position)> and <mouse down?>>> + (addition))\nset [left key v] to (<<key (left arrow v) pressed?> or <<(mouse x) < (x position)> and <mouse down?>>> + (addition))\nif <<key (right arrow v) pressed?> or <<(mouse x) > (x position)> and <mouse down?>>> then\n    change [x velocity v] by ((Right Key) / (division))\nend\nif <<key (left arrow v) pressed?> or <<(mouse x) < (x position)> and <mouse down?>>> then\n    change [x velocity v] by ((0) - ((Left Key) / (division)))\nend\nset [x velocity v] to ((X Velocity) * (friction))\nchange x by (X Velocity)\nchange [y velocity v] by (gravity)\nchange [jump/fall v] by (1)\nchange y by (Y Velocity)\nif <touching (ground v)?> then\n    change y by ((0) - (Y Velocity))\n    set [y velocity v] to (([abs v] of (Y Velocity) ) / (3))\n    set [jump/fall v] to [0]\nend\nchange y by (-1)\nif <<key (up arrow v) pressed?> or <<((mouse y) - (y position)) > [25]> and <mouse down?>>> then\n    if <touching (ground v)?> then\n        set [y velocity v] to ((((Y Velocity) + (15)) / (1.5)) + ((Y Velocity) / (9.7)))\n    end\nend\nchange y by (1)\nif <touching (ground v)?> then\n    change y by (2)\n    if <touching (ground v)?> then\n        change y by (2)\n        if <touching (ground v)?> then\n            change y by (2)\n            if <touching (ground v)?> then\n                change x by ((0) - (X Velocity))\n                change y by (-6)\n                if <<(X Velocity) > [0]> or <(X Velocity) < [0]>> then\n                    set [x velocity v] to (((0) - (X Velocity)) * (1.1))\n                    set [y velocity v] to [0]\n                end\n            end\n        end\n    end\nend\n\ndefine Water Physics\nset [right key v] to <<key (right arrow v) pressed?> or <<(mouse x) > (x position)> and <mouse down?>>>\nset [left key v] to <<key (left arrow v) pressed?> or <<(mouse x) < (x position)> and <mouse down?>>>\nset [up key v] to <<key (up arrow v) pressed?> or <<((mouse y) - (y position)) > [25]> and <mouse down?>>>\nset [down key v] to <<key (down arrow v) pressed?> or <<((mouse y) - (y position)) < [-25]> and <mouse down?>>>\nif <<key (right arrow v) pressed?> or <<(mouse x) > (x position)> and <mouse down?>>> then\n    change [x velocity v] by ((Right Key) / (2.3))\nend\nif <<key (left arrow v) pressed?> or <<(mouse x) < (x position)> and <mouse down?>>> then\n    change [x velocity v] by ((0) - ((Left Key) / (2.3)))\nend\nif <<key (up arrow v) pressed?> or <<((mouse y) - (y position)) > [25]> and <mouse down?>>> then\n    change [y velocity v] by ((Up Key) / (2.1))\nend\nif <<key (down arrow v) pressed?> or <<((mouse y) - (y position)) < [-25]> and <mouse down?>>> then\n    change [y velocity v] by ((0) - ((Down Key) / (2.1)))\nend\nchange [y velocity v] by (((Y Velocity) / (15)) - (0.01))\nset [x velocity v] to ((X Velocity) * (0.8))\nset [y velocity v] to ((Y Velocity) * (0.9))\nchange x by (X Velocity)\nchange y by (Y Velocity)\nif <touching (ground v)?> then\n    change y by ((0) - (Y Velocity))\n    set [y velocity v] to [0]\nend\nif <touching (ground v)?> then\n    change y by (2)\n    if <touching (ground v)?> then\n        change y by (2)\n        if <touching (ground v)?> then\n            change y by (2)\n            if <touching (ground v)?> then\n                change x by ((0) - (X Velocity))\n                change y by (-6)\n                if <<(X Velocity) > [0]> or <(X Velocity) < [0]>> then\n                    set [x velocity v] to (((0) - (X Velocity)) * (1.5))\n                    set [y velocity v] to [0]\n                end\n            end\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    if <touching (water v)?> then\n        Water Physics\n    else\n        Player Physics [0.23] [2.3] [0.9] [-0.75]\n    end\nend\n\nwhen flag clicked\nforever\n    Trampoline\nend\n\nwhen I receive [restart v]\nFade\n\n@Ground\n\nwhen flag clicked\ngo to x: (0) y: (0)\nforever\n    switch costume to (Level)\n    if <(Level) > [5]> then\n        switch costume to (costume6 v)\n    end\nend\n\n@Background Textures\n\nwhen flag clicked\nhide\nrepeat (3)\n    create clone of (_myself_ v)\n    next costume\nend\n\nwhen I start as a clone\nset size to (150) %\ngo to [back v] layer\nshow\nforever\n    if <(costume [number v]) = [1]> then\n        set [ghost v] effect to (70)\n    end\n    if <(costume [number v]) = [2]> then\n        set [ghost v] effect to (70)\n    end\n    if <(costume [number v]) = [3]> then\n        set [ghost v] effect to (70)\n    end\nend\n\nwhen flag clicked\ndelete this clone\n\n@Trampoline\n\nwhen flag clicked\ngo to x: (0) y: (0)\ngo to [back v] layer\nset size to (95) %\nforever\n    if <touching (hitbox v)?> then\n        repeat (5)\n            change y by (-3)\n        end\n        repeat (5)\n            change y by (3)\n        end\n        set y to (0)\n    end\nend\n\nwhen flag clicked\nforever\n    switch costume to (Level)\n    \nend\n\n@Spikes\n\nwhen flag clicked\ngo to x: (0) y: (0)\nforever\n    switch costume to (Level)\nend\n\n@Flag\n\nwhen flag clicked\nset [level v] to [1]\ngo to x: (200) y: (-123)\nset size to (120) %\nshow\nforever\n    wait (0.01) seconds\n    next costume\n    if <(Level) > [5]> then\n        hide\n    end\nend\n\n@Water\n\nwhen flag clicked\nset [ghost v] effect to (60)\ngo to x: (0) y: (0)\nforever\n    switch costume to (Level)\nend\n\n@Shadows\n\nwhen flag clicked\nset [ghost v] effect to (65)\nswitch costume to (1 v)\ngo to x: (0) y: (0)\nforever\n    switch costume to (Level)\nend\n\n@Trampoline Shadows\n\nwhen flag clicked\nset [ghost v] effect to (60)\ngo to x: (0) y: (0)\ngo to [back v] layer\nset size to (95) %\nforever\n    set y to ([y position v] of [trampoline v])\nend\n\nwhen flag clicked\nforever\n    switch costume to (Level)\nend\n\n@Slides\n\nwhen flag clicked\nhide\n\nwhen I receive [slide v]\nset [ghost v] effect to (100)\ngo to x: (0) y: (500)\ngo to [front v] layer\nshow\nrepeat (35)\n    change y by (((0) - (y position)) / (5))\n    change [ghost v] effect by (-4)\nend\nwait (0.1) seconds\nrepeat (100)\n    change y by (((-500) - (y position)) / (10))\n    change [ghost v] effect by (5)\nend\nhide\n\n@Restart\n\nwhen flag clicked\ngo to x: (207) y: (147)\ngo to [front v] layer\nforever\n    if <touching (mouse-pointer v)?> then\n        repeat until <(round (size)) = [110]>\n            change size by (((110) - (size)) / (3))\n        end\n    else\n        change size by (((95) - (size)) / (3))\n    end\n    if <<mouse down?> and <touching (mouse-pointer v)?>> then\n        change size by (((70) - (size)) / (3))\n        broadcast (Restart v)\n        wait until <not <mouse down?>>\n    end\nend\n\n@TN\n\nwhen flag clicked\ngo to x: (0) y: (0)\nforever\n    set [ghost v] effect to (100)\n    go to [front v] layer\nend\n\n