Greenland || a Platformer
@Stage\n\nwhen flag clicked\nforever\n    play sound [Animals - Martin Garrix  \[freemp3.se\] \(1\).mp3 v] until done\n    play sound [Alan Walker - Unity \(Lyrics\) ft v] until done\n    play sound [Alan Walker - On My Way - v] until done\n    play sound [Alan Walker - Play \(Lyrics\) ft v] until done\nend\n\n@Blank\n\n@level\n\nwhen I receive [change level v]\nswitch costume to (join [L] (Level #))\n\nwhen flag clicked\nset [brightness v] effect to (10)\ngo to x: (0) y: (0)\ngo to [back v] layer\n\nif <(Level #) = [6]> then\n    set [level # v] to [5]\n    switch costume to (l5 v)\nend\n\nset [level # v] to [5]\n\n@Player\n\nwhen flag clicked\nset drag mode [not draggable v]\nswitch costume to (stand v)\nset size to (40) %\npoint in direction (90)\nset rotation style [left-right v]\nset [resistance v] to [0.8]\nset [acceleration v] to [1.5]\nset [jump force v] to [10]\nset [jump duration v] to [7]\nset [gravity v] to [-1.25]\nReset & Begin [1]\n\ndefine Move in steps (step)\nchange [falling v] by (1)\nrepeat (step)\n    set [last value v] to (x position)\n    change x by ((Speed X) / (step))\n    Check touching soild\n    if <(touching) > [0]> then\n        Collide X - Slope/Wall\n    end\n    set [last value v] to (y position)\n    change y by ((Speed Y) / (step))\n    Check touching soild\n    if <(touching) > [0]> then\n        Collie Y - Celling/Floor\n    end\nend\n\ndefine Check touching soild\nif <touching (level v)?> then\n    set [touching v] to [1]\nelse\n    set [touching v] to [0]\nend\n\nwhen I receive [tick - player v]\nControls - Up and Down\nControls - LR\nMove in steps (([abs v] of (Speed X) ) + ([abs v] of (Speed Y) ))\nSet costume\n\ndefine Controls - Up and Down\nif <<key (up arrow v) pressed?> or <<mouse down?> and <(mouse y) > (y position)>>> then\n    if <<(Wall Slide) > [0]> and <(jumping) = [0]>> then\n        set [jumping v] to [1]\n        set [falling v] to [3]\n        set [wall slide v] to [0]\n        turn right (180) degrees\n        set [speed x v] to (((direction) / (90)) * (7))\n        set [long jump v] to [12]\n    end\n    if <<(falling) < [3]> and <(jumping) = [0]>> then\n        set [jumping v] to [1]\n        set [falling v] to [3]\n    end\n    if <<(jumping) > [0]> and <(jumping) < (JUMP DURATION)>> then\n        change [jumping v] by (1)\n        set [speed y v] to (JUMP FORCE)\n    end\nelse\n    set [jumping v] to [0]\nend\nchange [speed y v] by (GRAVITY)\nif <(Wall Slide) > [0]> then\n    Check Wall Slide\n    if <(Speed Y) < [0]> then\n        set [speed y v] to ((Speed Y) * (0.6))\n    end\nend\n\ndefine Controls - LR\nif <(long jump) > [0]> then\n    change [long jump v] by (-1)\n    stop [this script v]\nend\nset [key x v] to (<<key (right arrow v) pressed?> or <<mouse down?> and <(mouse x) > (x position)>>> - <<key (left arrow v) pressed?> or <<mouse down?> and <(mouse x) < (x position)>>>)\nif <(KEY X) = [0]> then\n    if <<(falling) > [2]> and <(Wall Slide) < [1]>> then\n        set [speed x v] to ((Speed X) * (0.98))\n        stop [this script v]\n    end\n    if <([abs v] of (Speed X) ) < [1]> then\n        set [frame v] to [0]\n    else\n        change [frame v] by (0.5)\n    end\nelse\n    change [speed x v] by ((ACCELERATION) * (KEY X))\n    point in direction ((90) * (KEY X))\n    change [frame v] by (1)\nend\nset [speed x v] to ((Speed X) * (RESISTANCE))\n\ndefine Reset & Begin (level#)\nstop [other scripts in sprite v]\nset [long jump v] to [0]\nset [jumping v] to [0]\nset [wall slide v] to [0]\nset [frame v] to [0]\nset [level # v] to (level#)\nset [speed x v] to [0]\nset [speed y v] to [0]\nset [falling v] to [99]\ngo to x: (-150) y: (50)\nbroadcast (Change Level v)\nbroadcast (Game Loop v)\n\nwhen I receive [game loop v]\nforever\n    broadcast (Tick - First v)\n    broadcast (Tick - Player v)\n    broadcast (Tick - Last v)\nend\n\nwhen I receive [tick - last v]\nif <(x position) > [235]> then\n    Begin Level # ((Level #) + (1)) go to XY [-235] []\nend\nif <(x position) < [-235]> then\n    Begin Level # ((Level #) - (1)) go to XY [235] []\nend\nif <<(y position) > [180]> and <<(Level #) > [100]> or <(Level #) = [1]>>> then\n    Begin Level # ((Level #) + (100)) go to XY [] [-170]\nend\nif <<(y position) < [-180]> and <(Level #) > [100]>> then\n    Begin Level # ((Level #) - (100)) go to XY [] [180]\nend\nif <<(y position) < [-177]> and <(Level #) < [100]>> then\n    Fell Vold\nend\n\ndefine Begin Level # (l#) go to XY (x) (y)\nset [level # v] to (l#)\nif <(x) > []> then\n    set x to (x)\nend\nif <(y) > []> then\n    set y to (y)\nend\nbroadcast (Change Level v)\nstop [other scripts in sprite v]\nwait (0) seconds\nswitch costume to (hitbox v2 v)\nset rotation style [don't rotate v]\nif <(x) > []> then\n    Fix Collision in Direction [0]\nelse\n    Fix Collision in Direction [90]\nend\nSet costume\nbroadcast (Game Loop v)\n\ndefine Fix Collision in Direction (dir)\nset [temp v] to (direction)\nset [distance v] to [1]\npoint in direction (dir)\nrepeat (128)\n    Check touching soild\n    if <(touching) < [1]> then\n        point in direction (Temp)\n        stop [this script v]\n    end\n    move (distance) steps\n    turn right (180) degrees\n    change [distance v] by (1)\nend\n\nwhen I receive [tick - first v]\nswitch costume to (hitbox v2 v)\nset rotation style [don't rotate v]\n\ndefine Set costume\nset rotation style [left-right v]\nif <(Wall Slide) > [0]> then\n    switch costume to (hangon01 v)\n    stop [this script v]\nend\nif <(falling) > [1]> then\n    if <(Speed Y) > [0]> then\n        switch costume to (jump01 v)\n    else\n        switch costume to (run_j2 v)\n    end\n    stop [this script v]\nend\nif <(frame) > [0]> then\n    switch costume to ((1) + ([floor v] of ((frame) mod (16)) ))\nelse\n    switch costume to (hit angle 0 v)\n    repeat (5)\n        Check touching soild\n        if <(touching) < [1]> then\n            switch costume to ((costume [number v]) + (5))\n            stop [this script v]\n        end\n        next costume\n    end\n    switch costume to (stand v)\nend\n\ndefine Collide X - Slope/Wall\nCheck Wall Slide\nchange y by (1)\nCheck touching soild\nif <(touching) > [0]> then\n    change y by (1)\n    Check touching soild\n    if <(touching) > [0]> then\n        change y by (-2)\n        set x to (last value)\n        set [speed x v] to [0]\n        stop [this script v]\n    end\n    set [speed x v] to ((Speed X) * (0.8))\nend\nset [speed x v] to ((Speed X) * (0.95))\nSlip\n\ndefine Collie Y - Celling/Floor\nset y to (last value)\nif <(Speed Y) > [0]> then\n    set [speed y v] to [0]\n    stop [this script v]\nend\nif <(falling) > [0]> then\n    set [falling v] to [0]\n    Slip\nend\nset [speed y v] to ((Speed Y) * (0.8))\n\ndefine Slip\nchange y by (-2)\nchange x by (1)\nCheck touching soild\nif <(touching) < [1]> then\n    set [falling v] to [0]\n    change [speed x v] by (1)\n    stop [this script v]\nend\nchange x by (-2)\nCheck touching soild\nif <(touching) < [1]> then\n    set [falling v] to [0]\n    change [speed x v] by (-1)\n    stop [this script v]\nend\nchange y by (2)\nchange x by (1)\n\nwhen [l v] key pressed\nif <not <(username) = [halollolii]>> then\n    ask [Are you sure you want to cheat?\(Y/N\)] and wait\n    if <not < (answer) contains [Y]?>> then\n        stop [this script v]\n    end\nend\nask [Set level# to?] and wait\nset [level # v] to (answer)\nbroadcast (Change Level v)\nwait (0) seconds\nFix Collision in Direction [0]\n\nwhen [d v] key pressed\nif <(username) = [halollolii]> then\n    set drag mode [draggable v]\n    wait (4) seconds\n    set drag mode [not draggable v]\nend\n\ndefine Check Wall Slide\nif <(falling) < [2]> then\n    set [wall slide v] to [0]\n    stop [this script v]\nend\nswitch costume to (hitbox wallslide v)\nset rotation style [left-right v]\nCheck touching soild\nset [wall slide v] to (touching)\nswitch costume to (hitbox v2 v)\nset rotation style [don't rotate v]\n\ndefine Fell Vold\nif <(Level #) > [20]> then\n    Reset & Begin [21]\n    stop [this script v]\nend\nif <(Level #) > [10]> then\n    Reset & Begin [11]\n    stop [this script v]\nend\nReset & Begin [1]\n\nwhen flag clicked\nforever\n    if <<(Level #) = [7]> and <<<(y position) = [-8]> or <(x position) = [-8]>> and <<(y position) = [1]> or <(x position) = [-7]>>>> then\n        broadcast (Winning v)\n        stop [this script v]\n    end\nend\n\n@Figur2\n\nwhen I receive [winning v]\nhide\nrepeat (100)\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nshow\ngo to (player v)\npoint in direction (pick random (-30) to (30))\n\nwhen flag clicked\nhide\n\n@Thumbnail2\n\nwhen flag clicked\nchange size by (10)\nchange size by (-10)\nshow\nset [ghost v] effect to (100)\n\n
mobile: with the finger.\narrow keys\n\nadd this to all your Studios\n\nMy newest Game: \nhttps://scratch.mit.edu/projects/666945392\n\nIce || a platformer \nhttps://scratch.mit.edu/projects/602809874\n\nSorry for reshare!