Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




[FLASH8]Firing Bullets From A Rotating Spaceship



Hey, all!I'm making an asteroids-esque type game and need to make it so when you press the spacebar bullets come out from the tip of the spaceship. Can someone please explain to me why this code doesn't work? Another thing-syntax was correct last time I checked.
Code:
keyListener = new Object();Key.addListener(keyListener);keylistener.onKeyDown = function() { if (Key.isDown(Key.SPACE)) { shipFire(); }};var i;function shipFire() { i++; var newname = "bullet"+i; var bulletSpeed = 20; _root.attachMovie("bullet", newname, i); _root[newname]._x = _root.total._x; _root[newname]._y = _root.total._y; _root[newname].onEnterFrame = function() { this._x += bulletSpeed*Math.sin(player._rotation*(Math.PI/180)); this._y -= bulletSpeed*Math.cos(player._rotation*(Math.PI/180)); };};
PS- This is the part of the code where I have the firing functionThe problem is the if(Key.isDown(Key.SPACE)) { part of the code. I know this because I did this:
Code:
keyListener = new Object();Key.addListener(keyListener);keylistener.onKeyDown = function() { if (Key.isDown(Key.SPACE)) { shipFire(); trace ("commencing shipFire"); }};
and nothing was traced when I pressed the spacebar. Did I do something stupid (which is often the problem for me) or is there a bigger problem? One more thing-- I know this has been done billions of times in those more-than-common rotating turret & tank games so if you have the .fla for one of those maybe you could compare mine with yours. Thank you!!--Dragonist



KirupaForum > Flash > ActionScript 1.0/2.0
Posted on: 03-06-2007, 09:25 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

My Bullets Aren't Following My Spaceship
I have another problem... alright, this time the problem is that, when i press the button i set to shoot (or in this case, shift), the bullet appears, but doesn't appear where it should. generally, it appears in the upper left hand corner, where i have the spaceship in the middle left. My code is this:

var i = 0;
this.onEnterFrame = function() {
var speed;
speedx = 10;
if (Key.isDown(Key.SHIFT)) {
i++;
_root.attachMovie("Bullet","Bullet"+i,_root.getNex tHighestDepth());
_root["Bullet"+i]._x = Ship._x;
_root["Bullet"+i]._y = Ship._y;
}

Ship is the instance name, so it should start right at the ship, but it appears way off!! oh, and as i move, the distance between the two objects seems to get smaller, until at about 3 fourths of the way across the screen, and all the way on the bottom. I have no clue why this is. If anyone has any insight, it would be greatly appreciated. Oh, and if you know how to make the bullet appear in a layer underneath my ship, that would be cool, too. Thanks!

Firing Spaceship Gun
Does anyone know how to make a spaceship fire when your press Space Bar? If anybody knows the actionscript for it and where you would put it, please tell me. Thanks!

Keyboard Controls For Firing A Bullet In A Spaceship Game
I am coding a space invaders type game and currently i have an enemy that moves back and forth, and a spaceship that moves back and forth and fires with the SPACE BAR. Everything about the firing works fine, except the fact that if you press SPACE and HOLD IT, the bullet just sits in place and does nothing until you let go. I would like the bullet to fire as soon as the key is pressed, not released. I believe my method of using if(key.isDown) is executing the code to fire the bullet while the key is down, and the bullet doesnt move until you let go. I cant figure out a workaround for this. Please take a look at my FLA file that is attached and please let me know if theres any other way to write that with the requested functionality. If not, then oh well I guess Ill just make do with what I have but any help would be greatly appreciated.

THANKS!!

[F8] Help Firing Bullets
Hey guys, I'm having some trouble getting my ship to fire its bullets in my game. I'm following a tutorial given to me by my tutor and I think I've followed it perfectly so I don't understand what's going on. The files are attached.

Can anyone help?

Thanks

Pete

Firing Bullets
This is the first time I am having a go at a game. I need advice on firing bullets from a rotating cannon. I have got the cannon to rotate, but cant get the bullets to fire in the same directions and at the moment the bullets shows it self, but doesn't move.


please can anyone help on how i go about doing this i.e what maths to use etc
I am using flash mx

many thanks

i have two movieclipes called turrent and bullet
here is the ActionScript I have so far.

var bulletNum=0
//moving the turrent gun
turrent.onEnterFrame = function() {
    
 if (Key.isDown(Key.LEFT)) {
        this._rotation -= 6;
     }
     if (Key.isDown(Key.RIGHT)) {
        this._rotation += 6;
     }
}

spacebarListener=new Object();
spacebarListener.onKeyDown=fireBullet;
Key.addListener(spacebarListener);


//GETTING THE BULLETS and fireing the bullets
function fireBullet(){
    
 if (Key.getAscii()==32)
       {
        bulletMC=attachMovie("bullet","bullet"+bulletNum,1000+bulletNum++);
        bulletMc._x=turrent._x;
        bulletMc._y=turrent._y;
     shipAngle=2*Math.PI*(turrent._rotation-90)/360;
     bulletMC.dx=Math.cos(shipAngle);
     bulletMC.dy=Math.sin(shipAngle);
     bulletMC.moveBullet=moveBulletFunction;
     setInterval(buttetMC,"moveBullet",50,bulletMC)
     }
    }
    
    //MOVING THE BLOODY THING
    function moveBulletFunction(){
        bulletSpeed=10.0;
        this._x+=bulletSpeed*this.dx;
        this._y+=bulletSpeed*this.dy
        }
   
   



Square Bullets In Text Field Possible? [Flash8]
can anyone tell me if there is a way of making a dynamic text field list have a square bullet rather than a circle bullet?
thanks

Spaceship Flight
I am currently trying to make a simple space type scroller game and i am currently working on making the spaceship fly
I have opened up the thrust space sample and copied the code from there and edited bits , however would like the spaceship to fly up and down more like the way it flys right (forwards)

This is the code i have so far
I am really struggling with making the spaceship strafe up and down the same way it flys forward. whenthe spaceship flies up or down i don't want it to rotate

I have tried copying and pasting the code for the right movement to the up and down bits and altering it however i can't get it to fly up or down

[edit] I would also like to make it so that when the key left is press the spaceship slows down steadily to a stop. (not stop suddenly or stop too slow like it would otherwise)

Please could someone help me


Code:
onClipEvent (load) {
// declare and set initial variables
thrust = 0.1;
decay = .98;
maxSpeed = 25;
}
onClipEvent (enterFrame) {
// rotate right or left
if (Key.isDown(Key.UP)) {
_y -= 10;
}
if (Key.isDown(Key.DOWN)) {
_y += 10;
}
//
//
if (Key.isDown(Key.RIGHT)) {
// calculate speed and trajectory based on rotation
xSpeed += thrust*Math.sin(_rotation*(Math.PI/180));
ySpeed += thrust*Math.cos(_rotation*(Math.PI/180));
flames._visible = 1;
} else {
// deccelerate when Up Arrow key is released
xSpeed *= decay;
ySpeed *= decay;
flames._visible = 0;
}
//
// maintain speed limit
speed = Math.sqrt((xSpeed*xSpeed)+(ySpeed*ySpeed));
if (speed>maxSpeed) {
xSpeed *= maxSpeed/speed;
ySpeed *= maxSpeed/speed;
}
//
// move spaceship based on calculations above
_y -= ySpeed;
_x += xSpeed;
//
// loop to opposite side of the stage when the spaceship travels off-screen
if (_y<0) {
_y = 300;
}
if (_y>300) {
_y = 0;
}
if (_x<0) {
_x = 600;
}
if (_x>600) {
_x = 0;
}
}

Thank you
I hope you understand what i meant
The bits in red are the up and down movement which i would like to be more like the thrust movement

Spaceship Flight
I am currently trying to make a simple space type scroller game and i am currently working on making the spaceship fly
I have opened up the thrust space sample and copied the code from there and edited bits , however would like the spaceship to fly up and down more like the way it flys right (forwards)

This is the code i have so far
I am really struggling with making the spaceship strafe up and down the same way it flys forward. whenthe spaceship flies up or down i don't want it to rotate

I have tried copying and pasting the code for the right movement to the up and down bits and altering it however i can't get it to fly up or down

[edit] I would also like to make it so that when the key left is press the spaceship slows down steadily to a stop. (not stop suddenly or stop too slow like it would otherwise)

Please could someone help me


Code:
onClipEvent (load) {
// declare and set initial variables
thrust = 0.1;
decay = .98;
maxSpeed = 25;
}
onClipEvent (enterFrame) {
// rotate right or left
if (Key.isDown(Key.UP)) {
_y -= 10;
}
if (Key.isDown(Key.DOWN)) {
_y += 10;
}
//
//
if (Key.isDown(Key.RIGHT)) {
// calculate speed and trajectory based on rotation
xSpeed += thrust*Math.sin(_rotation*(Math.PI/180));
ySpeed += thrust*Math.cos(_rotation*(Math.PI/180));
flames._visible = 1;
} else {
// deccelerate when Up Arrow key is released
xSpeed *= decay;
ySpeed *= decay;
flames._visible = 0;
}
//
// maintain speed limit
speed = Math.sqrt((xSpeed*xSpeed)+(ySpeed*ySpeed));
if (speed>maxSpeed) {
xSpeed *= maxSpeed/speed;
ySpeed *= maxSpeed/speed;
}
//
// move spaceship based on calculations above
_y -= ySpeed;
_x += xSpeed;
//
// loop to opposite side of the stage when the spaceship travels off-screen
if (_y<0) {
_y = 300;
}
if (_y>300) {
_y = 0;
}
if (_x<0) {
_x = 600;
}
if (_x>600) {
_x = 0;
}
}

Thank you
I hope you understand what i meant
The bits in red are the up and down movement which i would like to be more like the thrust movement

Big Spaceship Vizualizer
Hi guys

Seem to have come across a little problem,
I've been playing round with Big Spaceships Visualizer fantastic by the way, and I'm trying to use laco's tweening engine with it and flash really doesn't like it...

Any help is greatly appreciated, answers on the back of a postcard.

thanks in advance guys.

Angle Of Spaceship (FLASH 5)
as i just typed everything in detail and it didnt post >_< im going to do it again alot quicker so i hope it makes sense

I have a "spaceship" MC that rotates and thrusts and all that. the scipt its using is:

onClipEvent (load) {
moveSpeed=10;
_root.laser._visible=false;
laserCounter=1;
thrust = 1;
decay = .99;
maxSpeed = 15;
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.CONTROL)) {
laserCounter++;
_root.laser.duplicateMovieClip( "laser"+laserCounter, laserCounter );
_root["laser"+laserCounter]._visible=true;
}
if (Key.isDown(Key.RIGHT)) {
_rotation += 10;
}
if (Key.isDown(Key.LEFT)) {
_rotation -= 10;
}
if (Key.isDown(Key.UP)) {
xSpeed += thrust*Math.sin(_rotation*(Math.PI/180));
ySpeed += thrust*Math.cos(_rotation*(Math.PI/180));
flames._visible = 1;
} else {
xSpeed *= decay;
ySpeed *= decay;
flames._visible = 0;
}
speed = Math.sqrt((xSpeed*xSpeed)+(ySpeed*ySpeed));
if (speed>maxSpeed) {
xSpeed *= maxSpeed/speed;
ySpeed *= maxSpeed/speed;
}
_y -=ySpeed;
_x +=xSpeed;
if (_y<0) {
_y = 400;
}
if (_y>400) {
_y = 0;
}
if (_x<0) {
_x = 550;
}
if (_x>550) {
_x = 0;
}
}

