Hi there, this is my first post n am new here so plz b nice I:-)
Im tryin 2 make a flash game of a space ship that moves using the arrow keys. i have managed 2 simulate a gravity effect and assign the arrow keys to their proper direction eg: left:rotate left, right:rotate right and up:accelerate.
my problem is that my ship will not accelerate in the direction in which it is facing.
the code for my ship so far is:
onClipEvent (load) {
moveSpeed = 5;
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.UP) and this._y>=35) {
this._y -= 5;
}
}
onClipEvent (enterFrame) {
if (this._y<=395) {
this._y = _y+2;
}
}
onClipEvent (enterFrame) {
if (this.hitTest(_root.ground)) {
_root.gotoAndStop(2);
}
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.RIGHT)) {
_root.ship._rotation = _root.ship._rotation+12.5;
_root.ship._rotation = _root.ship._rotation;
}
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.LEFT)) {
_root.ship._rotation = _root.ship._rotation-12.5;
_root.ship._rotation = _root.ship._rotation;
}
}
i no im no pro in this field of flash mx style pain and most of this code is probably just bollox, but ive been tryin 4 a good while now, n ive searched high and low for a tutorial but 2 no avail.
i hope you understand wat im tryin 2 get at, coz i dont ave a clue :goatee:
Please help, Please!!!
thanks
‘’‘You Might as well kill yourself, your already dead.’‘’