No Jumping - The Platformer


@Stage\n\nwhen flag clicked\nforever\n    if <key (1 v) pressed?> then\n        play sound [y2mate v] until done\n    end\nend\n\nwhen flag clicked\nforever\n    if <key (2 v) pressed?> then\n        stop all sounds\n    end\nend\n\n@trap\n\nwhen I receive [level2 v]\ngo to x: (-15) y: (-64)\nshow\n\nwhen I receive [level 3 v]\nhide\n\nwhen flag clicked\nhide\n\nwhen I receive [end v]\nhide\n\n@trap2\n\nwhen I receive [level 3 v]\nshow\nforever\n    glide (.5) secs to x: (-41) y: (76)\n    wait (.5) seconds\n    glide (.65) secs to x: (-41) y: (292)\n    wait (1) seconds\nend\n\nwhen I receive [level4 v]\nhide\n\nwhen flag clicked\ngo to x: (-41) y: (292)\nhide\n\n@door in anther levels\n\nwhen flag clicked\nforever\n    if <touching (player v)?> then\n        broadcast (Level2 v)\n        hide\n        stop [this script v]\n    end\nend\n\nwhen flag clicked\ngo to x: (320) y: (-35)\nshow\n\n@arrows\n\nwhen I receive [level6 v]\nshow\nforever\n    glide (1) secs to x: (x position) y: (-75)\n    go to x: (pick random (-130) to (130)) y: (148)\nend\n\nwhen I receive [end v]\nhide\n\nwhen flag clicked\ngo to x: (27) y: (148)\nhide\n\n@THUMBNAIL\n\nwhen flag clicked\ngo to [front v] layer\nhide\n\n@Player\n\nwhen flag clicked\nswitch backdrop to (l1a v)\nReset Player Position\nset [force walk v] to [3]\nset [force gravity v] to [-1.5]\nset [force jump v] to [17]\nset [player speed x v] to [0]\nforever\n    Check Player Gravity\n    Check Player Walk\n    Check Player Touching\nend\n\ndefine move out (dx) (dy)\nrepeat until <not <touching color (#2aff1b)?>>\n    change x by (dx)\n    change y by (dy)\nend\n\ndefine Check Player Gravity\nchange [player speed y v] by (FORCE GRAVITY)\nchange y by (Player Speed Y)\nif <<touching color (#dd8b18)?> or <<touching color (#2aff1b)?> or <touching color (#27e419)?>>> then\n    if <(Player Speed Y) > [0]> then\n        move out [0] [-1]\n        set [player speed y v] to [0]\n    else\n        move out [0] [1]\n        if <key (up arrow v) pressed?> then\n            set [player speed y v] to (FORCE JUMP)\n        else\n            set [player speed y v] to [0]\n        end\n    end\nend\n\ndefine Check Player Walk\nif <key (left arrow v) pressed?> then\n    change [player speed x v] by ((-1) * (FORCE WALK))\nend\nif <key (right arrow v) pressed?> then\n    change [player speed x v] by ((1) * (FORCE WALK))\nend\nset [player speed x v] to ((Player Speed X) * (0.7))\nchange x by (Player Speed X)\nif <(Player Speed X) > [0]> then\n    move out [-1] [0]\nelse\n    move out [1] [0]\nend\n\ndefine Check Player Touching\nif <touching color (#ff0000)?> then\n    start sound [Boing v]\n    switch costume to (broken v)\n    wait (.5) seconds\n    switch costume to (r1 v)\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\n    Reset Player Position\nend\nif <touching color (#000000)?> then\n    start sound [Boing v]\n    switch costume to (broken v)\n    wait (.5) seconds\n    switch costume to (r1 v)\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\n    Reset Player Position\nend\n\ndefine Reset Player Position\nclear graphic effects\ngo to x: (-200) y: (11)\nglide (0.5) secs to x: (-201) y: (-63)\n\nwhen flag clicked\nswitch costume to (r1 v)\n\nwhen flag clicked\ngo to x: (-200) y: (11)\nglide (0.5) secs to x: (-201) y: (-63)\n\nwhen flag clicked\nforever\n    if <key (r v) pressed?> then\n        Reset Player Position\n        switch costume to (r1 v)\n    end\nend\n\nwhen flag clicked\nforever\n    say (username)\nend\n\nwhen flag clicked\nforever\n    if <key (right arrow v) pressed?> then\n        switch costume to (r1 v)\n        wait (.000001) seconds\n        switch costume to (r2 v)\n        wait (.000001) seconds\n        switch costume to (r3 v)\n        wait (.000001) seconds\n    end\n    if <key (left arrow v) pressed?> then\n        switch costume to (l1 v)\n        wait (.000001) seconds\n        switch costume to (l2 v)\n        wait (.000001) seconds\n        switch costume to (l3 v)\n        wait (.000001) seconds\n    end\nend\n\nwhen I receive [level2 v]\nReset Player Position\n\nwhen I receive [level 3 v]\nReset Player Position\n\nwhen I receive [level4 v]\nReset Player Position\n\nwhen I receive [level5 v]\nReset Player Position\n\nwhen I receive [level6 v]\nReset Player Position\n\nwhen flag clicked\nshow\ngo to [front v] layer\n\nwhen I receive [end v]\ngo to [back v] layer\n\nwhen flag clicked\nshow variable [seconds v]\nset [seconds v] to [0]\nforever\n    wait (1) seconds\n    change [seconds v] by (1)\nend\n\nwhen I receive [end v]\nstop [other scripts in sprite v]\n\nwhen flag clicked\nforever\n    set volume to (50) %\n    play sound [y2mate v] until done\nend\n\n@lava trap animated\n\nwhen I receive [level5 v]\ngo to [front v] layer\ngo to x: (-97) y: (-83)\nshow\nrepeat until <(level 1 done) = [5]>\n    next costume\n    wait (0.1) seconds\nend\n\nwhen I receive [level6 v]\nhide\n\nwhen flag clicked\nhide\n\n@SPINING trap\n\nwhen I receive [level4 v]\ngo to [back v] layer\nshow\nforever\n    turn right (7) degrees\nend\n\nwhen I receive [level5 v]\nhide\n\nwhen flag clicked\nhide\n\n@Sprite1\n\nwhen flag clicked\ngo to x: (104) y: (-204)\ngo to [front v] layer\nshow\n\n@door in anther levels2\n\nwhen flag clicked\nforever\n    if <touching (player v)?> then\n        broadcast (Level 3 v)\n        hide\n        stop [this script v]\n    end\nend\n\nwhen flag clicked\ngo to x: (320) y: (-35)\nhide\n\nwhen I receive [level2 v]\nshow\n\n@door in anther levels3\n\nwhen flag clicked\nforever\n    if <touching (player v)?> then\n        broadcast (Level4 v)\n        hide\n        stop [this script v]\n    end\nend\n\nwhen flag clicked\ngo to x: (320) y: (-35)\nhide\n\nwhen I receive [level 3 v]\nshow\n\n@door in anther levels4\n\nwhen flag clicked\nforever\n    if <touching (player v)?> then\n        broadcast (Level5 v)\n        hide\n        stop [this script v]\n    end\nend\n\nwhen flag clicked\ngo to x: (320) y: (-35)\nhide\n\nwhen I receive [level4 v]\nshow\n\n@door in anther levels5\n\nwhen flag clicked\nforever\n    if <touching (player v)?> then\n        broadcast (Level6 v)\n        hide\n        stop [this script v]\n    end\nend\n\nwhen flag clicked\ngo to x: (320) y: (-35)\nhide\n\nwhen I receive [level5 v]\nshow\n\n@door in anther levels6\n\nwhen flag clicked\nforever\n    if <touching (player v)?> then\n        broadcast (End v)\n        hide\n        stop [this script v]\n    end\nend\n\nwhen flag clicked\ngo to x: (320) y: (-35)\nhide\n\nwhen I receive [level6 v]\nshow\n\n@SPINING trap2\n\nwhen I receive [level4 v]\ngo to [back v] layer\nshow\nforever\n    turn right (7) degrees\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [level5 v]\nhide\n\n@Sprite2\n\nwhen I receive [end v]\ngo to [front v] layer\nset [your time 2 v] to (end time your)\nshow variable [☁ best score v]\nset [end time your v] to (Seconds)\nhide variable [seconds v]\nshow variable [end time your v]\nshow\n\nwhen flag clicked\nshow list [scores v]\nhide variable [☁ best score v]\nhide variable [end time your v]\nset [end time your v] to [0]\nhide\n\nwhen I receive [end v]\nset [bla bla bla v] to [6]\n\nwhen I receive [end v]\nforever\n    play sound [y2mate v] until done\nend\n\nwhen flag clicked\nset [bla bla bla v] to [0]\nforever\n    if <(bla bla bla) = [6]> then\n        if <(end time your) < (☁ best score)> then\n            set [☁ best score v] to (end time your)\n        end\n    end\nend\n\n@snowflake effect\n\nwhen I start as a clone\nwait (pick random (0.1) to (0.4)) seconds\ngo to [front v] layer\nshow\ngo to x: (pick random (-220) to (220)) y: (180)\npoint in direction (pick random (70) to (100))\nswitch costume to (pick random (1) to (5))\nrepeat (50)\n    turn left (pick random (0) to (20)) degrees\n    change y by (pick random (-5) to (-10))\n    turn right (pick random (0) to (20)) degrees\nend\ncreate clone of (_myself_ v)\ndelete this clone\n\nwhen I receive [end v]\nwait (0.2) seconds\ngo to [front v] layer\nhide\nrepeat (5)\n    create clone of (_myself_ v)\n    wait (0.5) seconds\nend\n\nwhen flag clicked\nhide\nforever\n    go to [front v] layer\nend\n\n@snowflake effect2\n\nwhen I start as a clone\nwait (pick random (0.1) to (0.4)) seconds\ngo to [front v] layer\nshow\ngo to x: (pick random (-220) to (220)) y: (180)\npoint in direction (pick random (70) to (100))\nswitch costume to (pick random (1) to (5))\nrepeat (50)\n    turn left (pick random (0) to (20)) degrees\n    change y by (pick random (-5) to (-10))\n    turn right (pick random (0) to (20)) degrees\nend\ncreate clone of (_myself_ v)\ndelete this clone\n\nwhen I receive [end v]\nwait (0.2) seconds\ngo to [front v] layer\nhide\nrepeat (5)\n    create clone of (_myself_ v)\n    wait (0.5) seconds\nend\n\nwhen flag clicked\nhide\nforever\n    go to [front v] layer\nend\n\n