Arcade Game -Spaceship
Hey, this script is on my movieclip, that is my spaceship in my arcade game.
Why doesn't it work?

onClipEvent(load){
moveSpeed=10;
_root.laser._visible= false;
laserCounter = 1;
scrollx = _root.mainGround.ground._width/3;
scrollStart = false;
maxLasers = 4;
depthCounter= 1;
}
onClipEvent(enterFrame){
if (Key.isDown(Key.CONTROL)) and laserCounter<= maxLasers {
laserCounter++;
_root.laser.duplicateMovieClip("laser"+laserCounte r, laserCounter);
_root["laser"+depthCounter]._visible= true;
depthCounter++;
if(depthCounter>maxLasers) {
depthCounter= 1;
}
}
if(Key.isDown(Key.RIGHT)) {
if(this._x<scrollx) {
this._x += moveSpeed;
} else {
scrollStart= true;
}
} else if (Key.isDown (Key.LEFT)) {
this._x -= moveSpeed;
}
if(Key.isDown (Key.DOWN)) {
this._y += moveSpeed;
} else if (Key.isDown.UP)) {
this._y -= moveSpeed;
}
}
onClipEvent (keyUp) {
if (Key.getCode() == Key.RIGHT) {
scrollStart = false;
}
}

[B]Spaceship That Moves 360 Degrees?[/B]
I need to make a space ship that rotates when the left and right buttons are pressed, and and goes in the direction it's pointing when up is pressed. The rotating part was easy, but the moving forward part is nor so easy. I figure it'll take a whole lot of math, so maybe there's a genius out there who can help me out (or at least someone who did better in math than me).

