| Home | Tutorials | Forums | Articles | Blogs | Movies | Library | Employment | Press | Buy templates |
|
|
#1 |
|
Registered User
Join Date: Mar 2002
Location: zurich, switzerland
Posts: 65
|
Hello
I'm swiss. I hope you'll understand my english. I have the following problem: I'm creating a game. I have a flying helicopter which can land on mountains or platforms. I'd like to attach a charakter (man) on a mountain. I want to pick up the man with the helicopter, and drop it again on a different area. I have the following script attached to the "man" charakter: onClipEvent(enterFrame) { if(hitTest("_parent.heli")) { _x=_parent.heli._x; _y=_parent.heli._y; (_parent.heli._height/2); } This works to attach the man to the heli, but it hides the charakter behing the heli, i want it to be attached under the heli. What do I have to change??? How can I drop the charakter over a different area ??? thanks in advance for any help, tips or examples regards cuba |
|
|
|
|
|
#2 |
|
The Placid Casual
Join Date: Oct 2001
Location: Malta
Posts: 1,026
|
You either have to move the man character inside the movie or change the line _y=_parent.heli._y; to _y=_parent.heli._y + 10;(change ten depending on the size of the helicopter). The x will be defined from the centre of the movie. I would go for the first option and keep it simple.
SFA |
|
|
|
|
|
|
|
|
#3 |
|
Even graphists R objects
Join Date: Jun 2001
Location: Paris
Posts: 269
|
Hi cuba,
If your rescued people are attached mc's, you should consider at least two scenarios for them. The first one as you wrote it allow you to find them on mountains. Then, when they hit the chopper, you could destroy their first occurence and attach them again into the chopper clip (there you also could place their clips between a front clip of your chopper and a background clip to give a good illusion they seat inside the chopper). At the end you will also have to imagine a third scenario when you arrive at your base, allowing them to get off the chopper and have a nice cup of tea into the base. One good point with that way is that you won't have to perpetually execute your enterFrame code after you rescued your people. Into the chopper they won't have to do nothing but wait for safe landing. Hope you understood me. BZen
__________________
Oh Lord, shut me down ! |
|
|
|
|
|
#4 |
|
Registered User
Join Date: Mar 2002
Location: zurich, switzerland
Posts: 65
|
thanks i will try this. but how can i drop the "character", with
_droptarget ???? or do you have another idea??? thanks a lot regards cuba |
|
|
|
|
|
#5 |
|
Even graphists R objects
Join Date: Jun 2001
Location: Paris
Posts: 269
|
You can use the same hitTest method on your base to check when your chopper lands and then automaticly launch an animation showing your rescued characters being saved. Just before destroy their instancies into the chopper.
Hope it helps, BZen
__________________
Oh Lord, shut me down ! |
|
|
|
|
|
#6 |
|
Registered User
Join Date: Mar 2002
Location: zurich, switzerland
Posts: 65
|
Hi mozilla
I tried to attach your sample script to the character man, but it doesn't work. I think i need to attach a script to the helicopter, because it can land without any problem. I didn't understood the "trace"-thing, i always had a debugger window: with the "not allowed to land window"... I hope that you understand me... Thanks again for your kind help ! Hi again (Thanks Mozilla for your reply) I have still the problem, that it's possible to land, without going to save the person (character:man) If the player wants to land, without having saved the person, a message should appear: "not allowed to land, save the person" I have the following actions for the helicopter to land: function checkForLand () { landed = true; for (i=0; i<footPoints.length; i++) { footDown = false; for (j=0; j<bars.length; j++) { if (bars[j].hitTest(heli._x+footPoints[i].x, heli._y+footPoints[i].y, true)) { footDown = true; break; } } if (!footDown) { landed = false; break; } } if (heli.dy>3.0) { landed = false; } if (landed) { gotoAndPlay (_currentframe+1); gameLevel++; And these actions are for the character: onClipEvent (enterFrame) { if (hitTest("_parent.heli")) { _x = _parent.heli._x; _y = _parent.heli._y+50; (_parent.heli._height/2); } } onClipEvent (enterFrame) { if (hitTest("_parent.hospital1")) { _x = _parent.hospital1._x-0; _y = _parent.hospital1._y-1; (_parent.hospital1._height/2); } } Thanks in advance for your help... regards from zurich, switzerland cuba Last edited by cuba; 03-10-2002 at 07:26 PM.. |
|
|
|
|
|
#7 |
|
mimi
Join Date: Jun 2001
Location: the fruhling
Posts: 161
|
did you try? what didn't work? please specify problem. (or post fla)
greeZ |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [AS2] hitTest problem, Game Bomb | VVV | Gaming and Game Development | 1 | 09-02-2004 02:55 PM |
| hitTest in a little game | mullwaden | Gaming and Game Development | 7 | 11-29-2003 01:27 PM |
| game hitTest problem | masha | Gaming and Game Development | 3 | 03-20-2003 06:42 PM |
| basic game problems, score board, hitTest sounds, and a big one | ninjacore | Gaming and Game Development | 3 | 01-03-2003 03:05 PM |
| game hittest problem | marco66 | Gaming and Game Development | 7 | 10-21-2002 04:11 PM |