ActionScript 3.0 :: Firing The Multiple Bullets?

Jun 18, 2007

I have written the code below which restricts the number of bullets fired, but each bullet fired travels at a different speed to the last and when another bullet is fired the previous one disappears from the screen. Please can anyone give any guidance ?
 
import flash.display.MovieClip;import flash.events.KeyboardEvent;import flash.events.Event;import flashx.textLayout.formats.BackgroundColor;
var speed:Number;speed = 10;var shootLimiter:Number=0;

[code]....

View 5 Replies


Similar Posts:


ActionScript 2.0 :: Movable Turret Firing Duplicated Bullets?

Aug 11, 2004

I know there's all these posts on how to use For... loops to hittest, but no matter how hard I try, they just don't work. So, after hours of hair tearing, paceing and starting a new game I've decided to bother you all for help.

My situation is that in the game I'm making, I have a movable turret firing duplicated bullets. I need to hittest them against a duplicated set of oncoming robots. I've tried using a for loop, but I just can't get it to work.

I've attached the .FLA, and I would be grateful if anyone could point out what I'm doing wrong (ignore the values for removing the clips and the random duplication; I had to shrink the stage size to make the file size smaller

View 3 Replies

ActionScript 3.0 :: Moving Multiple Bullets?

Jan 31, 2010

I'm working on a simple top-down zombie shooter to teach me better AS3 practices. There's one player, can shoot multiple bullets, and a certain number of zombies on screen at once, that increment by one when all of the previous ones are dead.

So, I have everything working great except for one thing: even though I'm spawning multiple bullets, and they go in the correct direction at the right speed, only one moves at a time.

Here's the code for spawning bullets:

Code:
// shoot - check to see if the gun can shoot, then shoot it
private function shoot():void
{

[code]....

I have a similarly structured pair of functions for the zombies, and they chase after the player just fine. If I trace a bullet's name when it collides with a zombie, it always returns 0. I've tried changing the number of bullets that can be spawned, but it remains the same.

Also, the moveBullets function is called from gameLoop(), which is itself called from an event listener for ENTER_FRAME. The movePlayer and moveZombies functions I have are also called from gameLoop.

View 6 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 :: Button Firing Off Multiple Times If Clicked Fast Only?

Sep 11, 2011

i wrote this code:

import flash.events.Event;
import flash.display.MovieClip;
import flash.display.Loader;
import flash.net.URLRequest;

[code]....

and it works, once clicked, it does what it has to do. Ofcourse, me trying to break it, i found that if i click the buttons fast, it will re-import the external swfs causing me to have multiple instances of the external swf.so in short, if i click like normal(slow ) ie like a person that clicked to view a section etc, then its fine, if i click fast or repeated clicking ie like a person that double clicks etc, then the problem occurs.

View 2 Replies

Actionscript 3 :: Stop On Enter Frame Firing Multiple Times?

Mar 8, 2012

I'm trying to do a simple url requestion on enter frame, but it seems to be executing multiple times?

I tried removing the event handler on handleLoadSuccessful, that seems to stop it firing infinitely, but its still executing about 10 times before it stops. How do I make it only fire once?

addEventListener(Event.ENTER_FRAME, onLoadHandler);
function onLoadHandler(event:Event) {
var scriptRequest:URLRequest = new URLRequest("http://ad.doubleclick.net/clk;254580535;19110122;t?http://www.gamespot.com.au/Ads/gswide/hp/1x1.gif");
var scriptLoader:URLLoader = new URLLoader();

[Code]...

View 1 Replies

ActionScript 3.0 :: Button Firing Off Multiple Times On Quick Press Only

Sep 11, 2011

i wrote this code:

[Code]...

} // end btn4Loaded. and it works, once clicked, it does what it has to do. Ofcourse, me trying to break it, i found that if i click the buttons fast, it will re-import the external swfs causing me to have multiple instances of the external swf. so in short, if i click like normal(slow ) ie like a person that clicked to view a section etc, then its fine, if i click fast or repeated clicking ie like a person that double clicks etc, then the problem occurs.

View 2 Replies

ActionScript 3.0 :: How To Create Bullets

Mar 8, 2010

how to create bullets in as3? I have a main character = hero.mc Basically I need to store the bullets in an array and have them firing from the hero. It sounds simple enough, but for some reason I can't get it to work.

So far I have this:

Quote:

private var bullets:Array;
public function createBullets() {
bullets = new Array();

[code]....

View 15 Replies

MX Shooting Bullets In Any Direction?

Jun 28, 2011

I need a code in AS2 that launches a bullet ("bullet") from the character ("hero") towards wherever you clicked the mouse.For example, if I click somewhere, I want the bullet to launch straight towards where I clicked.

View 10 Replies

How Add Bullets To Flash Text

Jan 11, 2007

How do I add a bullet to Flash text? I know that alt0149 isthe html code. In the Flash text box and before the first textcharacter, I tried pressing the ALT key and simultaneously typingin 0149. Nothing happened.A similar question was asked on this forum... the answer wago to the Character Map (where is that) or use dynamic text (Itried putting alt0149 in the dynamic text box ??? but it didn'tork).My work-around so far is to copy a similar bullet and add itto the text box. But there must be a quicker way.

View 7 Replies

ActionScript 1/2 :: Bullets Only Shoot 1 Way?

Mar 4, 2012

this is in my bullet movie clip on the timeline.[code]It all works but when i turn around it still shoots the same way im sure its something simple but i just cant work it out.

View 7 Replies

Flex :: List Bullets In 4.5?

Jul 27, 2011

Is it possible to add bullets to a Label in Flex 4.5 mobile development?something like this:

.Item
.Item
.Item

View 3 Replies

ActionScript 3.0 :: Add Bullets To A Text?

Apr 25, 2011

is there any way to add bullets to a text?(ul or li are not working..)

View 1 Replies

ActionScript 2.0 :: Getting Bullets To Work Properly?

Mar 19, 2005

I've got a mouse controlled person who fires circle bullets up towards oncoming enemies. but since i duplicated them, only the first bullet fired works as it is the only one that has the right instance name.What I mean is :The bullet is instanced bullet When it is duplicated to be fired, it changes to bullet1,bullet2 ect etc The hittest script on the enemies only reconize bullet, and therefore ignores all other shots except the first is there anyway of making it so it reconises all shots?

View 1 Replies

IDE :: Textformat Tabstops And Bullets In Xml File?

Jan 4, 2008

According to the search there's never been a post that contains the word "tabstops" in the history of . I am honored to be the FIRST!Anyway, I am converting an application so that text content that was once trapped in the authoring environment will now reside in an external XML file.The problem i'm running into is that my "textformat tabstops" tags and bullets no longer work.In the content I had:

Code:
<textformat tabstops='[10]'><br><br><b><u>Blah blah blah</u></b><br> Blah blah blah<br> lah blah blah etc.</textformat>

[code]....

View 2 Replies

ActionScript 3.0 :: Adding Speed To Bullets?

Feb 6, 2009

I have finally got the movieclip to show up when i hit the ctrl key. but it just sits there because i have not yet added a speed. what would be the simplest way of doing this? what i want to move is a bullet.

View 2 Replies

ActionScript 3.0 :: Option For Creating Bullets?

May 7, 2009

I could create a movie clip for a bullet and create a new instance of one every time a bullet is fired. Then, I could have 100 little bullets all flying around checking collision detection...

There must be a better, more efficient way to do bullets. Anyone know of anything already out there?Otherwise, I could create a collision detection queue for the bullets, or predict where the bullet will fly (since it is usually always linear), but if the bullets become larger, the actual movie clip of the bullet may be wide enough to hit something, but the line the bullet is traveling does not necessarily hit that other object.

But is there a fast, efficient system or way of handling things already out there?

View 2 Replies

ActionScript 2.0 :: How To Get Bullets To Work Properly

Mar 19, 2005

I've got a mouse controlled person who fires circle bullets up towards oncoming enemies. but since I duplicated them, only the first bullet fired works as it is the only one that has the right instance name. What I mean is: The bullet is instanced bullet. When it is duplicated to be fired, it changes to bullet1, bullet2 etc. The hittest script on the enemies only recognize bullet, and therefore ignores all other shots except the first. Is there anyway of making it so it recognizes all shots?

View 1 Replies

ActionScript 2.0 :: Gettining Bullets To Work Properly?

Oct 21, 2011

I've got a mouse controlled person who fires circle bullets up towards oncoming enemies. but since i duplicated them, only the first bullet fired works as it is the only one that has the right instance name.What I mean is :The bullet is instanced bullet When it is duplicated to be fired, it changes to bullet1,bullet2 ect etc The hittest script on the enemies only reconize bullet, and therefore ignores all other shots except the first is there anyway of making it so it reconises all shots?

View 4 Replies

ActionScript 3.0 :: Removing Bullets From Stage After Game Over

Apr 7, 2012

in my game enemy Planes shoot at my plane and everything is working fine enemy bullets are inside an array the problem is when my plane gets destroyed by enemy Planes ,the last bullets shot by the enemyPlanes still shows on the screen eventhough i called a removelistener function and added a game over screen enemy planes use timer which i have a listener for it how can i remove the last bullets that still shows on the screen?

View 5 Replies

Flex :: RichText Doesn't Work With Bullets?

Jul 25, 2011

See the simple application created below. I have a RichTextEditor and a RichText component.The idea is to display whatever typed in the RichTextEditor in the RichText component. Everything else (I think) works except for Bullets! The conversion works as if bullets doesn't exists!

<?xml version="1.0" encoding="utf-8"?>
<s:Application width="100%"
height="100%"

[code]......

View 1 Replies

Flash :: Bullets In List Following Mouse Movement?

Feb 1, 2012

I've been having a problem I've been working on for multiple hours now with no luck. I have movement bound to arrow keys and the user looks around via the mouse. When I shoot I want it to continue off in the direction it initially started, but what happens is if the user moves the mouse the bullets change directions with it.[code]...I think what is causing the problem is that when I push the bullets into the array they're all sharing the effects of the user moving the mouse instead of keeping their initial value.

View 2 Replies

ActionScript 3.0 :: Placing And Duplicating Projectile Bullets

Feb 6, 2009

Need to make it so when you hit <control> it will place the bullet but if you hit <control> again it will duplicate it instead of moving the bullet from where it was before. I am trying to find a code that I can look at for research but there arent any AS 3.0 scripts or fla files to DL. The bullet does not need to move or anything, just places the bullet.

View 0 Replies

ActionScript 3.0 :: Create Text Bullets In Flash?

Aug 26, 2011

I am trying to make text bullets in Flash CS 5.5, and I noticed there is no way to do that using the text options in Flash, so I decided, I would just make a small circle shape, and place it where I needed. However, even though I place the shape in front of the text I want it to be in front of, when I test the movie, for some reason this shape, gets moved down about 5 pixels or so. (or the text is moving) I am using classic text.

Is there any reason for this shifting around?

And/or is there a way to just create text bullets in Flash?

View 9 Replies

ActionScript 3.0 :: Swap The Players Bullets Upon Pressing 'x'

Aug 19, 2011

My problem is that I want to swap the players bullets upon pressing 'x'. I have implemented senoculars keyobject class and followed a tutorial from asgamers. this is the code...public function loop(e:Event) : void

[Code]...

View 3 Replies

ActionScript 2.0 :: Put A Limit On How Many Bullets (which Is A MC) That Can Be On The Screen At One Time?

Mar 25, 2005

I know its possible to put a limit on how many bullets (which is a MC) that can be on the screen at one time. However, I've been playing with it for about an hour now and can't figure out the right AS. I am including the swf and the fla.

View 14 Replies

Flash :: Make A Bulleted List In Custom Bullets?

Nov 20, 2009

Is there a way to make a bulleted list in flash with custom bullets? If so, can this be used from within a TextArea in Flex (mx.controls.TextArea) when setting htmlText?

For example:
<li>Item</li>
<li>Item</li>

The list above will render fine when set into a TextArea using htmlText (versus just setting the text property). The rendered text will have standard vanilla bullets. Is there a way to style these bullets with custom images, like you can in standard HTML/CSS?

View 4 Replies

Arrays :: Remove Bullets On Collision In Shooter Game?

Nov 24, 2011

I'm trying to create a flash shooter game as my first project. But I can't remove the bullets and enemies when they are hit or off-screen.I've searched for a solution on the problem multiple times and copied about 4 of them (plus I've tried my own ideas) but they are not working.The current method of checking for collisions is:[code]How can I remove the enemies and bullets? removeChild and splice?

View 1 Replies

ActionScript 2.0 :: Bullet Shooting Thing Which Shoots Bullets

Apr 2, 2007

I have like a bullet shooting thing which shoots bullets (obviously), and it sorta rotates around a point and fires at a movie clip. At the moment the bullets move outwards because of a animation in side the bullet movie clip, but how can I make them move outwards and away from the thing that fired them using actionscript?

View 8 Replies

ActionScript 3.0 :: MovieClip Deleting The Players Bullets Correctly

Feb 13, 2010

We're running into the problem of deleting the players bullets correctly. The problem consists of 3 objects: conRoom [which is the controlling object of the room that, for example, creates ticks] player [which is what you control] bullets [which is what we're trying to delete] The way we've got it set up is that the player creates a bullet for the conRoom via "conRoom.addChild(bullet)." The bullet is fed a reference to both conRoom and player. In addition, the bullet passes a reference to a conRoom array via "conRoom.objectsArray.push(this)"

Then, when the bullet hits an enemy, we need it to be deleted. The way that we thought we had figured it out was by calling the conRoom function killAThing passing "this" as an argument:

[Code]....

View 2 Replies







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