(I'd also like to be able to set the ship's speed and turning speed, but I could probably figure that out on my own)

Thanks a bunch!


-Zaphodbeblebrox

Big Spaceship Thumb Transitions
ok, go to http://www.bigspaceship.com/ and watch the featured thumbnail as it goes from one slide to the next.

i want to learn how to set up advanced transitions like that, but i have no idea what's involved so i don't know what i need to learn. i saw someone do something similar and they said it was a scripted mask - but is it just a (bunch of) shape tween(s) and the scripts handle loading the next image over top of the pevious? (i'm good for doing that, the transitions between slides are just weak).

i wasn't sure where to put this, so appologies if i put it in the wrong spot.

Taking Control Over A Spaceship
Hey Guys,

For a new project I want to create a spaceship that I can control with my keyboard.

The control over the ship should be a bit like GTA 2. If you press UP, the spaceship accelerates. Till it reaches a maximum speed.
If you press down, it will react as a brake. slowing the ship down.
If you press left or right, it will turn that way.

If you have some speed and you let the ship go it slowly slows down. But won't stop immedeatly.

Anyone has an idea on where to start?

Some SpaceShip Game... Help Needed
Hey, I'm currently working on a project with one of my friends, and am stuck now... I made the spaceship work on the Arrow Keys and stuff..
Hittest, all ok.
But now comes the finish, if I try the hittest with a movie clip to move to 'scene2' it doesnt work:

Normal hittest:

ActionScript Code:
if (!_root.wall.hitTest(_x+x, _y+y, true)) {
        _x += x;
        _y += y;
    } else {
        speed *= -.9;
    }


Finish hittest:

ActionScript Code:
if (!_root.finish.hitTest(_x+x, _y+y, true)) {
    gotoAndPlay ("Scene 2", 1);
    }
    else {
        speed *= -.9;
    }



I can't see the problem... Do you?
Please tell me what to do if you know, or anything!
Thanks!

Need Spaceship To 'bounce' Off Walls For Game.
Hi. I need help. I've got a game that has a spaceship, and you fire at your opponent (don't have opponent yet). Anyways, I need the ship to 'bounce' when it hits the wall, and not go outside where you can't see it. I need to take into account the speed it hits the wall and the angle. My game is below. Click on the swf to make sure it's active. Arrow keys to move, and spacebar to fire.



