ActionScript 2.0 :: Bullet Holes With A Lifespan?

Jul 29, 2005

I am trying to create a bullet hole effect when you click the mouse down.I want a bullet hole to appear where you click the mouse and to stay there, and then when you have > 10 bullet holes on the stage i want to earliest ones to start to fade out.

Here is my code so far:

[AS]
onClipEvent (mouseDown) {
i++;
this.duplicateMovieClip("BulletHole"+i, i+1);

[code]...

However this just duplicates the movie clip and then when you click again it disapears straight away.

View 12 Replies


Similar Posts:


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

ActionScript 3.0 :: Remove Holes From Overlapping Shapes?

May 26, 2009

I use AS3's drawing api to draw filled shapes, but when they overlap, instead of filling the overlapped area, it becomes clear again, with no fill.

My question is, how can i get rid of this behavior, i need to just fill everything, is there a way to somehow "flatten" the shapes?

View 5 Replies

ActionScript 3.0 :: Cutting Holes Out Of A Graphic With A Stroke?

Nov 15, 2011

How would I go about cutting a transparent hole into a Graphic and leaving a stroke around the hole I just made (similar to if I had used the Eraser tool on the Flash canvas, minus the stroke)? My first instinct tells me to draw a circle over the spot I want to "cut out" with a stroke of an arbitrary width and an alpha-less fill, but if I were to click-and-drag this hole - or simply make another overlapping hole for that matter (again, as if I were using the Eraser tool), the stroke would definitely not appear the way I want it to. If anyone is familiar with how the terrain is blown away in the 2D Worms series, that is more or less what I am going for.

View 1 Replies

Flex :: Papervision3d - Design A Sphere With 8 Holes Around One Of Its Diameters?

Jun 22, 2009

I am a newbie to Papervision. I want to design a sphere with 8 holes around one of its diameters. How do I do it? How do I draw anything on a sphere in Papervision?

View 1 Replies

Actionscript 3 :: Create A Graph From Points In Grid That Contains Holes?

Jul 6, 2010

I've got a continuous plane (2-D) containing polygonal obstacles. I am uniformly sampling the plane at discrete positions to create a uniform grid of points. The grid does not have points where obstacles lie (i.e. holes where ever an obstacle is) as shown in the image below.[url]...

View 1 Replies

Flash :: Draw Two Intersecting Circle Holes In Graphics?

Oct 25, 2011

I need draw rectangle with two circle holes inside. The problem is in circles interception. I want them to join together and cut from background, but they seems to be XORed:

At first I tried drawRect and DrawCircle:

graphics.beginFill(0, 0.5);
graphics.drawRect(0, 0, width, height);
graphics.drawCircle(width/2, height/2, 50);

[Code].....

here getCirclePath returns object with points to draw polygon which looks like circle. Also I tried different combinations of GraphicsPathWinding constants, but no luck.

how to draw two intersecting circle holes in graphics?

View 2 Replies

ActionScript 2.0 :: Arrays - Close "holes" By Moving The Remaining Items Around

May 14, 2009

I have an array of say, food products. The array is full and fully visible at first. I have a filtering system, by which I can eliminate, one at a time, a certain category. So let's say that I disable the "fruits" category. The fruits disappear and I'm left with "holes" in the array. Up to this point it's all good, I can handle it. The problem is that now I want to close these "holes" by moving the remaining items around. And I have no idea how to calculate/formulate the logic of this movement.

View 4 Replies

ActionScript 3.0 :: Draw One BeginFill/endFill Session But Without "holes" In The Final Shape?

May 6, 2010

I have two questions about drawing shapes in action script 3.0, using graphics class (flash.display.Graphics):Question 1.When I draw some more complicated shape consisted of a few simpler shapes (i.e. two circles), and the shapes overlaps, the overlapped region is inverted (is rendered as a "hole"). Is there any way to avoid that?This is simple example of this behaviour:

var oClip : MovieClip = new MovieClip();oClip.graphics.beginFill( 0x000000, 0.5 );oClip.graphics.drawCircle( 150, 200, 70 );oClip.graphics.drawCircle( 250, 200, 100 );oClip.graphics.endFill();this.addChild( oClip );

I know,I can do it using separate beginFill/endFill sections for each circle:

var oClip : MovieClip = new MovieClip();oClip.graphics.beginFill( 0x000000, 0.5 );oClip.graphics.drawCircle( 150, 200, 70 [code]....

but then when I use alpha blending, the shapes are blended separatelly. Unfortunatelly, this is not correct for that what I want to do.I need to draw one beginFill/endFill session but without "holes" in the final shape, is it possible?Question 2.Is there an action script counterpart of the Flash menu option: Modify->Break Apart ?

View 4 Replies

CS3 Dynamic Textbox Bullet Bug

Apr 22, 2009

I've been working with Flash for over 3 years, but I can't figure this one out. I've got a body of text, half of which are bulleted points designated by <li></li>. It's loaded into a html-ised dynamic textbox.

[Code]....

It displays fine as is. However, if I make the box selectable, and select any part of the bulleted list, the ENTIRE body of text turns into a giant bulleted list, including the non-bulleted portion at the beginning. I've managed to replicate this bug with Flash 8 and CS3, using a variety of flas made from scratch.

View 1 Replies

ActionScript 2.0 :: Bullet Is Not Starting From The Car?

Nov 26, 2010

I'm creating a small car game where you shoot from the car, so I've made a bullet animation with this code inside the mocieclip:

Actionscript Code:
shellNo = 0;function shellEject(){shell_holder.attachMovie("shellAnim", shellNo, shellNo);shellNo++;}

But the problem is that the car is moving when you controll it so the bullet stays on the same position and I want it to follow the car and start from the same position as the car whereever it goes.

View 1 Replies

ActionScript 1/2 :: Bullet Is Not Starting From The Car

Nov 25, 2010

I'm creating a small car game where you shoot from the car, so I've made a bullet animation with this code inside the mocieclip:

shellNo = 0;
function shellEject(){
shell_holder.attachMovie("shellAnim", shellNo, shellNo);
shellNo++;
}

But the problem is that the car is moving when you controll it so the bullet stays on the same position and I want it to follow the car and start from the side of it whereever it goes.

View 1 Replies

IDE :: <br> Within <li> Creating New Bullet Point?

Mar 17, 2009

I have some code in for a dynamic text field:

<ul><li>Item one</li>
<li>Item two line one<br>Item two line two</li>
<li>Item three</li></ul>

[code].....

View 3 Replies

ActionScript 2.0 :: Bullet Is Not Starting From The Car

Nov 26, 2010

I'm creating a small car game where you shoot from the car, so I've made a bullet animation with this code inside the mocieclip:

[Code]...

But the problem is that the car is moving when you controll it so the bullet stays on the same position and I want it to follow the car and start from the same position as the car whereever it goes.

View 1 Replies

Way To Remove 'Enemy' When It Comes Into Contact With 'bullet'

Jan 18, 2010

Basically i just need a simple way to remove the "Enemy" when it comes into contact with "bullet".Ive been looking on the internet but its just really confusing me at the moment. And im not sure how easy its gonna be with the way i have set it up.

View 1 Replies

ActionScript 1/2 :: How To Add Bullet Points To TextField

Sep 21, 2010

I've made a scrollable text field with the UIScrollBar component. Now I need bullet points in that text. How do I create them?

View 1 Replies

Flash :: Program The Path Of A Bullet?

Nov 8, 2010

I am playing around with ActionScript 3 and trying to build a very simple prototype for a video game (top-down action/shooter) and realized that handling bullets is a little bit more challenging than I originally imagined.

In order to get a fairly decent "flight" of the bullet between the character and the target, I ended up using a highly modified version of Bresenham's Line Algorithm to determine the flight path of the bullet and then merely draw a tiny flash.geom.Rectangle object at the appropriate place on that "flight path" during the draw-frame stage of my application.

I haven't noticed any real problems, but I just can't imagine this being the best way to handle bullets in a Flash game. I imagine that once there are multiple enemy players on the screen and lots of bullets flying around (especially once I code in automatic weapons) that things could come grinding to a halt.

What am I missing here? I'm not really a game developer and so most of the things I'm doing I've just "made up" on the spot, but I can't figure out how to effectively handle bullets in Flash.

EDIT: As requested, here is "my" Bresenham code. I say "my" in quotes, because I basically ripped this from somewhere on the internet. My changes to the algorithm basically involve the lines at the bottom. The original implementation would find the path from player character to the target, except that every once in a while (and I wasted a little bit of time trying to figure this out but never got anywhere) it will generate the path from the target to the player. To "fix" this, I ended up just checking the first X/Y values from the path array and reversing the array if those values didn't match the X/Y values of my player character.

[Code]...

View 4 Replies

ActionScript 2.0 :: Firing One Bullet Per Press

Jul 27, 2004

im just testing some stuff, and everytime the space key is pressed i want one bullet to come out, however righty now you can just hold down space and it keeps firing...heres the code i used [code]

View 11 Replies

ActionScript 2.0 :: Collision Between Bullet And Monster?

Jan 11, 2011

i just made a 2d shooting game lately. I got a question, how do you make a collision between the bullet and the monters? Here's my code:

Code:
enemy_mc.onEnterFrame = function ()
{
if (bullet_mc.hitTest(this._x, this._y, true)) [code]...

But it doesn't seem to destroy/remove the monster when it hits or even say 'true' on the text on the upper left corner.

View 2 Replies

ActionScript 2.0 :: Firing One Bullet Per Press?

Jan 28, 2011

i have a slight problem, im just testing some stuff, and everytime the space key is pressed i want one bullet to come out, however righty now you can just hold down space and it keeps firing...heres the code i used :

on (keyPress "<Space>") {
i = i+1;
duplicateMovieClip(_root.bullet, "bullet"+i, i);
}

View 1 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 :: Shooting Game Bullet Removal?

Feb 18, 2009

So the problem is basicly this: It all works just fine, but when the bullet hits the target it gets destroyed (this is ok) but also any bullet that was shoot before it (meaning also: with a lower y) gets destroyed aswell wich is anoying. Here's the code (left the comments so you can find your way around easier)

Code:
stop();//add a stop function too!
enemyspeed =1
life=3
var gameOver:Boolean = false;

[Code]..

View 2 Replies

Added Some Bullet Points In Dynamic Text

Jun 1, 2009

I have added some bullet points in dynamic text but the gap between each one is massive, how can I get it so they are directly under each other.I am using the tag <li>

View 1 Replies

ActionScript 3.0 :: Enemy Character To Fire A Bullet Every Second?

Jul 21, 2010

I am trying to program a game and I want the enemy character to fire a bullet every second, but instead he is firing an infinite amount of bullets right after the other. Here's the code with the timer:
 
if (k == 0){
var shootRight1 = new Timer(1000,1);
shootRight1.addEventListener(TimerEvent.TIMER_COMPLETE, enemy1shoot);
shootRight1.start();

[code]....

View 5 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

Flex :: Font Not Showing Bullet Points

Mar 8, 2010

I have embedded my font using the embed meta tag, along which the entire range of Unicode characters... here is my CustomTextField class[code]...

View 2 Replies

Flex :: Draw Custom Bullet Points?

Mar 29, 2010

how I can draw Bullet Points using Flex? instead of using image for 1, 2 and 3?

View 2 Replies

Actionscript 3 :: Bullet Hitscan - How To Detect A Collision

Jan 4, 2011

Take a look at this scenario, I have two characters, one shoots two bullets on the direction of the other character, the bullets are fired instantly and travel at infinity speed, how to detect a collision? Here's an image to illustrate the problem: The red bullet would clearly miss, but the green bullet would hit, how to perform this kind of collision test?

View 1 Replies







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