ActionScript 2.0 :: 360-Degree Projectile Firing?

Sep 15, 2010

This is my first week of learning Flash and ActionScript, and because I don't have a good ActionScript book yet, I've been reading several basic Flash game programming tutorials online and doing my best to understand and learn the syntax and methods. After successfully creating "my" first Flash game (a space-shooter from the great tutorial on this website), I decided to set a high bar for myself and try to make a top-down shooter which I can expand on as I learn more.

My problem is that I simply cannot get Flash to recognize my "bullet" movie clip symbol in the library, place it by my character's gun with correct rotation, and finally shoot it off into the distance. The gun is part of the same .png as the character is in, so it is part of the same symbol ("player").

Below is the code I am working on for the shooting code:

Shooting Code: (Applied to my "Player" movie clip symbol's "Actions")
onClipEvent(load)
{

[code]....

In my Flash scene, I have a "Crosshairs" movie clip symbol which I have successfully gotten to replace the hidden standard mouse cursor, a "player" movie clip who can move around the scene while always facing the crosshair, and a "bullet2" movie clip in my library. Both the player and bullet MC's have identifiers of the same name applied to them.

View 1 Replies


Similar Posts:


Actionscript 3 :: Get My Projectile To Arc And Go Back Down?

Mar 5, 2012

My projectile begins to arc but then moves to the right uncontrollably and does not ever go down.[code]...

View 1 Replies

Actionscript 3 :: Move Projectile In An Arc To Mouse X,y?

Dec 23, 2011

I'm creating a game where you have a cannon at the left edge of the screen. I want to be able to fire a cannonball from the cannon in an arc so that it intersects where the mouse pointer is on the screen.

I've seen a few examples that move a projectile in an arc from point a to point b, but what I need is for the cannonball to first move along the axis of the cannon itself, it's no good if the ball leaves the end of the cannon at a different angle to which the cannon is pointing.

The only force acting on the ball will be gravity and it's starting velocity.

Also to complicate matters, I need the cannons angle to change according to how far away the mouse pointer is from the end of the cannon, so if the pointer is far away than the cannon will point upwards say at an angle of 45 degrees, but if the pointer is very close to the end of the cannon then the cannon will point directly at the pointer, this I've more or less already got working by just getting the distance between them and then dividing it by a number and subtracting it from the rotation value of the cannon, but it's a bit of a rough way of doing it.

EDIT Using the code below I've managed to the line in the screen shot below. But as you can see it's not the trajectory I need, I need something more like the red line I've put in.

And here's how I've implemented the code (probably wrongly)

public class GameTurretLine2
{
var rt:Object = null;

[Code]....

Also for some strange reason, the line created by the code flips, from how it is in the screen shot to an indented code (y flipped) just by moving the mouse a tiny amount, so as you move the mouse the line jumps everywhere.

View 1 Replies

ActionScript 2.0 :: Create A Tracer On Projectile

May 10, 2006

I have a flash 8 movie that uses actionscript to create a projectile, kind of like a ball being fired from a canon. I want to create a line that follows and draws the path of the projectile.

View 2 Replies

ActionScript 3.0 :: Placing And Duplicating Projectile Bullets

Feb 6, 2009

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

View 0 Replies

ActionScript 3.0 :: 3D Projectile Game - HitTest Point

Mar 4, 2011

I have a 3d projectile game I'm working on. I want to check if the projectile moving down the z axis hits wall on two sides. The walls are set up like this:
leftWall = new wall();
leftWall.x = 10;
leftWall.y = 360;
leftWall.z = 230;
leftWall.rotationY = -95;
How to do collision detection in this 3d space?

View 2 Replies

ActionScript 3.0 :: Fast Projectile Motion Without Increasing Frame Rate

Oct 9, 2011

I have a projectile that generated by this code:
//initial code
bullet1.x = bullet1.x + (cur_speed_x / 10);
bullet1.y = bullet1.y - (cur_speed_y / 10);
cur_speed_y = cur_speed_y - g / 50;
[Code] .....
I want the projectile to keep the same path but just move faster without having to increase the frame rate of the movie. Where I should increase the motion in the above formulas to get that to happen?

View 1 Replies

ActionScript 3.0 :: Projectile - Get The Missile To Actual Move In The Direction The Character Is Facing

Sep 17, 2010

I have this code to add my missile to the screen PHP Code:

[Code]...

it adds right where my character is but I cant seem to figure out how to get the missile to actual move in the direction the character is facing. heres how it looks [URL]

View 1 Replies

Set Degree Before Rotation

Mar 13, 2009

I have a pointer that rotates with this code (on the MC):

Code:
onClipEvent (enterFrame) {
_rotation += 0.2;
}

This works fine but now I would like to have another pointer but with an starting angle of 60degrees. Is there an easy way to ad a starting degree or angle value on this code?

View 1 Replies

360 Degree Product Rotation

Apr 11, 2007

I have a client that wants a product to rotate around its axis for a full 360 degree view of the product. The final view needs to be draggable - so a user can use their mouse to turn it left or right. I took photos of the product in 10 degree increments and created a movie clip - but I can't figure out how to get it so a user can control the view: turning the product left or right.

View 3 Replies

ActionScript 2.0 :: How To Set Degree For Rotation

Jan 27, 2011

i want to rotate one line 0-180 how to set that target.i used this code movieclipname._rotation +=2;It is rotated 360 degree and looping.I just want to rotate 0-180 degree only once.

View 1 Replies

Creating A 360 Degree Rotation?

Jul 23, 2008

creating a 360 degree rotation like the one seen here: [URL] I need to be able to load about 24-36 images and have a slider to allow the user to rotate the images.

View 3 Replies

ActionScript 3.0 :: How To Create A 360 Degree View

Sep 1, 2009

creating 360 degree views? know nothing but Flash and Flex. Is there any tutorial available for beginners? to create thease kind of view using Flash and AS3

I need something like this:[URL]

View 9 Replies

ActionScript 3.0 :: Get 45 Degree Distance Between Two Objects

Oct 28, 2009

I'm trying to get the distance between two objects. Problem is that both objects are -45º rotated but one of them moves up and down with stage resize. So the distance gets a random degree. I've attached an image so that it could be simpler to understand my problem.

View 3 Replies

Professional :: Rotate In 3D By 360 Degree Both On X And Y Axis

Feb 8, 2011

I've got a 3D model at hand, which I have imported as a movie and an image sequence of each frame depending on which is necessary. I basically would want to rotate it by 360 degree both on the x and y axis on a canvas as well as having that done manually, such as having to drag my mouse to control which direction the model rotates in. Can I do this in Flash?

View 5 Replies

ActionScript 1/2 :: How To Make 360 Degree Movement

May 28, 2011

OK I have worked out the code and it is good:

var xDist:Number;
var yDist:Number;
var xRatio:Number;

[code]....

View 4 Replies

Actionscript 3 :: Rotate An Object 360 Degree?

Mar 5, 2010

how to rotate an object 360 degree in as3

View 2 Replies

Actionscript 3 :: Add Degree Symbol In Flash?

Feb 3, 2012

I have written degree symbol (example: 15°C) in flash but when I export the move the symbol is absconding.Is there any way to retain the symbol when the movie is rendered?

View 1 Replies

Flash :: Calculate The Angle (BAC) In Degree?

Feb 25, 2012

I have this code :

var a:Apoint = new Apoint();
a.x =0; a.y=200;
addChild(a);
var b:Bpoint = new Bpoint();
b.x =275; b.y=100;

[Code]...

View 1 Replies

ActionScript 2.0 :: 360 Degree Spin In Flash?

Jan 17, 2006

i seen this over at 24 -7 and would like to use this effect on a site of mine, [URL].. does anyone know how to do the rotation spin that this site does i have looked around but think i am looking for the wrong thing lol.

View 4 Replies

ActionScript 2.0 :: Point 100px Away At Given Degree?

Jul 2, 2007

Ok, my head isn't working so it would be faster if someone justs helps me/double checks my trig.I have a point at 300,300 or whatever, and I'm trying to find the points 100px away at any given angle... Say at angle 0 X is source, x is target 100 px away

[Code]...

View 2 Replies

ActionScript 2.0 :: LoadMovie, 90 Degree Angle Change?

Oct 25, 2010

So I've been staring at my screen all day, my client getting increasingly irate trying to work out what's going on.

I'm on Flash CS3, AS 2.0

Here's my code:

Actionscript Code:
//set stage for FBFStage.align = "TL";Stage.scaleMode = "noScale";loadMovie("image.jpg", pic, 'GET');//define dynamic aspect ratiospicHeight = new Object ();picHeight = pic._height / pic._width;picWidth =

[Code].....

My problem is my client wants to be able to change image.jpg occasionally, to ones of different size ratios. If the "pic" movieclip has a box of the right size ratio inside it I have no problem unless I change the image, which I need to be able to do. If there is nothing inside the movieclip when I load it, the image always appears on its side, and I can't seem to get it rotate to the correct position!

View 1 Replies

Professional :: 360 Degree Animation Effect In Flash

Jun 18, 2010

I have to create a 360 degree animation effect on 2d image in flash. Basicaly its a product image and has to be animated in 360 degree. Presently I am working on Flash CS4 and it has 3d tool, but i was unable to make it. Now the thing is coming in my mind that, Is this the right software to create such effect

View 6 Replies

ActionScript 3.0 :: Making 180 Degree Looping Panorama?

Aug 25, 2009

I've been looking for an actionscript's source code or file for making 180 degree looping panorama website which the screen can be moved from left to right and vice versa when moused-over on the left or right of the screen. There are 3 levels of objects; foreground, middleground, and background, set on the screen moved at differnet speed. For example, people at foreground position's supposed to move faster than those of at middleground and BG respectively. Here is the reference site [URL].

View 2 Replies

ActionScript 3.0 :: Fill A Rectangle With 45 Degree Lines?

Oct 30, 2009

I know that this could be solved a bunch of different ways, but I feel like I'm on the wrong track. [code]...

View 3 Replies

ActionScript 3.0 :: Lower Degree Of Bezier Curves?

Aug 22, 2010

I just learnt degree elevation and subdivision from some books.But I found these useless.I want to convert higher degree curves to many quadratic Bezier.

View 4 Replies

ActionScript 3.0 :: Earth 3D Globe - 360 Degree Rotation

Mar 17, 2011

I created a 3D globe in 3DS Max, put on render and would like to now be able to this object using the mouse to offend 360 degrees on one axis. Unfortunately, I do not know how to go about it.

View 0 Replies

ActionScript 3.0 :: Away3D 360 Degree Rotating Ball

Sep 17, 2011

Any source code for how to do a ball that can be spun with the mouse exactly as shown on this website: [URL]. I just need the sphere that can be rotated by the mouse in that exact way. More information can be found at this link: [URL].

View 4 Replies

Actionscript 2.0 :: Rotate Object To Certain Degree Then Stop?

Apr 24, 2009

I want to smooth rotate thing_mc a certain amount when home_btn is pressed. Not sure how to do this. Obviously the below doesn't work.

Code: Select allhome_btn.onRelease = function(){
onEnterFrame = function (){
thing_mc._rotation += 5;

[code].....

View 4 Replies

Actionscript 3.0 :: Draw Line 90 Degree Bounded?

May 8, 2009

I want to draw straight line in 90 degree boundation through actionscript, but its making me stuck to create just a single straight line.

View 3 Replies







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