If this didn't work, click here,
http://www.f5b.my100megs.com/shipgame.swf

Hope you can see it. Reply back soon plz.

l8er

Canon Recoil And Spaceship Array Help
Greeting to all helpful people,

I am doing a space invader game and I need help on the recoil of the canon whenever it shoots out a canon ball. It just doesn't animate properly and I have attached my files for easy explanation.

I also want to have several space ships flying across the sky, but I am not sure whether to use Array or just a for loop to duplicate the movie clips. In this game, there's also a countdown timer. I would also like to create a Pause and Play button for user who wants to pause the game.

Please help to solve the problem or suggest any recommendation that can improve the game coding. Thank you! You can email or MSN me.

[MX] Spaceship Control - Roation & Thrust
hi

ive had a search of the tutorials and forums and am still stuck so...

im trying to create a basic spaceship flying game and the first problem ive got is controlling the ship. the controls i need are thrust and left-rotate and right-rotate. much like this,
http://www.kirupa.com/developer/mx/gamecontrols.htm
at the start this tut mentions 'game control tutorials' does anyone know where these are? i think i would find these useful. the above tut doesnt go into scripting.

at the moment to control rotation i have,

Code:
onClipEvent (enterFrame){
_rotation += 0;
}
on (keyPress "<right>") {
_rotation += 7;
}
on (keyPress "<left>") {
_rotation += -7;
}
but there is an initial pause in the rotation. can anyone suggest an alternative code.

thanks for any help

steveo

[MX] Spaceship Control - Roation & Thrust
hi

ive had a search of the tutorials and forums and am still stuck so...

