All pastes #748409 Raw Edit

Someone

public text v1 · immutable
#748409 ·published 2007-10-24 20:00 UTC
rendered paste body
onClipEvent (load) {
	movespeed = 5;
	velocity = 0;
	airborne = true;
}
onClipEvent (enterFrame) {
	if(Key.isDown(KEY.RIGHT)) {
		this._x += movespeed;
		this.nextFrame();
	}
	if(Key.isDown(KEY.LEFT)) {
		this._x -= movespeed;
		this.prevFrame();
	}
	
	if (_root.ground.hitTest(this)) {
		airborne = false;
	}
	if (!_root.ground.hitTest(this)) {
		airborne = true;
	}
	if (airborne == true) {
		this._y -= velocity;
		velocity -= 2;
	}
	if (airborne == false) {
		velocity = 0;
	}
}
on(keyPress "<Space>") {
	velocity = 40;
	airborne == true;
}