Mars | Platformer

Instructions: To move:\n      WASD  /  Arrow keys\n      V to skip a level\n\nIf we reach the 10 likes and 100 views I will make more levels.\n\nI hope you enjoy it!

@Stage\n\nwhen flag clicked\nforever\n    switch backdrop to (Level)\nend\n\n@astronaut_Idle1\n\ngo to [front v] layer\n\ndefine Plattformer move (jump height) (gravity) (friction) (speed)\nswitch costume to (hitbox v)\nif <<key (d v) pressed?> or <key (right arrow v) pressed?>> then\n    change [xv v] by (speed)\n    point in direction (90)\nend\nif <<key (a v) pressed?> or <key (left arrow v) pressed?>> then\n    change [xv v] by ((speed) * (-1))\n    point in direction (-90)\nend\nset [xv v] to ((Xv) * (friction))\nchange x by (Xv)\nif <touching (level v)?> then\n    set [slope v] to [0]\n    repeat until <<(Slope) = [8]> or <not <touching (level v)?>>>\n        if <touching (level v)?> then\n            change y by (1)\n            change [slope v] by (1)\n        end\n    end\n    if <touching (level v)?> then\n        change y by ((Slope) * (-1))\n        repeat ([ceiling v] of ([abs v] of (Xv) ) )\n            if <touching (level v)?> then\n                change x by ((([abs v] of (Xv) ) / (Xv)) * (-1))\n            end\n        end\n        set [xv v] to [0]\n    end\nend\nchange y by (Yv)\nif <touching (level v)?> then\n    repeat ([ceiling v] of ([abs v] of (Yv) ) )\n        if <touching (level v)?> then\n            change y by ((([abs v] of (Yv) ) / (Yv)) * (-1))\n        end\n    end\n    if <<<key (w v) pressed?> or <key (up arrow v) pressed?>> and <not <(Yv) > [0]>>> then\n        set [yv v] to (jump height)\n    else\n        set [yv v] to [0]\n    end\nelse\n    change [yv v] by (gravity)\nend\nswitch costume to (idle v)\nif <([abs v] of (Xv) ) > [1]> then\n    switch costume to (Walk)\nend\nif <(Yv) > [1]> then\n    switch costume to (jump v)\nend\nif <(Yv) < [-3]> then\n    switch costume to (fall v)\nend\n\nwhen I receive [next v]\nset [xv v] to [0]\nset [yv v] to [0]\nchange [level v] by (1)\nif <(Level) = [12]> then\n    go to x: (0) y: (0)\nelse\n    go to x: (-213) y: (-130)\nend\n\nwhen I receive [start v]\nwait until <key (any v) pressed?>\nshow\nset volume to (90) %\ngo to x: (-213) y: (-130)\nset rotation style [left-right v]\nset [level_type v] to [Walk]\nset [xv v] to [0]\nset [yv v] to [0]\nforever\n    Plattformer move [12] [-0.7] [0.7] [3]\nend\n\nwhen I receive [start v]\nset [walk v] to [4]\nforever\n    change [walk v] by (1)\n    if <(Walk) = [10]> then\n        set [walk v] to [3]\n    end\n    wait (0.08) seconds\nend\n\nwhen I receive [start v]\nwait until <key (any v) pressed?>\nforever\n    play sound [Mars v] until done\nend\n\nwhen I receive [start v]\nforever\n    if <<(x position) > [238]> or <key (v v) pressed?>> then\n        broadcast (Next v)\n        wait until <not <key (v v) pressed?>>\n    end\n    if <touching (jumper v)?> then\n        set [yv v] to [17]\n        start sound [Boing v]\n    end\n    if <touching (spikes v)?> then\n        set [xv v] to [0]\n        set [yv v] to [0]\n        start sound [Crunch v]\n        go to x: (-213) y: (-130)\n    end\nend\n\ngo to [back v] layer\n\nwhen flag clicked\nhide\n\n@Level\n\ngo to [back v] layer\n\ngo to [front v] layer\n\nwhen I receive [start v]\nset [level v] to [1]\nwait until <key (any v) pressed?>\nshow\nforever\n    go to x: (0) y: (0)\n    switch costume to (Level)\n    if <(Level) = [13]> then\n        set [level v] to [1]\n    end\nend\n\nwhen flag clicked\nhide\n\n@Stars\n\ngo to [back v] layer\n\nwhen I start as a clone\ngo to [back v] layer\nshow\ngo to (random position v)\nrepeat (50)\n    change [ghost v] effect by (-1.5)\nend\nrepeat (50)\n    change [ghost v] effect by (1.5)\nend\ndelete this clone\n\nwhen I receive [start v]\nset [ghost v] effect to (100)\nforever\n    create clone of (_myself_ v)\n    wait (0.08) seconds\nend\n\nwhen flag clicked\nhide\n\n@Spikes\n\ngo to [back v] layer\n\nwhen I receive [start v]\nwait until <key (any v) pressed?>\nshow\nforever\n    go to x: (0) y: (0)\n    switch costume to (Level)\nend\n\nwhen flag clicked\nhide\n\n@Jumper\n\ngo to [back v] layer\n\nwhen I receive [start v]\nwait until <key (any v) pressed?>\nshow\nforever\n    go to x: (0) y: (0)\n    switch costume to (Level)\nend\n\nwhen flag clicked\nhide\n\n@Front-backdrop\n\ngo to [front v] layer\n\ngo [backward v] (1) layers\n\nwhen I receive [start v]\nshow\ngo to x: (0) y: (0)\nrepeat until <key (any v) pressed?>\nend\nstart sound [Teleport v]\nhide\n\ngo to [front v] layer\n\nwhen flag clicked\nhide\n\n@Words\n\ngo to [front v] layer\n\nwhen I receive [start v]\nrepeat until <key (any v) pressed?>\n    go to x: (0) y: (0)\n    repeat (30)\n        change [ghost v] effect by (1.5)\n    end\n    repeat (30)\n        change [ghost v] effect by (-1.5)\n    end\nend\n\nwhen I receive [start v]\nshow\nwait until <key (any v) pressed?>\nhide\nstop [other scripts in sprite v]\n\nwhen flag clicked\nhide\nset [ghost v] effect to (0)\n\n@Intro Logo\n\nwhen flag clicked\nhide\nswitch costume to (background v)\ncreate clone of (_myself_ v)\nnext costume\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nif <(costume [name v]) = [Background]> then\n    show\n    set [ghost v] effect to (0)\n    wait until <(timer) > [3.8]>\n    repeat (25)\n        change [ghost v] effect by (4)\n    end\n    delete this clone\nelse\n    show\n    set [ghost v] effect to (100)\n    set size to (75) %\n    repeat (50)\n        change [ghost v] effect by (-2)\n        change size by (0.5)\n    end\n    wait (2) seconds\n    broadcast (Start v)\n    repeat (25)\n        change [ghost v] effect by (4)\n    end\n    delete this clone\nend\n\n