(WIP) Climb! || An Up Scrolling Mobile Platformer


@Stage\n\n@Player\n\ndefine reset\nclear graphic effects\ngo to x: (0) y: (-50)\npoint in direction (90)\nset [dead? v] to [0]\nset [x v v] to [0]\nset [y v v] to [0]\nset size to (100) %\nshow\n\nwhen I receive [next level v]\nset [change? v] to [1]\nreset\nset [change? v] to [0]\n\nwhen I receive [alright bros let's go v]\n\nwhen I receive [alright bros let's go v]\nforever\n    set [direction v] to (direction)\nend\n\nwhen I receive [alright bros let's go v]\nset [change? v] to [0]\n\nwhen I receive [alright bros let's go v]\nforever\n    if <(y position) = [-179]> then\n        Spin off screen\n    end\nend\n\nwhen [r v] key pressed\nif <(dead?) = [0]> then\n    reset\nend\n\nwhen flag clicked\nhide\ngo to [back v] layer\n\nwhen I receive [alright bros let's go v]\nshow\n\ndefine Spin off screen\nset [dead? v] to [1]\nchange [player death v] by (1)\nrepeat (20)\n    change [ghost v] effect by (5)\nend\nreset\n\nwhen I receive [alright bros let's go v]\nforever\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nswitch costume to (center2 v)\nrepeat (10)\n    change [ghost v] effect by (5)\n    change size by (-5)\nend\ndelete this clone\n\nwhen flag clicked\nswitch costume to (center v)\n\nwhen I receive [respawn v]\n\nwhen flag clicked\n\nforever\n    if <<touching (danger v)?> or <touching (gears v)?>> then\n        go to x: (-200) y: (-65)\n    end\nend\n\nwhen flag clicked\nforever\n    if <touching (enemy v)?> then\n        go to x: (-200) y: (-65)\n    end\nend\n\nwhen flag clicked\nset [level v] to [1]\nset [dead? v] to [0]\nset size to (100) %\nreset\nforever\n    go to [front v] layer\n    if <<<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <(mouse x) > (x position)>>> and <(dead?) = [0]>> then\n        switch costume to (right v)\n        change [x v v] by (.9)\n    end\n    if <<<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <(mouse x) < (x position)>>> and <(dead?) = [0]>> then\n        switch costume to (left v)\n        change [x v v] by (-.9)\n    end\n    set [x v v] to ((X v) * (0.9))\n    change x by (X v)\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 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 ((X v) * (-2))\n                            change y by (-5)\n                            if <<key (up arrow v) pressed?> or <<key (w v) pressed?> or <<mouse down?> and <(mouse y) > ((y position) + (20))>>>> then\n                                if <(X v) > [0]> then\n                                    set [x v v] to [-5]\n                                else\n                                    set [x v v] to [5]\n                                end\n                                set [y v v] to [13]\n                            else\n                                set [x v v] to [0]\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change [y v v] by (-0.8)\n    change y by (Y v)\n    if <touching (ground v)?> then\n        change y by ((Y v) * (-1))\n        set [y v v] to [0]\n    end\n    change y by (-1)\n    if <touching (ground v)?> then\n        if <<key (up arrow v) pressed?> or <<key (w v) pressed?> or <<mouse down?> and <(mouse y) > ((y position) + (20))>>>> then\n            set [y v v] to [12]\n        end\n    end\n    change y by (1)\n    if <<<<<touching (saws v)?> or <touching (danger v)?>> or <touching (killer wheel2 v)?>> or <touching (lightning v)?>> and <(dead?) = [0]>> then\n        Spin off screen\n    end\n    if <touching (jump pad v)?> then\n        set [y v v] to [20]\n    end\nend\n\nwhen flag clicked\nshow\n\nwhen I receive [alright bros let's go v]\nforever\n    set [y v] to (y position)\nend\n\nforever\n    \nend\n\nwhen flag clicked\nforever\n    if <touching (danger v)?> then\n        Spin off screen\n    end\nend\n\nwhen I receive [alright bros let's go v]\nforever\n    if <touching color (#38ff00)?> then\n        broadcast (NEXT LEVEL v)\n        change [level v] by (1)\n    end\nend\n\nwhen I receive [alright bros let's go v]\nforever\n    if <touching (ground v)?> then\n        broadcast (hit v)\n    end\nend\n\nwhen I receive [done v]\nbroadcast (alright bros let's go v)\n\n@intro template\n\nwhen flag clicked\nset [b v] to [0]\nhide\nstart sound [MDK - Press Start v]\nrepeat (3)\n    clone [0] [1000] [1]\n    clone [0] [1000] [2]\n    clone [0] [1000] [3]\n    clone [0] [1000] [4]\n    change [b v] by (-10)\nend\nwait (1) seconds\nclone [-5] [1000] [5]\nclone [-5] [1000] [6]\nclone [-5] [1000] [7]\nclone [-5] [1000] [8]\nclone [-5] [1000] [9]\nclone [5] [-1000] [10]\nclone [5] [-1000] [11]\nclone [5] [-1000] [12]\nclone [5] [-1000] [13]\nclone [5] [-1000] [14]\nwait (1) seconds\nclone [-1000] [-1000] [15]\nwait (0.1) seconds\nclone [-1000] [1000] [16]\nwait (0.1) seconds\nclone [1000] [-1000] [17]\nwait (0.1) seconds\nclone [1000] [1000] [18]\nwait (0.1) seconds\nclone [-1000] [-1000] [19]\nwait (0.1) seconds\nclone [-1000] [1000] [20]\nwait (0.1) seconds\nclone [1000] [-1000] [21]\nwait (0.1) seconds\nclone [1000] [1000] [22]\nclone [0] [1000] [23]\nwait (0.2) seconds\nclone [0] [1000] [24]\nwait (0.2) seconds\nclone [0] [1000] [25]\nwait (0.2) seconds\nclone [0] [1000] [26]\nwait (0.2) seconds\nclone [0] [1000] [27]\nclone [-1000] [-1000] [28]\nclone [-1000] [-1000] [29]\nclone [-1000] [-1000] [30]\nclone [-1000] [-1000] [31]\nclone [-1000] [-1000] [32]\nclone [-1000] [-1000] [33]\nclone [-1000] [-1000] [34]\nclone [-1000] [-1000] [35]\nclone [-1000] [-1000] [36]\nclone [-1000] [-1000] [37]\nclone [-1000] [-1000] [38]\nclone [-1000] [-1000] [39]\nclone [-1000] [-1000] [40]\nclone [-1000] [-1000] [41]\nclone [-1000] [-1000] [42]\nclone [-1000] [-1000] [43]\nclone [-1000] [-1000] [44]\nwait (1) seconds\nclone [-1000] [-1000] [15]\nwait (0.1) seconds\nclone [-1000] [-1000] [16]\nwait (0.1) seconds\nclone [-1000] [-1000] [17]\nwait (0.1) seconds\nclone [-1000] [-1000] [18]\nwait (0.1) seconds\nclone [-1000] [-1000] [19]\nwait (0.1) seconds\nclone [-1000] [-1000] [20]\nwait (0.1) seconds\nclone [-1000] [-1000] [21]\nwait (0.1) seconds\nclone [-1000] [-1000] [22]\nbroadcast (done v)\n\ndefine clone (x) (y) (costume)\nset [x v] to (x)\nset [y v] to (y)\nset [costume v] to (costume)\ncreate clone of (_myself_ v)\nwait (0.05) seconds\n\nwhen I start as a clone\nshow\ngo to x: (x) y: (y)\nswitch costume to (costume)\nif <<(costume [number v]) > [0]> and <(costume [number v]) < [5]>> then\n    set [brightness v] effect to (b)\n    repeat until <(round (y position)) = [0]>\n        change y by (((0) - (y position)) / (5))\n    end\nend\n\nwhen I start as a clone\nshow\ngo to x: (x) y: (y)\nswitch costume to (costume)\nif <<(costume [number v]) > [4]> and <(costume [number v]) < [15]>> then\n    repeat until <(round (y position)) = [0]>\n        change y by (((0) - (y position)) / (5))\n    end\nend\n\nwhen I start as a clone\nshow\ngo to x: (x) y: (y)\nswitch costume to (costume)\nif <<(costume [number v]) > [14]> and <(costume [number v]) < [22]>> then\n    point in direction (-90)\n    set size to (0) %\n    repeat until <<(round (direction)) = [90]> and <<(round (x position)) = [0]> and <<(round (y position)) = [0]> and <(round (size)) = [100]>>>>\n        change y by (((0) - (y position)) / (5))\n        change x by (((0) - (x position)) / (5))\n        turn right (((90) - (direction)) / (5)) degrees\n        change size by (((100) - (size)) / (5))\n    end\nend\n\nwhen I start as a clone\nshow\ngo to x: (x) y: (y)\nswitch costume to (costume)\nif <<(costume [number v]) > [22]> and <(costume [number v]) < [24]>> then\n    repeat until <(round (y position)) = [0]>\n        change y by (((0) - (y position)) / (5))\n    end\nend\n\nwhen I start as a clone\nshow\ngo to x: (x) y: (y)\nswitch costume to (costume)\nif <<(costume [number v]) > [23]> and <(costume [number v]) < [28]>> then\n    repeat until <(round (y position)) = [0]>\n        change y by (((0) - (y position)) / (5))\n    end\nend\n\nwhen I start as a clone\nshow\ngo to x: (x) y: (y)\nswitch costume to (costume)\nif <<(costume [number v]) > [27]> and <(costume [number v]) < [45]>> then\n    point in direction (-90)\n    set size to (0) %\n    repeat until <<(round (direction)) = [90]> and <<(round (x position)) = [0]> and <<(round (y position)) = [0]> and <(round (size)) = [100]>>>>\n        change y by (((0) - (y position)) / (5))\n        change x by (((0) - (x position)) / (5))\n        turn right (((90) - (direction)) / (5)) degrees\n        change size by (((100) - (size)) / (5))\n    end\nend\n\nwhen I receive [done v]\nwait (0.55) seconds\nrepeat (10)\n    change volume by (-10)\nend\nstop all sounds\nset volume to (100) %\ndelete this clone\n\nwhen flag clicked\nforever\n    go to [front v] layer\nend\n\nwhen I start as a clone\nforever\n    go to [front v] layer\nend\n\nwhen [space v] key pressed\nstop [other scripts in sprite v]\nstop all sounds\nhide\n\nwhen [space v] key pressed\nbroadcast (done v)\nforever\n    delete this clone\nend\n\n@Ground\n\nwhen I receive [alright bros let's go v]\nset [scroll y v] to [0]\nforever\n    Tick\nend\n\ndefine Tick\nif <not <touching (player v)?>> then\n    go to x: (0) y: ((SCROLL Y) - (Y))\nend\n\nwhen I receive [next level v]\nnext costume\n\nwhen I start as a clone\nchange [scroll y v] by (400)\nforever\n    Tick\nend\n\ncreate clone of (_myself_ v)\n\nwhen flag clicked\nswitch costume to (1 v)\nforever\n    switch costume to (Level)\nend\n\nwhen I receive [hit v]\n\nrepeat until <touching (player v)?>\nend\n\n@Danger\n\nwhen I receive [alright bros let's go v]\nset [scroll y v] to [0]\nforever\n    Tick\nend\n\ndefine Tick\nif <not <touching (player v)?>> then\n    go to x: (0) y: ((SCROLL Y) - (Y))\nend\n\nwhen I receive [next level v]\nnext costume\n\nwhen I start as a clone\nchange [scroll y v] by (400)\nforever\n    Tick\nend\n\ncreate clone of (_myself_ v)\n\nwhen flag clicked\nswitch costume to (1 v)\nforever\n    switch costume to (Level)\nend\n\nwhen flag clicked\n\nforever\n    repeat (5)\n        change [scroll y v] by (2)\n    end\n    repeat (5)\n        change [scroll y v] by (2)\n    end\nend\n\nwhen I receive [alright bros let's go v]\n\n@Cloud\n\nwhen I receive [alright bros let's go v]\nshow\nset x to (pick random (-50) to (50))\nset size to (75) %\nset [cloud x v] to (pick random (20) to (-20))\nset y to (pick random (53) to (108))\nset [ghost v] effect to (pick random (40) to (60))\nforever\n    change x by (Cloud X)\nend\n\nwhen I receive [alright bros let's go v]\nforever\n    create clone of (_myself_ v)\n    wait (pick random (2) to (4)) seconds\nend\n\nwhen I start as a clone\nset x to (pick random (-50) to (50))\nset size to (75) %\nset [cloud x v] to (pick random (20) to (-20))\nset y to (pick random (53) to (108))\nset [ghost v] effect to (pick random (40) to (60))\nforever\n    change x by (Cloud X)\nend\n\nwhen I start as a clone\nforever\n    if <<(x position) > [239]> or <(x position) < [-239]>> then\n        delete this clone\n    end\nend\n\nwhen I receive [alright bros let's go v]\nforever\n    if <<(x position) > [239]> or <(x position) < [-239]>> then\n    end\nend\n\nhide\nwait (0.8) seconds\n\nshow\n\n@Sprite1\n\nwhen flag clicked\ngo to x: (0) y: (0)\nset [ghost v] effect to (100)\n\nwhen flag clicked\nforever\n    go to [front v] layer\nend\n\n