ActionScript 3.0 :: Make A Bullet Disappear When It Hits A Target?

Jul 30, 2011

I have created a class named Bullet() and I create a child named bullet_mc every second.This bullet_mc moves to a direction on the stage.I also created a class named Plane() and I create a child named myPlane_mc every two seconds. Also, every myPlane_mc moves to a direction on the stage.

View 5 Replies


Similar Posts:


Flash :: Tower Defense - Detecting If The Bullet Hits The Enemies

Apr 22, 2011

I am creating a tower defense game and I want to make a tower that shoots a bullet and every enemy that the bullet hits is damaged. The bullet can hurt multiple units. My problem is detecting if the bullet hits the enemies. Right now, I have the enemies in an array. With other towers, when an enemy is in range, the tower fires and when it hits its original target, it causes damage to that target.

For the tower I want to make, it will shoot the bullet the maximum range every time and I need it to damage every unit it hits on the way to that final destination.

View 4 Replies

Tower Defense Game Bullet Disappear

Mar 16, 2010

I found a tutorial on the internet and have begun toying with it. I figured out what all the segments did and how they worked and effected the game (mostly through trial and error...) once i figured out what EXACTLY i had i started making changes.

-What i want - once the bullet hits a monster OR goes out side of the range of the gun it disappears and another shot can be fired (which is done automatically via my script no user input needed)

-What i have - when the bullet goes off the page (x>550, x<0, Y>400, Y<0) it disappears and another shot can be fired... obviously this is problematic to game play...

[Code]..

View 1 Replies

IDE :: Tower Defense Game Bullet Disappear?

Mar 16, 2010

-What i want - once the bullet hits a monster OR goes out side of the range of the gun it disappears and another shot can be fired (which is done automatically via my script no user input needed)

-What i have - when the bullet goes off the page (x>550, x<0, Y>400, Y<0) it disappears and another shot can be fired... obviously this is problematic to game play...

Code:
Stop();
base_range = 200;
can_be_placed = false;

[code]....

View 1 Replies

Flash - Get The Blue Object To Disappear Once It Hits A Red One?

Jul 23, 2011

I have a grid of objects that have been added to the stage dynamically, the objects are either of a Class Red or Class Blue, how do I perform a hit test on the Classes? I want the Blue object to disappear once it hits a Red one.

View 3 Replies

ActionScript 3.0 :: HitTest Only Hits One Target?

Apr 29, 2009

Basically the code creates 3 sasquatches. When you click on the sasquatch it displays "you be dead sucka!", well, only ONE of the 3 sasquatches are registering hits, and the one that does traces "you be dead" 4 times.

