-
Helicopter Game: mouse-guided?
I'm building a helicopter game:
www.blindslim.com/copter
Right now, the arrow keys and the spacebar control the helicopter.
I WANT the mouse to control it:
mouse button: altitude (fly, or don't)
And moving the mouse forward moves the copter forward, etc.
It seems like there would be an easy way to convert my current code to make this change.
I'm close with getting the mouse button to work. But my question pertains more to the directional guidance.
HOW can I do this? Tracking mouse coords? Anybody got a quick idea on this thing?
+ + + + + + + + + + + + + +
shut up, I know I'm right!
-
Ninja Rider
Just make the helicopter "fly" to the position of the mouse then.
Feels like that if you construct it so that if you move your mouse forward, the helicopter will fly forword you get a strange feeling that the helicopter will fly very strange.
To get it smooth, just let the helicopter move towards the pointer.
You have the mouse x and y coordinates in:
_root._xmouse and
_root._ymouse
Nice enviroment in the game!
Show me the way to the next whiskeybar ...
-
hi could you tell me how to get the mouse button to move a movie clip
i like youre helicopter game is th helicopter 3d what program did you make the helicopter with
thanks bob
-
would someone be able to give a more detailed script of how to use the mose button to controll vertical axis of helicopter
-
I dont know if this is what you wanted ... but , try this code :
Code:
onEnterFrame = function(){
if (_ymouse > _root.Copter._y){
_root.Copter._y += 5;
}
if (_ymouse < _root.Copter._y){
_root.Copter._y -= 5;
}
if (_xmouse > _root.Copter._x){
_root.Copter._x += 5;
}
if (_xmouse < _root.Copter._x){
_root.Copter._x -= 5;
}
}
I hope this is what you wanted ... and instead of spacebar you can use onPress ...
Thanks...
-
Ninja Rider
example
something like this if you have a mc that is called "h".
Code:
h.onEnterFrame = function() {
this._x++;
this._y++;
};
_root.onMouseDown = function() {
_root.h.onEnterFrame = function() {
this._x++;
this._y -= 1;
};
};
_root.onMouseUp = function() {
_root.h.onEnterFrame = function() {
this._x++;
this._y++;
};
};
But you want of course the background to move instead of the helicopter..
good luck!
Show me the way to the next whiskeybar ...
-
Senior Member
By vertical do you mean y axis or the z axis?
In either case see if this helps:
Last edited by Speed85; 08-13-2007 at 02:46 PM.
-
When in doubt ask
Please watch the attached movie.
Last edited by Eager Beaver; 08-19-2007 at 02:23 PM.
<signature removed by admin>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|