Collision detection / video clip after another

I'm working on a shooting game space horizontal scrolling, and I hit a snag: the clip of rocket has two nested layers, for the ship itself and the other for a cycle of animation of the flames out by behind.  The ship loses health when it collides with an enemy ship, but given that the two bodies of the ship and the flames are part of the same clip, the ship, of course, also loses health when the flames hit an enemy ship.  What I'm trying to do, is change it so the fire will destroy the enemy ships, but the player loses all health.  My first inclination was to separate the flames in their own clip and simply attach the ship - that is to say, the clip of flames is basically apparent aboard the ship, on a layer below, but is controlled by a separate script as the ship itself.  The flames would be aligned with the ship, and when the ship is moving, the flames are moving.  Pretty simple.  So far, I have found no effective way to do this.  I tried alternatives (masking, etc, etc) nothing works.  I work in Flash 8, AS2.  Each video clip has its own class.  I can view the code if necessary.  Any advice, or simply a point in the right direction would be greatly appreciated.  Thank you!

use:

}
If (this.hitTest (_root.ship.shipBody))
{
If (_root. Ship.Shield._visible is false)
{
_root. Ship.updateHealth (-20);
}
explode();
}

If (this.) HitTest (_root. Ship.shipFlames) {/ / assuming shipFlames is correct}

explode();  Assuming you want the enemy to the discovery of the touch of flame

}

Tags: Adobe Animate

