Caverne☻Platformer


@Stage\n\n@LEVEL finished\n\nwhen flag clicked\ngo to x: (0) y: (0)\nset size to (100) %\nset [ghost v] effect to (100)\n\nwhen flag clicked\nrepeat (10)\n    change [ghost v] effect by (-11)\n    go to [front v] layer\nend\nforever\n    switch costume to (backdrop [number v])\nend\n\n@player\n\nwhen I start as a clone\nswitch costume to (trail v)\nset size to (75) %\nset [ghost v] effect to (1)\nrepeat (10)\n    switch costume to (trail v)\n    change size by (-10)\n    change [ghost v] effect by (10)\nend\ndelete this clone\n\nwhen flag clicked\nshow\nforever\n    create clone of (_myself_ v)\nend\n\nwhen flag clicked\nswitch costume to (hitbox v)\nset [level v] to [1]\nshow\ngo to x: (-177) y: (-30)\nhide variable [y v]\nhide variable [x v]\nset [y v] to [0]\nset [x v] to [0]\nforever\n    change [y v] by (-1)\n    if <<key (left arrow v) pressed?> or <<(mouse x) < (x position)> and <mouse down?>>> then\n        change [x v] by (-1)\n    end\n    if <<key (right arrow v) pressed?> or <<(mouse x) > (x position)> and <mouse down?>>> then\n        change [x v] by (1)\n    end\n    set [x v] to ((x) * (0.9))\n    change x by (x)\n    if <touching color (#000000)?> then\n        change y by (1)\n    end\n    if <touching color (#000000)?> then\n        change y by (1)\n    end\n    if <touching color (#000000)?> then\n        change y by (1)\n    end\n    if <touching color (#000000)?> then\n        change y by (1)\n    end\n    if <touching color (#000000)?> then\n        change y by (0)\n        change x by ((x) * (-1))\n        if <<<(mouse y) > (y position)> and <mouse down?>> or <key (up arrow v) pressed?>> then\n            set [y v] to [10]\n            if <(x) > [0]> then\n                set [x v] to [-10]\n            else\n                set [x v] to [10]\n            end\n        else\n            set [x v] to [0]\n        end\n    end\n    change y by (y)\n    if <touching color (#000000)?> then\n        change y by ((y) - ((y) * (2)))\n        set [y v] to [0]\n    end\n    change y by (-1)\n    if <<<<(mouse y) > (y position)> and <mouse down?>> or <key (up arrow v) pressed?>> and <touching color (#000000)?>> then\n        set [y v] to [12]\n    end\n    change y by (1)\n    if <touching (spikes v)?> then\n        stop [all v]\n    end\n    if <touching (spikes2 v)?> then\n        stop [all v]\n    end\n    if <<touching color (#ff0000)?> or <touching (ball-b \(1\) v)?>> then\n        go to x: (-200) y: (0)\n    end\n    if <(m) = [4]> then\n        stop [all v]\n    end\n    if <touching color (#39c800)?> then\n        set [y v] to [20]\n    end\n    if <touching color (#2e514d)?> then\n        broadcast (vv v)\n    end\nend\n\nwhen flag clicked\nswitch backdrop to (1 \(1\) v)\nshow\nset size to (75) %\nbroadcast (Play Platformer v)\n\nwhen flag clicked\nforever\n    if <touching (level finished v)?> then\n        next backdrop\n        go to x: (-220) y: (0)\n    end\n    if <touching color (#00ffc0)?> then\n        set [f v] to [1]\n    end\nend\n\nwhen flag clicked\nforever\n    if <key (left arrow v) pressed?> then\n        switch costume to (player2 v)\n    else\n        switch costume to (player3 v)\n    end\n    if <key (right arrow v) pressed?> then\n        switch costume to (player v)\n    else\n        switch costume to (player3 v)\n    end\nend\n\nchange [y v] by (20)\n\nwhen flag clicked\nset [f v] to [0]\nforever\n    if <mouse down?> then\n        show\n    end\n    if <touching (bullet v)?> then\n        go to x: (-238) y: (-158)\n        set [f v] to [0]\n    end\n    if <touching color (#00ffc0)?> then\n        set [f v] to [1]\n    end\nend\n\nwhen flag clicked\nforever\n    if <touching color (#00ffc0)?> then\n        set [f v] to [1]\n    end\nend\n\nwhen [space v] key pressed\nstop all sounds\n\nwhen [down arrow v] key pressed\nchange [color v] effect by (25)\n\nhide\n\n@Arrow1\n\nwhen this sprite clicked\nnext backdrop\n\n@Ball-b (1)\n\nwhen flag clicked\ngo to x: (0) y: (-127)\nhide\ncreate clone of (_myself_ v)\n\nwhen backdrop switches to [3 \(1\)4 v]\nshow\nforever\n    turn right (15) degrees\nend\n\nwhen backdrop switches to [3 \(1\)5 v]\ngo to x: (0) y: (-120)\nshow\nforever\n    glide (1) secs to x: (-110) y: (-127)\n    glide (1) secs to x: (146) y: (-127)\nend\n\nwhen backdrop switches to [3 \(1\)7 v]\nhide\n\nwhen I start as a clone\ngo to x: (0) y: (71)\nforever\n    wait (0.1) seconds\n    turn right (15) degrees\nend\n\nwhen [space v] key pressed\nswitch backdrop to (3 \(1\)8 v)\n\nwhen backdrop switches to [3 \(1\)5 v]\ndelete this clone\n\nwhen backdrop switches to [3 \(1\)6 v]\nhide\n\n@Sprite1\n\nwhen flag clicked\nhide\n\nwhen backdrop switches to [3 \(1\)6 v]\ngo to x: (7) y: (35)\nswitch costume to (costume1 v)\nshow\nforever\n    turn right (5) degrees\nend\n\nwhen backdrop switches to [3 \(1\)8 v]\nhide\n\nwhen backdrop switches to [3 \(1\)11 v]\nstop [other scripts in sprite v]\ngo to x: (-90) y: (25)\nswitch costume to (costume2 v)\nshow\nforever\n    turn right (-5) degrees\nend\n\nwhen backdrop switches to [21 v]\nhide\n\nwhen backdrop switches to [3 \(1\)12 v]\nhide\n\n@Sprite2\n\nwhen flag clicked\nhide\n\nwhen backdrop switches to [3 \(1\)8 v]\nshow\nset [ghost v] effect to (0)\ngo to x: (0) y: (0)\nforever\n    repeat (40)\n        change x by (5)\n    end\n    repeat (40)\n        change x by (-5)\n    end\nend\n\nwhen backdrop switches to [21 v]\nhide\n\nchange y by (10)\n\nwhen backdrop switches to [3 \(1\)9 v]\nhide\n\n@Sprite3\n\nwhen flag clicked\nhide\n\nwhen backdrop switches to [3 \(1\) v]\ngo to x: (-6) y: (13)\nswitch costume to (costume1 v)\nshow\nforever\n    glide (0.5) secs to x: (-6) y: (13)\n    glide (0.5) secs to x: (-6) y: (6)\nend\n\nwhen backdrop switches to [11 v]\nhide\n\nwhen backdrop switches to [3 \(1\)8 v]\nstop [other scripts in sprite v]\ngo to x: (24) y: (6)\nshow\nswitch costume to (costume2 v)\nforever\n    glide (0.5) secs to x: (24) y: (6)\n    glide (0.5) secs to x: (24) y: (-2)\nend\n\nwhen backdrop switches to [21 v]\nhide\n\nwhen backdrop switches to [3 \(1\)9 v]\nstop [other scripts in sprite v]\ngo to x: (-6) y: (13)\nswitch costume to (costume3 v)\nshow\nforever\n    glide (0.5) secs to x: (-6) y: (13)\n    glide (0.5) secs to x: (-6) y: (6)\nend\n\nwhen backdrop switches to [3 \(1\)10 v]\nhide\n\nwhen backdrop switches to [2 v]\nstop [other scripts in sprite v]\ngo to x: (-6) y: (13)\nswitch costume to (costume4 v)\nshow\nforever\n    glide (0.5) secs to x: (-6) y: (13)\n    glide (0.5) secs to x: (-6) y: (6)\nend\n\n@Sprite4\n\nwhen flag clicked\nhide\n\nwhen backdrop switches to [3 \(1\) v]\nset size to (100) %\nshow\ngo [backward v] (50) layers\nswitch costume to (costume6 v)\nforever\n    repeat (13)\n        next costume\n        wait (0.05) seconds\n    end\nend\n\nwhen backdrop switches to [11 v]\nhide\nstop [other scripts in sprite v]\n\nwhen backdrop switches to [3 \(1\)2 v]\nshow\ngo [backward v] (50) layers\nswitch costume to (costume6 v)\nforever\n    repeat (13)\n        next costume\n        wait (0.05) seconds\n    end\nend\n\nwhen backdrop switches to [3 \(1\)3 v]\nhide\nstop [other scripts in sprite v]\n\nwhen backdrop switches to [3 \(1\)5 v]\nshow\ngo [backward v] (50) layers\nswitch costume to (costume6 v)\nforever\n    repeat (13)\n        next costume\n        wait (0.05) seconds\n    end\nend\n\nwhen backdrop switches to [3 \(1\)7 v]\nhide\nstop [other scripts in sprite v]\n\nwhen backdrop switches to [3 \(1\)6 v]\nshow\ngo [backward v] (50) layers\nswitch costume to (costume6 v)\nforever\n    repeat (13)\n        next costume\n        wait (0.1) seconds\n    end\nend\n\nwhen backdrop switches to [21 v]\nhide\nstop [other scripts in sprite v]\n\nchange [pixelate v] effect by (25)\n\n@Sprite5\n\nwhen flag clicked\nhide\n\nwhen backdrop switches to [3 \(1\)9 v]\ngo to [back v] layer\nshow\ngo to x: (36) y: (-100)\nforever\n    repeat (40)\n        change y by (5)\n    end\n    repeat (40)\n        change y by (-5)\n    end\nend\n\nwhen backdrop switches to [21 v]\nhide\n\nwhen backdrop switches to [3 \(1\)10 v]\nhide\n\n@Sprite6\n\nwhen flag clicked\ngo to x: (42) y: (27)\nhide\n\nwhen backdrop switches to [3 \(1\)10 v]\nshow\n\nwhen backdrop switches to [3 \(1\)11 v]\nhide\n\nwhen I receive [vv v]\nrepeat (16)\n    change y by (-10)\nend\nwait (3) seconds\nrepeat (34)\n    change y by (5)\nend\n\n@Sprite7\n\nwhen flag clicked\nhide\n\nwhen backdrop switches to [3 \(1\)11 v]\nshow\nforever\n    next costume\n    wait (0.7) seconds\nend\n\nwhen backdrop switches to [3 \(1\)12 v]\nhide\n\n@Sprite8\n\nwhen flag clicked\nhide\ngo to x: (28) y: (15)\n\nwhen backdrop switches to [3 \(1\)12 v]\nshow\nforever\n    repeat (20)\n        change y by (-2)\n    end\n    repeat (20)\n        change y by (2)\n    end\nend\n\nwhen backdrop switches to [3 \(1\)13 v]\nhide\n\n@Sprite9\n\nwhen flag clicked\nhide\n\nwhen backdrop switches to [3 \(1\)12 v]\nshow\nset [ghost v] effect to (0)\ngo to x: (-150) y: (30)\nforever\n    repeat (30)\n        change x by (5)\n    end\n    repeat (30)\n        change x by (-5)\n    end\nend\n\nwhen backdrop switches to [21 v]\nhide\n\nchange y by (10)\n\nwhen backdrop switches to [3 \(1\)13 v]\nhide\n\n