im trying to create a basic spaceship flying game and the first problem ive got is controlling the ship. the controls i need are thrust and left-rotate and right-rotate. much like this,
http://www.kirupa.com/developer/mx/gamecontrols.htm
at the start this tut mentions 'game control tutorials' does anyone know where these are? i think i would find these useful. the above tut doesnt go into scripting.

at the moment to control rotation i have,

Code:
onClipEvent (enterFrame){
_rotation += 0;
}
on (keyPress "<right>") {
_rotation += 7;
}
on (keyPress "<left>") {
_rotation += -7;
}
but there is an initial pause in the rotation. can anyone suggest an alternative code.

thanks for any help

steveo

Drawing A Side-scrolling Spaceship In Flash
Hi Guys,
I just want to know where I can find some simple tutorial on how to draw sidescroller space ships. I'm working on a game and i've got my hero spaceship here:

http://www.flashninjaclan.com/apollo.swf

I need to draw some enemy spaceships that fit the theme of my hero spaceship, anyone got any good tutorials to point me to.

ScrollPane In Flash8 Not Working Quite Right Flash8
http://www.karaedwardsvo.com

When you click on either "about" or "clients" it takes you down the timeline to a ScollPane that is set to load an external swf (with a tranparent background if that makes a difference). This works fine for me 100% of the time on my Mac but have had a couple, including the client, who say the in IE on a PC the scroll bar doesn't appear and the swf shows up low on the screen. Anyone have any thoughts on this?

Bullets
How do you make bullets come out in the direction a gun is pointing, also how do u set speed of it, i know how to stop it and to make things do stuff when the object hits it.
Cheers

Your Friendly Neighbourhood PlugDude

Bullets
Hi,


Im trying to build a top down shooter but I hit A bump with the bullets so far the only way I have found to do bullets is x =- 1 etc
is there any other way to fire bullets?

Bullets
Is there a way to make bullets in Flash like the way you would in Word or html?

Bullets
Hi,

I am trying to put bullets in my flash application using Action script.
I don't know whether it is possible or not. If any one know , please reply to
my query.If possible, how many types bullets can I insert in my flash application.

Bullets
You know how in Word you can use bullets before sentences? How can I duplicate that in Flash without having to draw it?

Thanxs!

Bullets?
Hello.

I am making a simple space game where you fly along and can strafe side to side. I have made my spaceship so that it can shoot bullets

What i would like to know is what do i need to do so that when a bullet hits an enemy ship that ship explodes?

//This is how i made my bullets
First of all i made a movie clip called 'bullet' which has an instance name of bullet.

I applied this script to the bullet


Code:
onClipEvent(load)
{
speedX = 25
}

onClipEvent(enterframe)
{
for (var i = 0; i < speedX; i++)
{
_x++;
}
}
And then i applied this spcript to the spaceship that shoots the bullets

Code:
//Bullet Shooting
onClipEvent (load)
{
i = 0
timer = 0
dir = "right"
}
onClipEvent(enterframe)
{
if (!Key.isDown(Key.SPACE))
{
timer = 5
}
if (Key.isDown(Key.SPACE))
{
if (timer >=5)
{
i++
if (dir == "right")
{
duplicateMovieClip("_root.Bullet", "Bullet" + i, i);
_root["Bullet" + i]._x = this._x
_root["Bullet" + i]._y = this._y - 0
_root["Bullet" + i]._visible = true
}

timer = 0
}
timer++
}
}
//
Please help me

Bullets ...
Hello,

Anyone know how to get bullets for text in flash?
------------------
Example:One
Two
-----------------

Thank you.

Bullets?
Hello.

I am making a simple space game where you fly along and can strafe side to side. I have made my spaceship so that it can shoot bullets

What i would like to know is what do i need to do so that when a bullet hits an enemy ship that ship explodes?

//This is how i made my bullets
First of all i made a movie clip called 'bullet' which has an instance name of bullet.

I applied this script to the bullet


Code:
onClipEvent(load)
{
speedX = 25
}

onClipEvent(enterframe)
{
for (var i = 0; i < speedX; i++)
{
_x++;
}
}
And then i applied this spcript to the spaceship that shoots the bullets