package{
import flash.display.*;
import flash.events.*;

[code].....

View 9 Replies

ActionScript 3.0 :: Flash - Play A Movieclip When Dragable Object Hits Its Target

Aug 15, 2011

I've got tree movieclips called: greenpip(this is the dragable object, which is visable), greenpip_target(which is invisible, but becames visible when greenpip hits it, and grrenpip is becaming invisible) and then the third one: greenpip_flask (which is the animation I want to play when the greenpip hits the greenpip_target).
Everything works but I don't know how to make the greenpip_flask play, when grrenpip hits the greenpip_target. This scenario takes place three times with three sets of objects

View 5 Replies

ActionScript 3.0 :: Setup Bullet Factory/bullet Switch For The Same Player Object?

Mar 25, 2011

I'm currently making my own shoot'em up game where the player can switch  between two player types which will fire their own bullet type in this  case, squares and circles. I've setup the player switch function via  pressing "space" button (switching between the two player types) and the  default bullet type is "squares" and I'm not sure to approach the  coding with changing the bullet type to "circles".I've written 2 classes for the bullet and player setup:Player Class: Creates instance of bullet on screen and enables the switch player type function

Bullet Class: Enables bullet properies and bullet types Player Class: Code:function onKeyDown(event:KeyboardEvent):void {if (event.keyCode == 32) //// pressing/holding "space bar" to function

[code]....

View 5 Replies

ActionScript 3.0 :: Shooting Multiple Bullets - Press The Space Bar The First Bullet Disappears And The Bullet Animation Starts Again

Nov 24, 2008

I'm trying to make my platform game character shoot a gun, my character and gun are one movieclip and the bullet is another. The bullet mc starts on a blank frame with a stop() function, when I press the space bar the bullet mc plays from frame 2 which is a motion tween of the bullet quickly moving across the page. I've set the bullet's y and x values relative to the character mc so that the bullet always comes from the gun.

My issue is that if I press the space bar a bullet will fly out of the gun (great!) but if I press the space bar again, the first bullet disappears and the bullet animation starts again. I want to be able to shoot a new bullet every time I press the space bar without effecting the bullets that have already been shot.

[Code]....

View 3 Replies

ActionScript 3.0 :: Set The Bullet.x To Ship.x In The Bullet Class?

Oct 4, 2009

i have 2 classes, one for ship one for bullet.i was trying to set the bullet.x to ship.x in the bullet class but it keeps telling me undefined. but clearly it is in my ship class.

View 10 Replies

Make An Enemy Bullet Go Towards The Main Character?

Oct 12, 2008

How would i make an enemy bullet go towards the main character?

View 7 Replies

ActionScript 2.0 :: Make A Bullet Hole Appear When Shoot An Object

Sep 28, 2002

i've posted many times and got loads of responses but i dont understand how to make a bullet hole appear when you shoot an object. MSN me a [URL] to have a chat about doin the actionscript.

View 1 Replies

Make A Visitor Hits Counter Using Just AS2?

Jun 4, 2009

Is it possible to make a visitor hits counter using just AS2 ?

Or what is the other way to do this ?

The site is totally in flash only.

View 4 Replies

ActionScript 2.0 :: Make Something Stop When It Hits Another Thing?

Jan 7, 2004

I am wanting to make a game, and I need a gravity code that works great. I want gravity, a jumpibg code, and then a code to make something stop when it hits another thing.

View 2 Replies

ActionScript 3.0 :: Make A Bullet Launch At Different Degrees (anywhere From 1-360) From A Specific Point Towards The Mouse

Jul 30, 2009

I need to make a bullet launch at different degrees (anywhere from 1-360) from a specific point towards the mouse.

View 3 Replies

ActionScript 3.0 :: Make It So Once One Instance Hits The Last Frame It Is Removed?

Oct 16, 2011

I have a movie clip that I want to be generated over and over again from the library at a random interval, and when the movie clip hits last frame I want it removed.Here is how I am generating it:

function Spawn():void {
var Poof:Puff = new Puff;
addChildAt (Poof,0)

[code]........

View 9 Replies

ActionScript 2.0 :: Stop The Script When It's Running - Make The Sky No More Snowy And Make Snow Disappear?

Dec 25, 2002

how to stop the script when it's running.To make the sky no more snowy and make snow disappear.

View 1 Replies

ActionScript 2.0 :: Make A Custom Cursor - When Hits A Wall It Bounces Off

Dec 5, 2004

im trying to make a custom cursor that when it hits a wall it bounces off and i cant seem to get the right AS. ive got the cursor and i can write AS for a hittest. ive typed in

[Code]...

View 2 Replies

Professional :: Make Background Move Over / When Movie Clip Hits Edge

Mar 25, 2012

the conent will not be able to be seen unless the user hits the arrow keys on there key board. So i need to make a group of objects i can make into a movie clip and than inside that movie clip make an animation that plays the squirrel running. i will pause here to ask two things i dont know how to do i want the squirrel to have an animation when standing still where it flicks its tail (like a real squirrel would). and also how would i flip the squirrel so when the left key is pressed it points left and when the right arrow is pressed it faces left? and my main question when it reaches the edge of the stage the extended background that runs off stage moves over to reavel more content. as well as not have the squirrel run off stage? in short i am using the squirrel to view the full pages content.

View 2 Replies

IDE :: Make The Background Disappear?

Jul 22, 2009

I have a map application where the user mouses over the various counties, and clicks on it to zoom in. I am having a problem synchronizing the background change with the county zoom.referably, I would like the background to zoom out with the counties as they zoom, but having the background fade to white would work just as well. I created a movie clip of the main map (background) to zoom in, but I don't know how to play 2 movie clips at once.You can see it in action here:

View 1 Replies

IDE :: How To Make An Object Disappear

Jan 24, 2010

I am a learner. I am using one object which animates from a corner and comes to the middle of the stage (Using Motion Tween for animation). What I need is when it comes to the middle of the stage it should disappear from the stage. How it is possible?

View 1 Replies

ActionScript 2.0 :: Make The Moveclip Appear And Disappear ?

Nov 7, 2008

I have a movieclip - instance name "popup clock" . The frame on which it is on has the following code:

Code:
popupclock._visible = false;

The movieclip starts off invisible like it should. I also have a button which has the following code:

Code:
on (release) {
if (popupclock._visible=true) {[code]..

The code should allow the button to make the moveclip appear and disappear but it doesn't work?

View 4 Replies

Make Item Disappear After Dragging It?

Sep 7, 2009

I basically am suppose to make "scarf" drag over to a movie clip named "winter_mc" and when it is on it, it is suppose to disappear but it's not disappearing. Here is my code used in the scarf:

Code:
on (press) {
startDrag(scarf, true);
}

[code]....

View 5 Replies

ActionScript 3.0 :: Make Mc Disappear When Next Mc Is Triggered

Oct 5, 2010

I have a project that has 6 movie clips across the stage that are triggered by mouse click. The trouble I'm having is getting them each to dissapear when the next movie clip is triggered. You can click out w/ an "x" box but I want them to dissapear when the next mc is triggered also.

Code:
var mc:handfade;
hand_mc.addEventListener(MouseEvent.CLICK, handPage);
function handPage(e:MouseEvent):void

[Code]....

View 21 Replies

ActionScript 3.0 :: Possible To Make Captions Disappear?

Feb 4, 2011

I have a Flash website that consists of 6 different Scenes. The Home scene and the Videos scene each have a FLV player that I dragged from the library and I called it "vid". So I'm basically using the same player for both scenes. I'm also using the caption component and am assigning the xml via actionscript when the user clicks on a link, so it reloads the player with the correct video and the correct captions. The problem I'm having is that say they are watching the video on the Home scene with captions. If they click on the Contact Us scene, the video player disappears, but the captions stay on the screen by themselves. Looks really odd. I need a way to turn off the captions (called the component "myCaps") so they disappear both when changing scenes and changing movies. On the Videos scene, if you click a different movie's link, the old captions form the last movie stay on screen and just move up a line and the new movie's captions appear below that one. So, how do I get rid of the captions when I don't want them?[code]...

View 15 Replies

ActionScript 3.0 :: Make Google Map To Disappear

Jan 12, 2012

I have Google Map working just fine. When I click "where we are" Google openes up no problem but when I click on another button let say "about us, Google stays in the background [code]...

View 2 Replies

ActionScript 3.0 :: Make One Movieclip Disappear When It Is Hit By Another?

Jan 12, 2010

I've got an assignment where I have to make one movieclip disappear when it is hit by another. I used to be able to do this in AS2 but now I'm at a loss.

View 6 Replies

ActionScript 2.0 :: Make A Button Disappear After Clicking?

Sep 8, 2003

I'm new to wonderful world of flash and I'm having a little trouble with a button I've created. Basically, I have a button which covers an image. I'd like to make it so that after the button is clicked, it disappears - thus exposing the image behind it.

View 8 Replies

Flash8 :: Make All Buttons Disappear Except The Selected One?

Jul 6, 2009

I have a project which is very straight forward however I'm having trouble figuring out the logic to get it started as well as the actionscript to get it working.THE PROJECT1. The user must choose one (only) out of about 100 buttons available on the page/frame.2. When the chosen button is released, the other buttons diasappear/turn invisible and become inactive3. A message appears within a speech bubble pointing to the selected button.PROBLEMS1. How do I make all the button disappear except the chosen one?2. How do I make the speech bubble point to the chosen button no matter which one they choose?MY LIMITED LOGIC SAYS1. I need to collect x and y values somehow to position the speech bubble2. Pass a variable to tell flash 'this is the chosen button'3. Tell flash to hide every button that isn't the chosen one using the variable

View 5 Replies

ActionScript 2.0 :: Make A Button Disappear After It Has Been Clicked?

Oct 28, 2009

I have been searching other threads and found another similar question, but the code did not work in my animation.

I am trying to make a button disappear after it has been clicked so that the animation underneath of it will be viewable.

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved