- var levens = 3;
- //initialisatiescript
- var toets = "";
- //besturing
- Key.addListener(this);
- function onKeyDown() {
- toets = Key.getCode();
- }
- function onKeyUp() {
- toets = "";
- bal.gotoAndStop(1);
- }
- function onEnterFrame() {
- oudex = bal._x;
- oudey = bal._y;
- vijand._x += 20;
- if (vijand._x>550) {
- vijand._x = -50;
- vijand._y = Math.round(Math.random()*450+25);
- }
- if (bal.hitTest(vijand) && vijand._visible) {
- levens--;
- vijand._visible = false;
- }
- leven._x += 20;
- if (leven._x>550) {
- leven._x = -50;
- leven._y = Math.round(Math.random()*450+25);
- }
- if (bal.hitTest(leven) && leven._visible) {
- levens++;
- leven._visible = false;
- }
- if (toets == 39) {
- bal._x += 20;
- bal.gotoAndStop(2);
- }
- if (toets == 37) {
- bal._x -= 20;
- bal.gotoAndStop(3);
- }
- if (toets == 38) {
- bal._y -= 20;
- }
- if (toets == 40) {
- bal._y += 20;
- }
- if (bal._x>500) {
- bal._x = 500;
- }
- if (bal._x<50) {
- bal._x = 50;
- }
- if (bal._y>450) {
- bal._y = 450;
- }
- if (bal._y<0) {
- bal._y = 0;
- }
- for (a=1; a<=5; a++) {
- if (bal.hitTest("_root.doolhof.muur"+a)) {
- bal._x = oudex;
- bal._y = oudey;
- }
- }
- }
STYLO
By: KARIMO | Date: Mar 7 2007 12:38 | Format: None | Expires: never | Size: 1.15 KB | Hits: 1393
Latest pastes
1 days ago
1 days ago
2 days ago
3 days ago
5 days ago