Play free games online!


Go Back   The Game Homepage Forums > Development > Flash Development

Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 03-13-2008, 11:21 PM
Gamer
Tin Can
Better than 24.05% Better than 24.05% Better than 24.05%
 

Join Date: Mar 2008
Posts: 4
jbjb1228 is on a distinguished roadjbjb1228 is on a distinguished road
Default Help!!

I have been trying to figure out how to build something like the helicopter game.

I cant figure out how to control the movieclip (copter) with mouse.down. I have flash 8, and i've gotten this
onClipEvent (enterFrame) {
if (Mouse.DOWN){
copter = _root.Mouse._x
ps. i know this code is probably completely wrong

If any1 can help me i would really appriciate it, im completely stumped, and i cant find anything online on how to do it.
Thanks

Last edited by jbjb1228; 03-13-2008 at 11:26 PM. Reason: needed to add
Reply With Quote
  #2  
Old 03-20-2008, 06:55 PM
Bigmutha's Avatar
Moderator
Power Drill
Better than 70.11% Better than 70.11% Better than 70.11%
 

Join Date: Aug 2007
Location: Chico, California
Posts: 1,757
Bigmutha is a jewel in the roughBigmutha is a jewel in the rough
Send a message via AIM to Bigmutha Send a message via MSN to Bigmutha
Default

Quote:
Originally Posted by jbjb1228 View Post
I have been trying to figure out how to build something like the helicopter game.

I cant figure out how to control the movieclip (copter) with mouse.down. I have flash 8, and i've gotten this
onClipEvent (enterFrame) {
if (Mouse.DOWN){
copter = _root.Mouse._x
ps. i know this code is probably completely wrong

If any1 can help me i would really appriciate it, im completely stumped, and i cant find anything online on how to do it.
Thanks
I'm no expert scripter either, but I think that will make the movieclip named copter got to the mouses X position. So it will slide along a horizontal line staying at the same height. I found a tutorial once on how to make a game like that. Give me a few mins and I'll go find it again.

Ok, the tutorial wasn't exactly what I thought it was, but I managed to get this piece if script which will make the copter behave a little bit like the actual one.
Code:
  1. gravity = 0.1;
  2. thrust = 0.25;
  3. yspeed = 0;
  4. xspeed = 5;
  5. smoke_interval = 10000;
  6. frames_passed = 0;
  7. engines = false;
  8. _root.attachMovie("ship", "ship", _root.getNextHighestDepth(), {_x:150, _y:200});
  9. ship.filters = new Array(ship_filter);
  10. ship.onEnterFrame = function(){
  11. if(engines){
  12. yspeed -= thrust;
  13. smoke_interval -= 0.25;
  14. }
  15. yspeed += gravity;
  16. this._y += yspeed;
  17. angle = Math.atan2(yspeed, xspeed); this._rotation = angle*180/Math.PI;
  18. frames_passed++;
  19. if (frames_passed>=smoke_interval){
  20. sm = _root.attachMovie("smoke", "smoke"+_root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:this._x-2, _y:this._y});
  21. sm.filters = new Array(smoke_filter);
  22. sm.onEnterFrame = function(){
  23. this._x -= xspeed;
  24. this._alpha -= 2;
  25. if(this._alpha<=0) {
  26. this.removeMovieClip();
  27. }
  28. };
  29. frames_passed = 0;
  30. }
  31. };
__________________

Last edited by Bigmutha; 03-20-2008 at 07:13 PM. Reason: Added Script
Reply With Quote
  #3  
Old 03-20-2008, 08:08 PM
Gaz's Avatar
Gaz Gaz is offline
Administrator
Power Drill
Better than 63.25% Better than 63.25% Better than 63.25%
 

Join Date: Jun 2007
Location: Ipswich, UK
Posts: 1,022
Gaz is a splendid one to beholdGaz is a splendid one to beholdGaz is a splendid one to beholdGaz is a splendid one to beholdGaz is a splendid one to beholdGaz is a splendid one to beholdGaz is a splendid one to beholdGaz is a splendid one to beholdGaz is a splendid one to behold
Default

bigmutha is right the code you are using looks more like it's intended to make the helicopter go to where your mouse is (although it's not quite right in any case). Is that what you are aiming for or do you want the helicopter to travel upwards when the mouse is clicked (like in the game copter)?
Reply With Quote
Sponsored Links
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 01:13 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2007, Crawlability, Inc.

Ad Management by RedTyger