Similar Questions

  • How do I share one video clip to another?

    im doing a drop and a drop of game and I would like to share one video clip to another...

    the first clip is draggable mc, when it hits the drop zone, that I plan to put an animated version of this...

    from now on, this is the code I use...

    If (eval (this._droptarget) == pitsel_mc) {}
    This ._x = this ._x;
    This ._y = this ._y;
    } else {}
    This ._x = start1x;
    This ._y = start1y;

    }

    as you can see, after leaving the mc in the drop zone, the mc just stayed on his position...

    Is there a script to exchange it for an animated version of the current mc?

    I hope you guys could help...

    use:

    sugar_mc.onRelease = function() {}
    this.stopDrag ();
    If (eval (this._droptarget) == pitsel_mc) {}
    var mc:MovieClip=attachMovie("sugarpour","sugarpour",getNextHighestDepth());

    MC._x = this ._x;

    MC._y = this ._y;

    this.swapDepths (getNextHighestDepth ());

    this.removeMovieClip ();

    } else {}
    back to start pos
    This ._x = start1x;
    This ._y = start1y;
    }
    };

    p.s. Please mark this thread as answered, if you can.

  • Is it possible to crop a video clip after that I have turn?

    I shot a clip due to the bad my helmet camera mount.  Is it possible to crop the video clip after turning point 4 degrees?  I would not lose this sequence, but I can't use it as it is.

    I tried a clip on my computer and it worked.  My images of entry was 1920x1080p60.  At the end I chose AVCHD section and picked up a 1080 p 30, pushed the button advanced and then pressed the button Source Match.

    If you have a combination that does not work and I have one that does.

    Now I'm curious.  If you want to send the clip via dropbox or something, I can give it a try.

    Bill

  • How can I change the speed of a video clip after which makes a smart object?

    In order to apply the same Camera Raw filter for each segment of a clip that I was going to split several times, I have converted the full clip to a smart object, applied my settings Camera Raw filter and then split the clip and remove parts.  Now, I want to do some parts of these clips slowed, but even if I right click on the right side of the layer and select 'Clear Smart Filters', all I see when I right click on the item in the Assembly are query options; I can change is no longer the speed or the audio.  Is it possible to do without having to make all cuts at first, change the speed and audio and then having to go back and convert each individual segment in a smart object and then apply the same filter of ACR for each of them?

    Once you have converted a video clip to a smart object, it is more technically a video clip. All dynamic objects are treated equally, regardless of their content. So, just as you cannot change the read speed of a smart object non-video, you can do it for a dynamic object that contains the video. But if you double-click the thumbnail to a smart object layer, you open the embedded file and you can apply settings to this file-centric video.

  • Disable the video clip after 2 s

    I have 3 video clips.

    1 this is a killer

    2 it's a cockroach

    3 blood

    I move my cockroach killer and if killer connect cockroach I change coockroach of blood. I want to make visible blood only 2 sec. How can I do?

    Code:

    if (killer_mc.hitTestObject(cockroach_mc)) {
                        cockroach_mc.visible=false;
                        blood_mc.x=cockroach_mc.x;
                        blood_mc.y=cockroach_mc.y;
                   }
    

    If you are embedding in an .as file you should probably use the following import line:

    import flash.utils. *;

  • Problems with video clip inside another MC button

    Hi all
    So I solved a problem earlier thanks to this site, but she has created a different problem. I could find a way to get an external text to load into a text inside a music box. However, the problem is I want to have a series of buttons also inside the MC which will change, delivery, the text in the (loading area in the text to another file). I'm running problems, however, because I can't figure out how to get the movie clip buttons to work.

    A short brief on the installer. I have a master.swf that loads in splash.swf (menu animation and splash) and about.swf (a paragraph loaded when you click on 'about' in the navi bar). When about.swf opens, I got a piece of film clip and text and the submenu appear after 20 images.

    This is the code that I placed on frame 1 of the about.swf:

    [PHP] boxmovie.btn_about2.onPress = function () {}
    trace ("button has been pressed");
    _level0.loadText (loadedInfo, ' vars/about2.txt');
    } [PHP]

    You can download the files
    goldinroute.com/MacGregor/Help.zip

    Any help would be appreciated!

    I guess what to expect, I hang on the file... OK, did you give the button the instance name 'more'? ("btn_about2") is not there in the file I have. Then, copy the following code must be IN the MC boxmovie, guess where... of 23 frame, because you cannot assign code to an object that doesn't exist or has not been instantiated, the chronology. so it should read:

    btn_about2.onPress - function() {}
    _level0.loadText (loadedInfo, ' vars/about2.txt');
    }

    (btw - if you reverse the way in which you name the inclinometer, Flash will give you a list of the methods of the class, when you type a '.' later, as in "about2_btn" to instead, just a thought for you, even with as "boxmoive_mc" for example ;))

  • Video clip of another control

    I have a deeply nested clip, acting as a button, and I've had problems using actionscript to control another clip movie nested within another part of the document.

    I tried some ways such as:
    root. MySite.IndexText.gotoAndStop (20);
    MovieClip (parent.parent). IndexText.gotoAndStop (20);

    .. .but also throw errors at me and won't let me change the framework of the IndexText MC.

    The movie clip is:

    Root

    -MySite

    -Navigation

    -My button (requires script)

    Root

    -MySite

    -IndexText (needs controlled)

    I'm relatively new to Flash if my methods may not be perfect. I'm doing something wrong here?

    There is therefore no indexMC when your code runs.

  • Nesting of one video clip in another with actionscript

    I use attachMovie() put a clip on the stage and I would like to nest in another clip, I already have on the scene. How would I go to do this? The clip I want to nest in it is called "background" and I tried background.attachMovie but that doesn't seem to work. What is the right syntax?

    :

  • Duplicate video Clip on another level?

    I'm trying to take a clip on level 8 of my film and place a copy in a purchase order that loads on level 10 and I can't make it work. Here's my code? I tried the bitmapdata too and I can't make it work either.


    duplicateMovieClip ("_level8.designStage", "imageHolder2", 99);

    I am creating an application design and using masks and the bitmapData will work for printing. I would just create a jpeg with the bitmapData class and save and then reload it into the order form.

    Bottom line is that I need this clip to appear in exactly the same higher so I can order it and then put the image in the basket as well.

    It was not a slam to your abilities, it seems to me that every time I bring it up, which is the choice that people go to. Anyway, Yes, you can move the 'window' of the draw using a matrix. You can move, scale, and or turn it in fact.

    The code below should point you in the right direction. But you will always have the problem that if _level10 does not exist, you will be able to simply attach a bitmap image. You will need to load the content in there first to create. There is no constructor for _levels!

  • How can I take video clips or another project for my project

    Hi guys

    I have need of a few buttons I did in my last project in my game, but I don't know how

    Thank you

    Suppose that just copy > paste it draws

  • problems creating video clips

    Here is my code:

    for (var i: Number = 1; i < = nTotalPaintings; i ++) {}
    mcPaintings.createEmptyMovieClip ("mcPainting" + i, mcPainting.getNextHighestDepth ());
    trace ("for loop #" + i);
    mcPaintings.attachMovie ("idLoader", "mcLoader" + i, mcPainting.getNextHighestDepth ());
    mcPaintings ["mcPainting" + i] ._y = 0;
    mcPaintings ["mcPainting" + i] ._x = (i - 1) * 700;
    mcPaintings ["mcLoader" + i] ._y = 0;
    mcPaintings ["mcLoader" + i] ._x = (i - 1) * 700;
    trace ("mcLoader" + i + "has a _x to" + mcPaintings ["mcLoader" + i] ._x);
    }

    Going through line by line in debug mode, the createEmptyMovieClip() and attachMovie() methods do their job... but as each movie clip is replaced by the following. In the end, instead of having the 26 footage, I only have 1. I replaced one video clip with another 25 times!

    what I am doing wrong?

    Thank you!

    is mcPainting (without a final're) typo in mcPainting.getNextHighestDepth ()? What should we not mcPaintings.getNextHighestDepth ()? and it's better have a wide enough scene and very little nTotalPaintings, or you won't see much of the movieclips on stage.

  • In Movie Maker 6.0 can a video clip (with mute) be spliced in another video clip so it seems to work with the original sound of the first video?

    Hi, I put a video together for my MOM to 70th and one of her friends has provided a video clip of her playing a classical piece on the piano for several minutes.  I would like to cover this clip with other video sequences (landscapes, etc.) whereas the way piano since the main video track in the background.
    I tried to let fall the piano video file directly in the audio editing panel and then cut a second 20 segment in the video editing and insert a 20 second video (mute) images of landscape. However, the piano audio from the first video stops as soon as the strike chronology inserted piece landscape and picks up again when it ends, even if the audio scenario shows the audio piano continuously?  Am I missing a step or is this not possible?   Thank you very much.

    It should work quite as much as you described in Windows Movie Maker 6.0 (WMM 6.0), then maybe there is a step that is missed.  Let me describe how I could do and see if there's something you overlooked.

    First of all, I assume that you have already imported the clip of piano and your other clips of landscape in your collection then you can drag the there where necessary.  First, drag the piano music to the track Audio / Music in the timeline panel.  Note that if you have your video extended timeline, it will show video, Transition & Audio, but you want to get off- below that, to the Audio / Music , to follow.  At this point if you play your 'film', you should not to see any picture but just to hear the sound of the piano.  You should also only see a waveform on the audio / music.

    Now you can put anything you want on the video track.  Let's start by putting another copy of the original video of piano, but this time on the video track.  If you have developed the video track (to see the Vidéo/Audio/Transition) you will see the video piano and its associated audio waveform.  However, in your case, since you already have the audio separated, you want to cut that his partner.  Right-click on the Audio (attached to the video) track and select Muteor use the menus (Clip > Audio > Mute).

    When you preview the project, you have synchronized video browsing with the original copy of the audio piano.  At the point in the video where you want to replace the video with another piano play, making a split (key M).  Make another split at the end of the section.  It is very import that select you the video track when you add new divisions and you have not also be divide the track Audio / Music .

    Important: You want to make sure this divide the part that has the exact duration as well as landscape images, you want to replace.  So if you have 20 seconds to add, you divide 20 seconds piano images.

    Right-click on the part of piano footage (video track) and choose Remove.  Then, insert the part of sequences of landscape (also on the video track) in its place.  Once again, you will have need put this added sequence muted landscape (Clip > Audio > Mute).

    You should now see and hear the piano play.  Without any change in the audio playback in the preview window should implement the landscape images, then returns to piano images.

    If you find that your project is not behaving correctly after these splits, but are you sure that you have followed these steps, it could be a problem with your video file types.  If in doubt, try to convert all your videos to .wmv format using something like Freemake Video Converter (freemake.com)

    In any case, I hope that you are able to achieve, because it is certainly possible.  Good luck and post back with further questions or information, you can have.

  • How to detect when the user clicked 2 video clips?

    Hello:

    I would like to know how can I detect when 2 video clips were clicked (order irregardles).

    What I have is this:

    In my main script, I have 2 independent clips (mc_him and mc_her) each in its own layer which, when clicked, playing an internal animation without moving my head of main reading anywhere. What I do is, once both a click (like I said, it doesen't matter in what order), a button that sends me into another section of my film should appear. He really doesen't matter if the button activated with alpha or sending me to a specific framework where all my button. What I detect is two clicks for the button.

    How can I achieve this?

    Thank you very much.

    {btn1.onRelease = Function ()}

    No matter what

    This.Clicked = true;

    checkBothClickedF();

    }

    {btn2.onRelease = Function ()}

    No matter what

    This.Clicked = true;

    checkBothClickedF();

    }

    function checkBothClickedF (): Void {}

    {if (btn1. Clicked & btn2. Clicked)}

    do something. the two clicked

    reset the two clicked on properties?

    }

    }

  • Video clips gel and green screen after update Toshiba PC health

    Recently, I answered a message from my PC Health Monitor utility to download and update software. After that I can no longer to watch video clips online (for example clips youtube freeze and picture Gets Green and freezes internet becomes insensitive requiring stop restart.)

    I tried to download the graphic drivers intel but get a message that says: this application can be run on the PC, look for info from the manufacturer?
    Can you help me please?

    Hello

    Can you please tell us which model of laptop you have, what operating system you use and which driver you updated?

    I don't know if this will help but try to roll back OS to an earlier time using System Restore tool Windows.

  • After you have installed microsoft lifecam HD - 6000 PC with OS Windows XP3, message as "lifecam could not save you photo, audio or video clips" s ' Please help

    After you have installed microsoft lifecam HD - 6000 PC with OS Windows XP3, message as "lifecam could not save you photo, audio or video clips" s ' Please help

    Prasanna Kumar Mishra

    Hi Prasanna Kumar Mishra,

    You did it happen any changes made to the computer before the show?

    You can try the steps from the following links and see if that helps:

    Troubleshoot failures to find the new LifeCam hardware
    http://support.Microsoft.com/kb/929087

    The problems of compatibility between LifeCam and other programs
    http://support.Microsoft.com/kb/953692

Maybe you are looking for