Obsidian: A platformer
@Stage\n\nwhen flag clicked\nswitch backdrop to (bleagh v)\n\nwhen I receive [message1 v]\nset [level v] to [1]\nswitch backdrop to (backdrop1 v)\n\nwhen I receive [next level v]\nnext backdrop\nchange [level v] by (1)\n\nwhen I receive [message1 v]\nforever\n    if <(level) = [8]> then\n        broadcast (CLOSER v)\n    end\n    if <(level) = [12]> then\n        broadcast (DEATH v)\n        switch backdrop to (bleagh v)\n    end\nend\n\n@Sprite1\n\nwhen I receive [message1 v]\nshow\ngo to x: (-217) y: (150)\nset [xv v] to [0]\nset [yv v] to [0]\nforever\n    if <key (right arrow v) pressed?> then\n        change [xv v] by (1)\n        switch costume to (costume1 v)\n    end\n    if <key (left arrow v) pressed?> then\n        change [xv v] by (-1)\n        switch costume to (costume2 v)\n    end\n    set [xv v] to ((Xv) * (0.9))\n    change x by (Xv)\n    if <touching color (#0ba501)?> then\n        change y by (1)\n        if <touching color (#0ba501)?> then\n            change y by (1)\n            if <touching color (#0ba501)?> then\n                change y by (1)\n                if <touching color (#0ba501)?> then\n                    change y by (1)\n                    if <touching color (#0ba501)?> then\n                        change y by (1)\n                        if <touching color (#666666)?> then\n                            change x by ((Xv) * (-1))\n                            change y by (-5)\n                            if <key (up arrow v) pressed?> then\n                                if <(Xv) > [0]> then\n                                    set [xv v] to [-5]\n                                else\n                                    set [xv v] to [5]\n                                end\n                                set [yv v] to [10]\n                            else\n                                set [xv v] to [0]\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change [yv v] by (-1)\n    change y by (Yv)\n    if <touching color (#0ba501)?> then\n        change y by ((Yv) * (-1))\n        set [yv v] to [0]\n    end\n    change y by (-1)\n    if <touching color (#0ba501)?> then\n        if <key (up arrow v) pressed?> then\n            set [yv v] to [15]\n        end\n    end\n    change y by (1)\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [message1 v]\nforever\n    if <touching color (#ff0000)?> then\n        set [yv v] to [19]\n    end\n    if <touching color (#ffd41b)?> then\n        change [deaths v] by (1)\n        go to x: (-224) y: (-65)\n        set [yv v] to [0]\n    end\nend\n\nwhen I receive [death v]\nhide\nstop [other scripts in sprite v]\n\nwhen I receive [next level v]\ngo to x: (-224) y: (-65)\n\n@Sprite2\n\nwhen flag clicked\nhide\n\nwhen I receive [message1 v]\ngo [backward v] (100) layers\nforever\n    show\n    switch costume to (pick random (1) to (4))\n    go to x: (pick random (-215) to (190)) y: (pick random (-2) to (150))\n    show\n    glide (pick random (2) to (5)) secs to x: (215) y: (pick random (-2) to (150))\n    create clone of (_myself_ v)\n    hide\nend\n\nwhen I receive [closer v]\nhide\n\nwhen I start as a clone\ngo [backward v] (100) layers\nforever\n    show\n    switch costume to (pick random (1) to (4))\n    go to x: (pick random (-215) to (190)) y: (pick random (-2) to (150))\n    show\n    glide (pick random (2) to (5)) secs to x: (215) y: (pick random (-2) to (150))\n    hide\n    delete this clone\nend\n\nwhen I receive [death v]\nstop [other scripts in sprite v]\nhide\n\n@Sprite3\n\nwhen flag clicked\nhide\n\nwhen I receive [message1 v]\ngo [backward v] (100) layers\nforever\n    show\n    switch costume to (pick random (1) to (4))\n    go to x: (pick random (-215) to (190)) y: (pick random (-2) to (150))\n    show\n    glide (pick random (2) to (5)) secs to x: (215) y: (pick random (-2) to (150))\n    create clone of (_myself_ v)\n    hide\nend\n\nwhen I receive [death v]\nstop [other scripts in sprite v]\nhide\n\nwhen I start as a clone\ngo [backward v] (100) layers\nforever\n    show\n    switch costume to (pick random (1) to (4))\n    go to x: (pick random (-215) to (190)) y: (pick random (-2) to (150))\n    show\n    glide (pick random (2) to (5)) secs to x: (215) y: (pick random (-2) to (150))\n    hide\n    delete this clone\nend\n\n@Sprite4\n\nwhen flag clicked\nshow\ngo to x: (0) y: (0)\nset [ghost v] effect to (100)\nrepeat (100)\n    change [ghost v] effect by (-1)\nend\nbroadcast (message2 v)\n\nwhen I receive [message3 v]\nrepeat (100)\n    change [ghost v] effect by (1)\nend\nhide\nbroadcast (message1 v)\n\n@Sprite5\n\nwhen flag clicked\nhide\ngo to x: (-20) y: (-10)\n\nwhen I receive [message2 v]\ngo to [front v] layer\nshow\n\nwhen this sprite clicked\nbroadcast (message3 v)\nrepeat (100)\n    change [ghost v] effect by (1)\nend\nhide\n\n@Sprite6\n\nwhen flag clicked\ngo to x: (-7) y: (-43)\nhide\n\nwhen I receive [message1 v]\nshow\nforever\n    if <touching (sprite1 v)?> then\n        broadcast (next level v)\n    end\n    if <(level) = [6]> then\n        go to x: (3) y: (-47)\n    end\n    if <(level) = [12]> then\n        broadcast (DEATH v)\n    end\nend\n\nwhen I receive [death v]\nhide\nstop [other scripts in sprite v]\n\n@Sprite7\n\nwhen flag clicked\nhide variable [deaths v]\nset [ghost v] effect to (100)\nswitch costume to (costume1 v)\nhide\n\nwhen I receive [death v]\nset [ghost v] effect to (0)\nshow\ngo to [front v] layer\nrepeat (8)\n    go to x: (0) y: (0)\n    wait (1) seconds\n    glide (0.5) secs to x: (1000) y: (0)\n    go to x: (-1000) y: (0)\n    next costume\n    glide (1) secs to x: (0) y: (0)\nend\nrepeat (11)\n    go to x: (0) y: (0)\n    wait (0.08) seconds\n    next costume\nend\n\n@Sprite8\n\nwhen flag clicked\nset size to (75) %\nset [eh v] to [0]\nhide\n\nwhen I receive [message1 v]\ngo to x: (-194) y: (145)\nswitch costume to (costume1 v)\nshow\nstart sound (pick random (1) to (5))\n\nwhen I receive [death v]\nhide\nstop [other scripts in sprite v]\n\nplay sound [ v] until done\n\nwhen this sprite clicked\nchange [eh v] by (1)\nif <<<(eh) = [1]> or <(eh) = [3]>> or <<<(eh) = [5]> or <(eh) = [7]>> or <<(eh) = [9]> or <(eh) = [11]>>>> then\n    stop all sounds\n    switch costume to (costume2 v)\nend\nif <<<(eh) = [2]> or <(eh) = [4]>> or <<<(eh) = [6]> or <(eh) = [8]>> or <<(eh) = [10]> or <(eh) = [12]>>>> then\n    switch costume to (costume1 v)\n    forever\n        play sound (pick random (1) to (5)) until done\n    end\nend\n\n@Sprite9\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\n\nwhen I receive [egh v]\nshow\nwait (0.1) seconds\nhide\n\n@Sprite10\n\nwhen flag clicked\nhide\n\ngo to x: (0) y: (0)\n\n
Green flag twice\n\nUp arrow to jump\n\nLeft arrow to move left\n\nRight arrow to move right