Shooting
some1 can tell me plz what is wrong in here-
onClipEvent (enterFrame) {
if (_root.shot, hitTest(_root.bad)) {
_root.text = "Collision Detected";
} else {
_root.text = "No Collision";
}
}
because when I tested it, all I can see in the text area is No Collision even when the "shot" hitted the "bad".
so what can I do?
FlashKit > Flash Help > Flash Newbies
Posted on: 09-08-2004, 12:17 PM
View Complete Forum Thread with Replies
Sponsored Links:
Shooting
Hello,
I follow a tutorial about shooting laser from the spaceship.
Anyone here know how to make it shoot only once as in i hold down the fire button and it shoots one laser and not a long string of lasers?
Thank you!
View Replies !
View Related
Shooting
i made a 2d space shooter. everything is working well. only i cant figure out how to get that thing shoot. i just want the ship to shoot when i hit space. anyone can help me ?
i attachted the fla.
View Replies !
View Related
Shooting
Yea people, I have a problem here.
I want to be able to fire a bullet out off my gun when I press spacebar and that that bullet can kill a monster if it hits it.
Can somewone please tell me how to do that?
View Replies !
View Related
Shooting
Hi, can someone help me make a computer that is continally shooting?
I have this code which rotates the computer
onClipEvent (load) {
[load];
angle = 80;
speed = 2;
offset = 0;
rad_conv = Math.PI/180;
}
onClipEvent (enterFrame) {
X = this._x;
Y = this._y;
Xm = _root.spaceship._x;
Ym = _root.spaceship._y;
Xdiff = Xm-X;
Ydiff = Ym-Y;
radAngle = Math.atan2(Ydiff, Xdiff);
this._rotation = radAngle*360/(2*Math.PI);
}
View Replies !
View Related
Shooting
I have few guestions about platform games. Okay,I know lots of things about platform games.But, Iīm making a megaman X platform game and I donīt know, how to do shooting.
I know that,the megamans yellow "bullet" is movie clip (MC).
But how to do shooting to right and to left.
Second thing,what I donīt know,is:
How to do jumping WITH DIFFERENT SPRITES,WHEN JUMPING AND DIFFERENT SPRITES,WHEN LANDING.I know that,how to DO JUMPING,but with different sprites when landing and actually jumping.
Okay,thatīs all I donīt know!!! (Iīm making that game on Macromedia Flash MX Professional 2004.
I really need help and I have readed all flashkit tutorials,without help!!! (sorry,but I live in Finland,so my english grammer sucks)
so, if you know something about firing in platform games and jumping with different sprites when lands and different sprites,when jumps!!!
Iīd REALLY APPRECIATE YOUR HELP!!!(you can e-mail me too)
View Replies !
View Related
Shooting
hiya
I am working on a shooting game, but I don't know how I can make my cannon to shoot...
I want to do a cannon thats shoots like in here-
http://www.squarecircleco.com/games/cannon/index.html
I attached my .fla so I hope that some of u will be able to help me.
*thanks
ps. I posted it in games forum too cuz I didnt know where it should be..
View Replies !
View Related
Shooting Gun
Does anyone know how to make a gun which rotates according to the angle of the mouse and shoots laser when the mouse clicks?(in the mouse direction)
I made a basic platform game according to the tutorial. I was thinking of advancing it to a better sort.
Regards,
Tongxn
View Replies !
View Related
[CS3] Shooting AS2
Ok.. i made a submarine game where u have to capture fish with a net, then i added stingray which are to be shot with a different weapon. The net is a bullet and I want the spear to be 2nd bullet but for some reason i cant have 2 bullets,, When i dont have the second bullets coding on the first bullet works fine but when i put in the second bullet's coding the first dosnt work.. any ideas??
p.s i have reduced alot of the fla. file because of size.
View Replies !
View Related
Shooting
I now realise this should have gone in the actionscript forum, sorry
Im having a problem in creating an MC duplicate when a button is pressed.
I want to be able to create a new 'playershot' MC each time space bar is hit.
Currently, each time i hit it the same MC returns to its
player_mc._y +2;
player_mc._x + 80;
location instead of duplicating it.
Also, if i hold the space bar, the playershot mc stays in the
player_mc._y +2;
player_mc._x + 80;
location, instead of a steam of bullets appearing.
Any ideas?
//player movement here but it works so i wont bother posting it
if (Key.isDown(Key.SPACE)) {
playershoot(); }
var i;
function playershoot()
{
i++;
var newname = "playershot" + i;
_root.attachMovie("playershot", newname, i*100);
_root[newname]._y = player_mc._y +2;
_root[newname]._x = player_mc._x + 80;
_root[newname].onEnterFrame = function()
{
var bullet_speed = 30;
this._x += bullet_speed;
if (this._x > 800)
{
this.removeMovieClip();
}
}
View Replies !
View Related
Shooting...
I'm having a little problem with my shooting in this side-scrolling game. I have two buttons to shoot with, (a) for shooting left, and (s) for shooting right. You'll see the problems I have with what I've made through my .fla, so this will save me some typing.
Thanks in advance - JohnnyTightLips
View Replies !
View Related
Shooting
I'm have a mc exported for actionscript as "laser" I want to create a new instance of it everytime someone presses the shooting key and then have it move horozontaly. Anyone know how to do that?
View Replies !
View Related
Shooting
ok i have this problem
im making a top veiw shooting game with tanks and i need to know how to shoot in all directions
im not asking for sombody to write out the exact code for my game i just would like a sample or somthing beacuse i already know how to shoot in one direction but i cant seem to modify it correctly
any tips??
Edited: 12/15/2006 at 07:46:08 PM by sk8morestudyless
View Replies !
View Related
Shooting
im making a side scrolling game like mario and i want to get the guy to shoot in 2 directions but i can never get it right
does anybody have any sample code or anything beacuse i have no idea how to get the bullets to change direction
View Replies !
View Related
Shooting
I am trying to make a rpg game, and in it, the main character can rotate and i am having trouble figuring out what the action script would be to make the main character shoot. and have the bullet not rotate with the main character.
View Replies !
View Related
Shooting Tut
Hi,
I have just read the tut on the shooting aspect of games and i tried it for myself. I altered it so that you shoot on the x axis and you shoot when the space button is pressed.
My question is, how do you make the bullets shoot when the space button is releases? And or can make the bullet shoot at an interval of one second or so when the space is pressed... The bullets for me are shooting at a continuous streem and that may be a too great advantage for a user...
Any help would be great, Thanks...
-n00bFlasher
View Replies !
View Related
Shooting
i face a problem with shooting...the "for" code doesn't run
code :
//this code is writen in spear fisherman's movie clip
onClipEvent (load) {
_root.spear_mc._visible=false;
shooting = false;
positionx = 0;
positiony = 0;
}
onClipEvent (enterFrame) {
if(Key.isDown(Key.SPACE)&&!shooting ){
shooting=true;
_root.spear_mc._x = this._x;
_root.spear_mc._y = this._y;
_root.spear_mc.gotoAndStop(2);
_root.spear_mc._xscale = -100;
_root.spear_mc._visible=true;
//until here the code runs right
for ( positionx = _root.spear_mc._x ; positionx < 800; positionx ++ ){
for (positiony = _root.spear_mc._y; positiony < 600; positiony++){
_root.spear_mc._x += this._positionx;
_root.spear_mc._y += this._positiony;
}
}
else if(Key.isDown(Key.SPACE)){
shooting = false;
}
}
please help!! thank you!
View Replies !
View Related
Help With Shooting Things
I have a little guy that shoots arrows. He can shoot while moving or when standing still. Problem is, eg.
I shoot an arrow using the ctrl key. Fine. If I happen to hit the ctrl key again, the original arrow that was shot off dissapears and a new arrow is shot. Also, if I just hold down the ctrl key, the arrow just sits at the point where it will start from and when i release the ctrl key, the arrow fires as it should. I know that it is something not put in the right spot or loop maybe? Here is my code attached to main char:
onClipEvent (enterFrame) {
shoot = 0;
arrowCounter = 0;
if (abletomove == true) {
if ((Key.isDown(Key.CONTROL)) && shoot == 0) {
n = _root.player._currentframe;
if (n == 1) {
arrowCounter++;
_root.arrowS.duplicateMovieClip("arrowS"+arrowCoun ter, arrowCounter);
_root["arrowS"+arrowCounter]._visible = true;
shoot = 1;
}
if (n == 2) {
arrowCounter++;
_root.arrowN.duplicateMovieClip("arrowN"+arrowCoun ter, arrowCounter);
_root["arrowN"+arrowCounter]._visible = true;
shoot = 1;
}
if (n == 3) {
arrowCounter++;
_root.arrowW.duplicateMovieClip("arrowW"+arrowCoun ter, arrowCounter);
_root["arrowW"+arrowCounter]._visible = true;
shoot = 1;
}
if (n == 4) {
arrowCounter++;
_root.arrowE.duplicateMovieClip("arrowE"+arrowCoun ter, arrowCounter);
_root["arrowE"+arrowCounter]._visible = true;
shoot = 1;
}
}
So I have a var called 'shoot' that basically prevents more than one arrow from being fired at a time. Please help me, I know this is one of those 'DOH' easy problems but I am stumped. :s
View Replies !
View Related
Shooting At Any Angle
Hi,At the moment I have a movie clip that can move left right, up, and down, as well as rotate to any angle by keystroke. I was wondering though how
to write the code so it can shoot at any angle of rotation? At the moment the laser will follow the rotation of the movieclip, but will only go in the _x or
the _y coordinate, never both. Any ideas?
This is on the movieclip:
onClipEvent (keyDown) {
if (Key.getCode() == Key.RIGHT) {
_x = _x+2;
} else if (Key.getCode() == Key.LEFT) {
_x = _x-2;
} else if (Key.getCode() == 40) {
_y = _y+2;
} else if (Key.getCode() == 38) {
_y = _y-2;
} else if (Key.getCode() == 90) {
_rotation += -2;
_root.laser._rotation += -2;
} else if (Key.getCode() == 88) {
_rotation += 2;
_root.laser._rotation += 2;
} else if (Key.getCode() == 32) {
tank_x = getProperty("_root.tank", _x);
tank_y = getProperty("_root.tank", _y);
_root.laser.duplicateMovieClip("laser");
setProperty (_root.laser, _x, tank_x);
setProperty (_root.laser, _y, tank_y);
This is on the laser at the moment:
onClipEvent (load) {
laserMoveSpeed = 20;
this._x = _root.tank._x+60;
this._y = _root.tank._y;
}
onClipEvent (enterFrame) {
this._x += laserMoveSpeed;
if (this._x>600 or this._y<0) {
this.removeMovieClip();
Thanks,
Andy
Art-barn.com
View Replies !
View Related
Soon Done, Please Help Me Out With My Shooting Problem
Hello everbody !
Thanks for all help i've got here, youre great!
i have one more problem 2 finish my game.
In my shoot'em up game i want to force the user to press the CTRL key everytime he wanna shoot, now he can just hold it down..
my code is like this, and i dont know how to force the user to press every time he wants to shoot
if (Key.isDown(Key.CONTROL)) {
laserskuddTeller++;
_root.laserskudd.duplicateMovieClip("laser"+lasers kuddTeller, laserskuddTeller);
_root["laser"+laserskuddTeller]._visible = true;
if someone can help me with this one i would be very thankful!!
S.boy
View Replies !
View Related
Soccer Shooting Help
I have a soccer game with a player who can run in all 8 directions using the arrow keys N, NE, E etc.. he also shoots the ball when the player has it (via a powerbar). However he only shoots Upwards regardless of the direction he is facing.
How would i get the ball to fire off in the right direction? eg. if player was running UpRight (North East direction) then the ball would fire in this direction?
Would i be thinking along the right lines to say if the player was facing NE that the angle of the ball that comes off Player would be 45° or NW equals -45°?
any help would be appreciated.
This script on main timeline allows the Player to get the ball and run with it attached to him also allows the player to shoot upwards with a powerbar (power) (it was adapted from a game which depended on rotation of the player so may not be that useful)
if (ball._x>Player._x-20 && ball._x<Player._x+20 && ball._y>Player._y-20 && ball._y<Player._y+20) {
Player.gotball = 1;
ball._rotation = Player._rotation;
ball._y = Player._y-math.cos(0.01745*Player._rotation)*15;
ball._x = Player._x+math.sin(0.01745*Player._rotation)*15;
} else {
Player.gotball = 0;
}
power._width = Player.force*5;
if (key.isdown(key.shift) && Player.gotball) {
if (Player.force<20) {
Player.force += 0.5;
}
} else {
if (Player.gotball == 1) {
ball.speed = Player.force;
ball.play();
}
Player.force = 0;
}
--------------------------
The ball mc has the following within it:
FRAME 1
stop action
FRAME 2
if (_y<=bounds.up) {
_y = bounds.up;
if (_rotation>=0) {
_rotation = 180-_rotation;
} else {
_rotation = -(180+_rotation);
}
} else if (_y>=bounds.down) {
_y = bounds.down;
if (_rotation>=0) {
_rotation = -(180+_rotation);
} else {
_rotation = 180-_rotation;
}
}
if (_x<=bounds.left) {
_x = bounds.left;
_rotation = -_rotation;
} else if (_x>=bounds.right) {
_x = bounds.right;
_rotation = -_rotation;
}
_y -= Math.cos(0.01745*_rotation)*speed;
_x += Math.sin(0.01745*_rotation)*speed;
if (speed>0.1) {
speed -= 0.1;
} else {
speed = 0;
prevFrame();
}
FRAME 3
prevFrame();
play();
thanks
Geoff
View Replies !
View Related
Help With Shooting Game
Im makeing this game and i want a picture to load when someone clicks the mouse, i only want the pic to load for a short time becuase it is a mussle flash. Can someone post the action script i would need to use with flash 5. thanks
View Replies !
View Related
Intelligent Shooting
Hey, in the game i am currently making i have enemy ships that fire. at present the fire is just moving with "this._x -= 20;".
What im trying to achieve is for the shot to know where the spaceship is, and head towards it, idealy when fired there would be a few lines of code that take the _x and _y positions of the spaceship instance(but only at the time of fire, i dont want the fire to follow the spacehip instance) and head towards it, then carry on going untill off screen, rather than just stop there.
Ive been trying this for hours, but am at a complete loss, can any1 help me?
Thanks
Scott.
View Replies !
View Related
Shooting Problem
I got this code from a tutorial, it's works fine but I want the bullet to be placed a little away from the counter (who shoots).
Now the bullets start in the middle of him, and thats a problem cuz I've maked some hitTests with the bullet... So plz help with this problem...
// set bullet location and direction
clip = _root["bullet"+level];
clip._x = counterA._x;
clip._y = counterA._y;
clip.dx = 20.0*Math.cos(2.0*Math.PI*(counterA._rotation-95+random(15))/360.0);
clip.dy = 20.0*Math.sin(2.0*Math.PI*(counterA._rotation-95+random(15))/360.0);
// add to bullets array
bullets.push(clip);
TjaIfe
View Replies !
View Related
Shooting Game
I need to create a simple shooting game involving a crosshair, target, score counter, i made one a while ago but to need to find a tutprial to refresh my memory.does ne one know of ne that would fit that description?please help!
View Replies !
View Related
Shooting Game
I'm trying to make a small shooting game where you can aim a gun, run around and shoot stuff.
I have everything done except for the bullets and collision. I want to make the game so bullets fly instantly.
How could I make the hit test that would hit a box before it would hit an enemy if the bullets move so quickly?
View Replies !
View Related
Car Chase Shooting
Ok, the typical qu. "how do you make a bullet shoot from a MC" qu. most of been asked so much now! But i searched, and didnt really find anything.
So how do you use script a bullet to be shoot from the _x and _y of an MC,
do you use duplicateMovieClip script?
Ive tried that, a simple
onClipEvent (enterFrame){
if (Key.isDown(Key.SPACE)) {
i++
duplicateMovieClip(_root.bullet, "bullet"+i, i);
}
}
But the MC, just goes back to the place it starts from! (I used onClipEvent (load) to get the _x and _y right and an onClipEvent (enterframe) for the movement).Click here to see the swf
.Click me!
to show wha (the graphics suck i know, they are blocks! i do the graphics after the script)t is happening!
What is wrong with my script? I know something is wrong? But how do i fix it!
Thanks in advance!
View Replies !
View Related
Shooting, Up, Down, Left And Right
Alot of people deserve praise for their tutorials and help on here about how to fire weapons. i found it very useful, however I cannot work out how I could get a character to fire looking left, right, and shooting upwards. currently all my demo's end up in the character firing in one direction and thats all....lol. can anyone help me, or tell me where I can work out how to have a chracter shooting in the direction they are facing, left or right, and up and down. (like metal slug)
Thanks,
Lee.
View Replies !
View Related
Shooting And Landing
I have few guestions about platform games. Okay,I know lots of things about platform games.But, Iīm making a megaman X platform game and I donīt know, how to do shooting.
I know that,the megamans yellow "bullet" is movie clip (MC).
But how to do shooting to right and to left.
Second thing,what I donīt know,is:
How to do jumping WITH DIFFERENT SPRITES,WHEN JUMPING AND DIFFERENT SPRITES,WHEN LANDING.I know that,how to DO JUMPING,but with different sprites when landing and actually jumping.
Okay,thatīs all I donīt know!!! (Iīm making that game on Macromedia Flash MX Professional 2004.
I really need help and I have readed all flashkit tutorials,without help!!! (sorry,but I live in Finland,so my english grammer sucks)
so, if you know something about firing in platform games and jumping with different sprites when lands and different sprites,when jumps!!!
Iīd REALLY APPRECIATE YOUR HELP!!!(you can e-mail me too)
View Replies !
View Related
Shooting Lasers
i got the movement and such done with a spaceship i made, and i set lasers to shoot when i push control, but when i test the movie it says this
Scene=Scene 1, Layer=Layer 1, Frame=1: Line 7: ')' expected
onClipEvent (enterFrame) { if (Key.isDown(Key.CONTROL) { laserCounter++;
i don't know how to fix it
View Replies !
View Related
Shooting Lasers
i got the movement and such done with a spaceship i made, and i set lasers to shoot when i push control, but when i test the movie it says this
Scene=Scene 1, Layer=Layer 1, Frame=1: Line 7: ')' expected
onClipEvent (enterFrame) { if (Key.isDown(Key.CONTROL) { laserCounter++;
i don't know how to fix it
p.s. i'm on flash five
View Replies !
View Related
Shooting Game Help
hey, im trying to get this game up and running, it wont look like this, but i need to get the code right. I need someone to tell me how i can get the gun to shoot, and explain the code if u would.
View Replies !
View Related
Shooting Problem
Hello everyone,
I was wondering how I could have a gun shoot, and have whatever the gun's laser pointer was pointed at get hit? I would like to not have actual bullets if at all possible. Also, could I have there be some interaction between the laser and the object it's pointed at? I looked around in the tutorial section, but there wasnt anything that I was really looking for. Thanks!
P.S. The "gun" in question is a button, not a movie clip, that fallows the mouse (if that helps at all).
View Replies !
View Related
Shooting Game
hi, can anybody tell me where can find all the source code of shooting game? i need to do it but i can't find any related source code of the flash shooting game...please help...
View Replies !
View Related
Fix A Shooting Game
i have this shooting duck game with not so perfect script. i have problem to keep each duck the same destance apart from each other. duck will go faster and faster after shoot a duck...... and when they mover really fast, ducks appear too close or too far from each others. how to keep them consistency. Also, i need a timer for all three levels so each level will need to finish within 10 second. i made the timer function in the game but it is not working. 1. it should start timing once click on the buttong from"introwin" adn start new timing over again after click on 'introwin2". Timing will be 10 seconds. Also, if time reach before user finish the level then should direct to gotoandstop("non").
thanks.
View Replies !
View Related
Fix A Shooting Game
i have this shooting duck game with not so perfect script. i have problem to keep each duck the same destance apart from each other. duck will go faster and faster after shoot a duck...... and when they mover really fast, ducks appear too close or too far from each others. how to keep them consistency. Also, i need a timer for all three levels so each level will need to finish within 10 second. . i made the timer function in the game but it is not working. 1. it should start timing once click on the buttong from"introwin" adn start new timing over again after click on 'introwin2". Timing will be 10 seconds. Also, if time reach before user finish the level then should direct to gotoandstop("non").
thanks.
View Replies !
View Related
Shooting UFOs
Hello,
I have made a ufo game where you control the gun turret with the mouse and fire projectiles at passing ufos over head. The problem i am having is with the hit test on the ufo/projectile
the turret will fire as quickly as the player clicks the mouse but using rapid fire goest straight through the ufo. Where as firing a single bullet will hit the ufo.
So what i need to do is either slow down the user input to single fire. Or make the rapid fire hit the ufo (preferable choice)
The code for the mouse clicks is just this:
_root.turret.onMouseUp = function ()
{
shoot(10, this);
};
where 10 is the speed at which the bullets leave the turret.
and the code for the hit test is on the ufo mcs and is this:
if(this.hitTest(_root.bullet))
{
c.start();
this._x = -76;
this._y = random(400);
speed = random(2)+10;
_root.hit++;
}
would any1 be able to suggest a work around? thanks.
View Replies !
View Related
Aiming And Shooting
Hi, I am Cemrin's brother, you may see me as The Legend later on but for now I am going to use his account because I am too lazy to make another account right now, now to the point
I want to make a game and I made the guy move around already but now I want him to face the mouse direction and shoot when I click the left mouse button, I know this can be done but I don't know how, does anyone here know?
View Replies !
View Related
Shooting Game HELP
i have a shooting game with a few problems. One, during the reload stage of the gun, you can still shoot. Two, once the man walks off screen it dosent go to a game over page. i have no idea how to fix this and all my attempts fail. I cant send you the game because the source file is to big even after cut down. ill give u the actionscript.
The Walking Guy:
onClipEvent (load) {
speedx = 0.9;
}
onClipEvent (enterFrame) {
this._x -= speedx;
if (this._x<=100) {
gotoAndStop("loose");
}
}
on (release) {
this.gotoAndPlay(2);
this.enabled = false;
speedx = 0
}
The man is inside a MC. i dont know how to make it so that when he walks off the screen it goes to a Game over page.
The Crosshair:
onClipEvent (enterFrame) {
startDrag(this, true);
Mouse.hide();
}
onClipEvent (mouseDown) {
if (_root.bullet == true) {
this.gotoAndPlay(2);
_root.bullet = false;
tellTarget (_parent.bulet) {
gotoAndStop(2);
}
}
}
When nothing is hylighted:
_root.bullet = true;
stop();
Inside the Crosshair MC:
First Frame:
Stop();
Last Frame:
tellTarget (_parent) {
_root.bullet = true;
}
tellTarget (_parent.bulet) {
gotoAndStop(1);
}
What needs to be added to not allow the gun to work when reloading???
How do i create a game over page when the stick has walked off the screen??
All answers would be greatly appreaciated!!!
Thanks
Sterockicy
View Replies !
View Related
Shooting Problem
hey every body im trying to duplicate a bullet to go in the direction the gun is pointed...
i tried a few things but couldnt get the bullet under control here is my code that was on the bullet
Code:
onClipEvent (enterFrame) {
_root.slope = (93.5-(_root.hitspot))/(69);
_root.hitspot = (_root.gun._rotation+69);
_root.newCircle._x = (_root.slope)*(_root.newCircle._y)+(_root.hitspot);
_root.newCircle._y -= 2;
if (Key.isDown(Key.SPACE)) {
_root.newCircle = this.duplicateMovieClip("newCircle"+_root.getNextHighestDepth(), _root.getNextHighestDepth());
_root.newCircle._x = 69;
_root.newCircle._y = 93.5;
}
}
could somebody please read through that and let me know if they spot a mustake... also i was looking to duplicate the bullet more then one time...
thanks in advance
View Replies !
View Related
Shooting Game
if I want to make a shooting game, what should I use for the target? Should I turn the target to button so when I use mouse to click for shooting, I can see the effect? Or make it as a movieclip and applied on(press) script for it? Which way is better?
View Replies !
View Related
Shooting By Mouse
if I want to make a shooting game, what should I use for the target? Should I turn the target to button so when I use mouse to click for shooting, I can see the effect? Or make it as a movieclip and applied on(press) script for it? Which way is better? Do anyone have any reference for it?
View Replies !
View Related
[F8] Mouse Shooting
I am making a game like star blaster
(http://www.mofunzone.com/online_game...blaster.shtml#)
The mouse shooting is like how i want mine, but i have 1 problem with my code: I cant use it in hittest. My code is:
Code:
bullet = new Array;
bulletNum = new Number
stageWidth = 550
stageHeight = 550
char.onMouseDown = function()
{
var angle:Number = Math.atan2(_ymouse - this._y, _xmouse - this._x);
var mc = _root.attachMovie("bullet","bullet1"+bulletNum,bulletNum);
mc._x = this._x;
mc._y = this._y;
bullet.push({B_name:mc, B_angle:angle});
++bulletNum;
char.onEnterFrame = function()
{
for (i = bullet.length - 1;i >= 0; i--)
{
bullet[i].B_name._x += Math.cos(bullet[i].B_angle) * 10;
bullet[i].B_name._y += Math.sin(bullet[i].B_angle) * 10;
if(bullet[i].B_name._x < 0 or bullet[i].B_name._x > stageWidth or bullet[i].B_name._y < 0 or bullet[i].B_name._x > stageHeight)
{
bullet[i].B_name.removeMovieClip();
bullet[i].B_name._alpha = 0;
bullet.splice(i,1);
}
}
}
}
Can anyone help me by telling me what to add/change so i can use it with hittest?
View Replies !
View Related
|