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
FlashKit > Flash Help > Flash ActionScript
Posted on: 10-19-2006, 12:02 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Arching Text
I am trying to replace a graphic with text in flash, but can't seem to figure out how to arch the text around a circle. Here are the files http://www.highpoint.edu/~councm04/vision The text on the intro needs to be fixed and I can't arc it. Does anyone know of a tutorial or quick way to do this in Flash? If not flash, Freehand?
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.
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
[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
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");
}
}
};
}
}
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.
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.
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
}
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 ?
Pesky Bullets In Mac Font
I'm looking to see if anyone has experienced a similar problem or found a way around it. Using the Mac version of Flash MX, I have found a dramatic inconsistency with the usage of bullets (option 8) in that sometimes, they get turned into the Y's with the lines through them, and sometimes not. Everytime I think I have figured out the problem, something comes up to shoot down my theory.
The exact same font files, used on two or three different computers running flash MX, produce varying results-- on one computer, all bullets are fine. On one computer, bullets can't be bold-- unbold bullets remain fine. On one computer, it seems nothing works but drawing in circles manually.
What's more troubling is the fact that after opening a file off the bold/non-bold computer on the one that had previously been fine regardless, the previously fine computer adopted the same bold/unbolding problem; this leads me to believe it's a preference of some sort somewhere causing all the headaches. I've searched the manual, the online help, and all the options in the program I can find but can't seem to locate this.
Can anyone tell me the solution to this? Or am I simply losing my mind with all these differences?
Using Bullets And <br> In Txt Fields Dynamically?
i know you can put a bullet at the end of an array using the array.join() AS, but what if i had an array[x] that was lengthy and i wanted to dynamically insert a bullet and/or <br> depending on the length?
so i could do something like this:
Quote:
title
- blah blah blah blah
- slkfjsfdl sfdlksjfdlksfd lksfdkl lkasfd lksfd jaslfdklka
sfdlkj sdflkj sfdlksfdlsfdk asfdlkasfdasfd
- 123132 12321 123 132132
(where the returned text would be aligned nicely next to the bullet above it like microsoft word bullets?)
im using F5.
any ideas? thanks
Dynamic Text With Bullets
Hey,
Anyone out there know of a way to incorporate bullets within a dynamic text set-up? Currently I have a .swf file reading from a .txt file however, in the case of bullet points I am manually setting the <br>'s for line breaks as well as adding empty spaces to include any indentation. Any help would be great.
Thanks
-j-
Plane Game Bullets
I just took the tutorial on how to make objects move from commands. My only questions left are these: 1. how do I set the buttons to use. I tried typing an A where it originally said LEFT, but it did not work.
My next question is how would I get a bullet (im using red lines) to come from the plane. I tried making a movie clip but it would always come from the same spot.
Finally, what is the code to say something like "on (press) (lets say space). I do not know how to do that? Any help? I think this question is the easiest one of them all
Bullets No Problem, But Gifs Are
I have 2 gifs on certain Powerpoint pages and the white gif background stands out, wheras those gif backgrounds were transparent in the original Powerpoint. So, do I have to go through all 24 slides and replace these gif images with vectors? Big job for something that is due tomorrow.
I haven't exported the Flash file with a Powerpoint element yet, but I'm guessing that the animations that were in the Powerpoint file are going to be static now. Am I right?
Would RoboFlash help with any of this?
Bullets With External Txt Into Array
Hi I know that I can use <AI> to generate a bullet from a txt file when dynamically loaded in to a textfield but..
Is it possible to create bullets for text imported from a txt file into an array when using the split technique.ie.
varReceiver = new LoadVars();
varReceiver.load("external.txt");
varReceiver.onLoad = function() {
passarray = this.myArray.split("|");
Custom Password Bullets?
Is it possible to replace the asterisks in a password field with bullets? I've looked in all my Flash books and searched FK with no help.
Thanks!
Changing The Color Of Bullets In A <ul> Tag?
I'm pulling in text dynamically from a text file and formatting it using html tags. My text is white on a black background. When I use the unordered list <ul> tag it makes all the bullets black.
Is there any way of making these bullets white? (the font color tag doesn't change them)
Bullets Fired In All Directions
Hello, I need help with some thing. I need this so badly. Here is a sample file. Notice how the bullets fly in the direction that the person aims at, can anyone point out what does this? Or could anyone teach me how? I have inspected this game and cannot find the source of it. Please help!!??! Please PM me if you want, it makes it easier for me to find answers. Sometimes I loose the post that I posted in, thanks.
-Brent
Shooting Multiple Bullets
I have this code and it want it so that it will shoot multiple bullets, currentgun 2 is a shotgun, also how do I make it so that you can hold the mouse down to shoot?
Code:
onClipEvent (mouseDown) {
fireBullets();
var i;
function fireBullets() {
i++;
speed = _root.hero.currentgunspeed;
var newname = "bullet"+i;
_root.attachMovie("bullet", newname, i*100);
if (_root.hero.currentgun == 2){
i++;
_root.attachMovie("bullet", newname, i*100);
i++;
_root.attachMovie("bullet", newname, i*100);
}
_root[newname]._y = _root.hand._y;
_root[newname]._x = _root.hand._x;
_root[newname]._y = _root.hand._y;
_root[newname]._x = _root.hand._x;
_root[newname]._rotation = _root.hand._rotation;
_root[newname].sety = _root._ymouse;
_root[newname].setx = _root._xmouse;
_root[newname].createy = _root.hero._y;
_root[newname].createx = _root.hero._x;
_root[newname].timetokill = 0;
myRadians = Math.atan2(_root[newname].sety-_root.hero._y, _root[newname].setx-_root.hero._x);
_root.xMove = Math.cos(myRadians)*speed;
_root.yMove = Math.sin(myRadians)*speed;
_root[newname].movey = _root.ymove;
_root[newname].movex = _root.xmove;
_root[newname].onEnterFrame = function() {
this._y += this.movey;
this._x += this.movex;
this.timetokill++;
for (n=0; n<20; n++) {
var name = "enemy"+n;
if (_root[name].hitTest(this._x, this._y, true)) {
_root[name].health -= _root.hero.currentgundamage;
this.removeMovieClip();
}
}
if (_root.ground.hitTest(this._x-5, this._y, true)) {
this.removeMovieClip();
}
if (this._x>_root.hero._x+600 or this._x<_root.hero._x-600 or this._y>_root.hero._y+600 or this._y<_root.hero._y-600) {
this.removeMovieClip();
}
};
}
}
How Can I Make A Guy, Shoot Bullets?
Hi!
Title explains it..
How can i do this with simple actionscript?
I have tried.. Having the bullet inside the mc (moving) but when i shoot, the bullet follows the mc moving....
[F8] Best Way To Create And Move Bullets?
What is the best way to create and move bullets with minimal speed loss?
this is what i have now but it seems to slow the game down about 5 fps.
Code:
function shoot(ob){
bulletid++;
if(bulletid>100){
bulletid=0;
}
bn="bullet"+bulletid;
trace(ob._y);
_root.attachMovie("bullet_1",bn,200+bulletid);
_root[bn]._x=ob._x;
_root[bn]._y=ob._y;
_root[bn]._rotation=ob.arm_front._rotation;
myRadians = _root[bn]._rotation*Math.PI/180;
_root[bn].xMove = Math.cos(myRadians)*ob.wspeed*-1;
_root[bn].yMove = Math.sin(myRadians)*ob.wspeed*-1;
_root[bn].onEnterFrame=function(){
this._x+=this.xMove;
this._y+=this.yMove;
}
}
[F8] HELP Bullets Stick In Non-English
I've got a text box (using _sans, html on) loading html from xml (utf-16) files and, when I load English text with the <li> tag, it works fine. When I load Russian or Korean text with the <li> tag, the field suddenly marks EVERY line with a bullet and it sticks and I can't make the bullets go away...
HELP!!!!
I attached an fla and several xml files so you can see what I'm talking about. Also, the Korean doesn't display in the field...not sure why. It works in our actual application, but we're loading the xml files using SWF Studio, but we have the same bullet issue...
This has been driving me crazy all weekend, and I'm about to throw in the towel...
Edit: I should clarify, when you select Rus or Kor bullets, the first time it loads, it displays fine. When you load ANY other file (even one with no list tags), it puts all the bullets on the fields...
Limiting Number Of Bullets
This has been an issue to me since I switched to AS3.
PHP Code:
//AS2
count++;
attachMovie("bullet", "bullet" + count, count);
if (count > 20) {
count = 0;
}
This has always been how I limit the number of bullets to prevent lag but I don't know how to do it in AS3.
PHP Code:
stage.addEventListener(Event.ENTER_FRAME, myfunction);
function myfunction(event:Event) {
if (fire == true) {
var bullet = new bulletmc;
addChild(bullet);
bullet.x = 100;
bullet.y = 100;
}
}
//If I press a button, fire becomes true and if I let go, it becomes false
//Let's pretend the bullets do move
How do I convert the way in AS2 to AS3?
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!
Custom Bullets Via Font - NOT Via CSS
Folks,
Pulling my hair out... after much searching I've come to the realization that Flash didn't intend for us to be able to use custom bullets via CSS.
What I'm attempting to do is split/join a string brought in from an external XML file. What I'd like to do is split where I find a <li> and replace it with <span class='check'>R</span>.
In my CSS I define the check class as having font-family: Wingdings 2;
Of course, Flash only displays an "R" where it should be displaying the Wingdings 2 symbol for "R", which happens to be a box with a check in it.
What am I doing wrong? Even trying <font face="Wingdings 2">R</font> in place of the <span...> isn't working.
Thank in advance.
Steve
Help With Bullets Hold Mouse Down ?
hey .. im in the making of a alien invaders type game .. and i wanna input an upgrade after level 3 .. like u can purchase it or something .. i wanna have it upgrade to rapid fire .. like holding the mouse down .. but i cant seem to figure out how to make it fire by holding the mouse down.. the code i have says _rootonMouseDown = function .. so why wouldnt that repeat the action .. ? im baffled ne help would be apprieciated .. heres the link to the game so far..
http://img46.exs.cx/my.php?loc=img46...vaders2223.swf
also if it helps heres the code im using
//-------------MOUSE CLICK----------//
_root.onMouseDown = function() {
// duplicate the bullet mc
attachMovie("bullet", "bullet"+bulletNum, bulletNum);
// set the coords to the mouse clik
eval("_root.bullet"+bulletNum)._x = _root.defender._x;
eval("_root.bullet"+bulletNum)._y = _root.defender._y;
// increment the bullet number
++bulletNum;
// if more than 5 bullets , start again at 0
if (bulletNum>5) {
bulletNum = 0;
}
};
|