Code:
//Bullet Shooting
onClipEvent (load)
{
i = 0
timer = 0
dir = "right"
}
onClipEvent(enterframe)
{
if (!Key.isDown(Key.SPACE))
{
timer = 5
}
if (Key.isDown(Key.SPACE))
{
if (timer >=5)
{
i++
if (dir == "right")
{
duplicateMovieClip("_root.Bullet", "Bullet" + i, i);
_root["Bullet" + i]._x = this._x
_root["Bullet" + i]._y = this._y - 0
_root["Bullet" + i]._visible = true
}

timer = 0
}
timer++
}
}
//
Please help me

Bullets
hello! i want to use bullets and numerings before any paragraph text line in my flash movie...how can i do this? i cant see any choises for bullets (

Sub-Bullets?
Is there any more elegant way to produce sub-bullets in a flash field than using css classes? Using the classes is easy enough, just looks unnecessarily ugly in the code. =P

Thanks for any help!

Those Pesky Bullets
Trying to add bullets to dynamic text array from txt file but so far no luck,

Well this is where I'm up too, I feel close but yet so far,

this is on my mc containing a dynamic textfield.

onClipEvent (load) {
bulletpoint.text=_parent.passarray[1];
bulletpoint.multiline=true;
bulletpoint.wordWrap=true;
var format = new TextFormat();
format.bullet = true;
bulletpoint.setTextFormat(format);

}

In my first frame I have :

varReceiver = new LoadVars();
varReceiver.load("external013.txt");
varReceiver.onLoad = function() {
passarray = this.mypage.split("|");
};

Bullets Coming Out Of Nowhere
hello,

i just wanted to ask how people
make a command that whenever they press a key,

a tiny bullet springs out of a gun

and it just continuously goes to where that
guns pointed(namely left or right) just goes straght
and dissappers when off screen,

i've read a tutorial here about that
but it seemed quite different than the
one im looking for

so can anyone be able to help me out with this?

thnx a bunch!!

Bullets And Hittest
I'm making a sort of side scrolling shooter, and I've ran into a second problem:

When I shoot a gun I want the bullet to exit the gun barrel and move (in the angle in which it shot from) along the movie screen. This all works with this script:


Code:
obj2 = new Object();
obj2.x = shot_release._x;
obj2.y = shot_release._y;
this.localToGlobal(obj2);
_root.bullet_trace(obj2.x, obj2.y, this._rotation, 20);

('this' is the arm holding the gun)

'bullet_trace' function in _root:

Code:
function bullet_trace(xx, yy, angle, damage){
_root.attachMovie("bullet_trace_mc","bullet_trace"+_root.Bullettrace_i,_root.Bullettrace_i,{_y:yy, _x:xx});
setProperty("bullet_trace"+_root.Bullettrace_i, _rotation, angle);
_root.Bullettrace_i++;
}


Now I want to hittest, it's the only way I know off to get the info whether a bullet hits something or not. I made a mc with this code:


Code:
onClipEvent (enterFrame) {
a = 0;
while(a < 10){
string = "bullet_trace"+(_root.Bullettrace_i + a);
with("_root."+string) {
if (this.hitTest(getBounds(_root).xMax, _y, true)) {
trace('hit');
}
if (this.hitTest(getBounds(_root).xMin, _y, true)) {
trace('hit');
}
if (this.hitTest(_x, getBounds(_root).yMax, true)) {
trace('hit');
}
if (this.hitTest(_x, getBounds(_root).yMin, true)) {
trace('hit');
}
}
a++;
}
}


I used while(a < 10) because there can be more bullettracers in the movie per frame.

This part :

string = "bullet_trace"+(_root.Bullettrace_i + a);
with("_root."+string)

does not work. If I try with(_root.Bullettrace_i20) for testing it will trace('hit'); so the problem lays with the string part. I tried several other things and I have no clue what to try next. Anyone has an idea? Thanks in advance.

Making Bullets Fly
Hello all! I'm new to the Flashkit.com forums and a regular user of the flashkit site and now I need some help with making a shooting game. Right now I have an aeriel third person view of the game with the character moving wherever you want, a crosshairs symbol for the cursor, and the character rotating depending on where the crosshairs are. Now I'm trying to get a shooting animation to work. I want the bullets to fly after clicking and releasing the mouse button, hopefully you guys can help me out with this... Thanks!

[mx04] Bullets
i never leaned how to do gun bullets.


lets say i draw 1 bullet in one syimbol. How would i duplicate it during runtime.

when mouse down you shoot and the bullet flys to the right with its own x and y coordinate. Then on impact it dissapears or gets recycled.

Help Arching Bullets
Hey guys im working on make a tank wars game for a project and i am having a little trouble getting the bullets to arch. I can get them to shot at the angle of the cannon but can not get the arching effect.
Thanks for any help

Game - Bullets
Can anyone get me a "bullet script"
for example when I click some specific key, bullet will shoot from my character causing damage in whatever in it's way (for example another character)

Thank you

Stuck With Bullets
Can anyone help me, the actionscript works, but i can't get the bullets to remove them selfs when they hit the enamies or when they leave the screen.

Code:
}
function fireBullets() {
i++;
fire = true;
_root.MachineGunAmmo -= 1;
var newname = "bullet"+i;
_root.attachMovie("bullet",newname,i*100);
_root[newname]._y = _root.Plane._y+1;
_root[newname]._x = _root.Plane._x+65;
_root[newname].onEnterFrame = function() {
var bullet_speed = 20;
this._x += bullet_speed;
if (_root[newname]._y>900) {
removeMovieClip(_root[newname]);
}
if (this.hitTest(_root.Enemy)) {
removeMovieClip([newname]);
with (_root.Enemy) {
gotoAndPlay("Dead");
}
}
};
}
}

