All pastes #780905 Raw Edit

Mine

public text v1 · immutable
·published 2007-11-18 18:30 UTC
rendered paste body
onClipEvent (load) {
	var xvar = 0;
	var yvar = 0;
	friction = 0.95;
	myBounce = 10;
}
onClipEvent (enterFrame) {
	xvar *= friction;
	yvar *= friction;
	_x -= xvar;
	_y -= yvar;
	if (Key.isDown(87)) {
		yvar++;
		_root.char._y -= _root.speed;
	}
	if (Key.isDown(83)) {
		yvar--;
		_root.char._y += _root.speed;
	}
	if (Key.isDown(68)) {
		xvar--;
		_root.char._x += _root.speed;
	}
	if (Key.isDown(65)) {
		xvar++;
		_root.char._x -= _root.speed;
	}
	if (Key.isDown(Key.UP)) {
		yvar++;
		_root.char._y -= _root.speed;
	}
	if (Key.isDown(Key.DOWN)) {
		yvar--;
		_root.char._y += _root.speed;
	}
	if (Key.isDown(Key.RIGHT)) {
		xvar--;
		_root.char._x += _root.speed;
	}
	if (Key.isDown(Key.LEFT)) {
		xvar++;
		_root.char._x -= _root.speed;
	}
	if (_root.die == true && _root.maze.hitTest(_root.char._x, _root.char._y, true)) {
		_root.life.gotoAndStop(_root.life._currentframe += 1);
	}
	if (_root.die == true && _root.invi.hitTest(_root.char)) {
		_root.die = false;
		_root.invi.play();
	}
	if (_root.die == false && _root.maze.hitTest(getBounds(_root.char).xMax, _root.char._y, true)) {
		_root.char._x -= myBounce;
	}
	if (_root.die == false && _root.maze.hitTest(getBounds(_root.char).xMin, _root.char._y, true)) {
		_root.char._x += myBounce;
	}
	if (_root.die == false && _root.maze.hitTest(_root.char._x, getBounds(_root.char).yMax, true)) {
		_root.char._y -= myBounce;
	}
	if (_root.die == false && _root.maze.hitTest(_root.char._x, getBounds(_root.char).yMin, true)) {
		_root.char._y += myBounce;
	}
}