9. Platformer

Instructions: Je gebruikt de pijltjes om het balletje te besturen je mag geen rood raken. Om het volgende level te halen moet je aan de rand komen. \n\nsuc6

@Stage\n\nwhen backdrop switches to [achtergrond7 v]\nforever\n    change [color v] effect by (25)\n    wait (0.05) seconds\nend\n\n@Bal\n\nwhen flag clicked\nshow\ngo to x: (-192) y: (-108)\nset [level v] to [1]\nset [x snelheid v] to [0]\nset [y snelheid v] to [0]\nswitch backdrop to (achtergrond1 v)\nforever\n    create clone of (_myself_ v)\n    if <key (right arrow v) pressed?> then\n        change [x snelheid v] by (1)\n        create clone of (_myself_ v)\n    end\n    if <key (left arrow v) pressed?> then\n        change [x snelheid v] by (-1)\n        create clone of (_myself_ v)\n    end\n    set [x snelheid v] to ((x snelheid) * (0.9))\n    change x by (x snelheid)\n    change [y snelheid v] by (-1)\n    change y by (y snelheid)\n    if <touching color (#05ff00)?> then\n        change y by ((y snelheid) * (-1))\n        set [y snelheid v] to [0]\n    end\n    change y by (-1)\n    if <touching color (#05ff00)?> then\n        if <key (up arrow v) pressed?> then\n            set [y snelheid v] to [15]\n            create clone of (_myself_ v)\n        end\n    end\n    if <key (up arrow v) pressed?> then\n        create clone of (_myself_ v)\n    end\n    change y by (1)\n    if <touching color (#05ff00)?> then\n        change x by ((x snelheid) * (-1))\n        if <(x snelheid) > [0]> then\n            set [x snelheid v] to [-5]\n        else\n            set [x snelheid v] to [5]\n        end\n    end\n    if <touching (lijn v)?> then\n        change [level v] by (1)\n        switch backdrop to (next backdrop v)\n        broadcast (bericht1 v)\n        go to x: (-192) y: (-108)\n    end\n    if <touching color (#ff0000)?> then\n        go to x: (-192) y: (-108)\n        set [y snelheid v] to [0]\n        set [x snelheid v] to [0]\n    end\n    if <touching (springplank v)?> then\n        set [y snelheid v] to [20]\n    end\n    if <touching (springplank2 v)?> then\n        set [y snelheid v] to [20]\n    end\n    if <touching (springplank3 v)?> then\n        set [y snelheid v] to [20]\n    end\n    if <touching (spikes v)?> then\n        go to x: (-192) y: (-108)\n        set [y snelheid v] to [0]\n        set [x snelheid v] to [0]\n    end\nend\n\nwhen I start as a clone\nrepeat (10)\n    change [ghost v] effect by (10)\nend\ndelete this clone\n\nwhen backdrop switches to [achtergrond7 v]\nhide\n\n@lijn\n\n@springplank\n\nwhen flag clicked\nswitch costume to (1 v)\nhide\nforever\n    if <touching (bal v)?> then\n        set size to (72) %\n        switch costume to (2 v)\n        wait (0.5) seconds\n        set size to (89) %\n        switch costume to (1 v)\n    end\nend\n\nwhen backdrop switches to [1 v]\nshow\n\nwhen backdrop switches to [0.1 v]\nhide\n\nwhen backdrop switches to [achtergrond7 v]\nhide\n\nwhen backdrop switches to [3 v]\nshow\n\n@springplank2\n\nwhen backdrop switches to [3 v]\nshow\n\nwhen backdrop switches to [achtergrond7 v]\nhide\n\nwhen flag clicked\nhide\n\n@springplank3\n\nwhen backdrop switches to [3 v]\nshow\n\nwhen backdrop switches to [achtergrond7 v]\nhide\n\nwhen flag clicked\nhide\n\n@Sprite1\n\nwhen I receive [bericht1 v]\nnext costume\n\nwhen flag clicked\nswitch costume to (1 v)\n\n@spikes\n\nwhen backdrop switches to [14 v]\ngo to x: (102) y: (57)\nset size to (50) %\nshow\n\nwhen flag clicked\nset size to (100) %\ngo to x: (33) y: (-148)\nhide\n\nwhen backdrop switches to [sike v]\nshow\n\nwhen backdrop switches to [lol v]\nhide\n\nwhen backdrop switches to [achtergrond2 v]\nhide\n\n