[F8] Enemy Bullets
How would i make an enemy bullet go towards the main charecter?

Best Method Bullets
Well I think i finally got character control down the way I like it and my aiming mechanism is set, but I need to know how to do a few things...

1. The best method to create bullets that travel on a set path at a set distance but do not spam up memory by existing infinatly becuase then my character contorl get's laggy.

2. How to set events for when the number row keys (1,2,3,ect) so i can have weapon select on nubmer row (right now I have 2 weapons unarmed and handgun so i used built in keys (INSERT and DELETE)

htt[s://home.comcast.net/~archmagediablo/gun.fla

Custom Bullets With CSS?
Hi, is there any way to make a custom bullet for the <li> items? or for any custom CSS classes? I'm presuming there isn't, and I need to load bullets as seperate text fields - but I just want to verify this belief! thanks!
seb.

Bullets In Flash With XML?
What is a good way to format bullets and tabs in my XML text that I am using in Flash?

Inserting Bullets Into XML
Hello Everyone.

I am saving some data into an XML and i need to be able to store bullets in a paragraph and let a user edit those bullets. The paragraphs are a simple text nodes:

<paragraph>I have a paragraph here and here</paragraph>

So my problem is that i know how to turn the whole thing into a bullet but i don't know how to do that with a section that a user picks. If for example they wanted to create a bullet from "paragraph here" - how do i designate the text before and text after to remain a text node 'before' and text node 'after'. Or should i do this in a different way??

Any help or pointers will be appreciated.

Thanks!

Alina

Bullets , At Angels
hello..
its now really late and i should be sleeping, but instead im doing this...

anyways ...

i have 4 set variables (im just making this up , theyll change from bullet to bullet ingame)
bulletSpeed=200
bulletAngel=45
bulletX=100
bulletY=100

now i want to know how to make it so every time a function is called a bullet (movie clip called 'bullet' is created at those coordinates moving at that speed and going in that angel (and deleting itself after 3 seconds)

thanks )

Bullets , At Angels
hello..
its now really late and i should be sleeping, but instead im doing this...

anyways ...

i have 4 set variables (im just making this up , theyll change from bullet to bullet ingame)
bulletSpeed=200
bulletAngel=45
bulletX=100
bulletY=100

now i want to know how to make it so every time a function is called a bullet (movie clip called 'bullet' is created at those coordinates moving at that speed and going in that angel (and deleting itself after 3 seconds)

thanks )

Color Of <li> Bullets
I have html content loaded into dynamic text fields from XML.
I was wondering if anyone has been able to change the color of the <li> bullets in flash???
They stay black for me not matter what the textField, textFormat, or CSS properties are....
I can apply CSS in flash to the li tags, but it only effects the text in the li's, not the actual bullets.

Bullets In Flash
This is probably something really simple. How do I insert bullets in flash?

Formatting Bullets
I have a number of bullets being loaded with the text into a dynamic text box.

Not matter what I do the bullets remain black when I want them the same color as the text (white).

Any ideas ?

Copyright © 2005-08 www.BigResource.com, All rights reserved