ActionScript 3.0 :: Physics Projection Algorithm - Determine Both The Correct X And Y Veleocity To Shoot The Balls Out

Jun 7, 2010

I have a machine that shoots canon balls into three different barrels, each on a different x axis, I need to be able to shoot at an arc into the target barrel, the target barrel will be randomly determined right before the ball is fired, the barrels will be randomly placed from stage to stage

the friction and gravity applied are constant variables, how can i determine both the correct x and y veleocity to shoot the balls out so that they end up in the correct barrel. I don't want to hard code any variables

View 2 Replies


Similar Posts:


ActionScript 2.0 :: Build A Model With Physics Incorporated Without Physics Engine?

Feb 3, 2010

I wanted to study some physics code lines related to flash actionscript 2.0.Is there anyway to build a model with physics incorporated without a physics engine? By bare actionscript?If yes, can anyone show me a tutorial or an explanation to learn somehting about it, please?

View 0 Replies

ActionScript 3.0 :: Is Basic Physics Possible Without Physics Engine

Aug 29, 2011

I know you can add a var to add grvity and velocity ect. But what are the limits of this?Can i have a ball roll downhill using physics from within flash, without a external physics engine like box 2D.Can i have impulses? Well thats not important just wondering really.What can you do with physics in flash?

View 5 Replies

ActionScript 2.0 :: MX - Pulling Down A Projection Screen?

Jan 29, 2010

I want to build a sort of pulled down projection screen thing using ActionScript.Basically the MC will come down with a picture on it.I have this starting code which doesn't work terribly well because it just moves the screen from top to bottom instantly.

Code:
on (release) {
do {_root.mcScreen._y+=1;
} while (_root.mcScreen._y<200);
}

Essentially I want the screen to smoothly scroll down into place over about half a second.

View 6 Replies

ActionScript 3.0 :: Calculate 3D Plane From 2D Projection

Jan 16, 2012

I'm basically trying to emulate Photoshop's Vanishing Point tool where you can define the 4 2D points and the 3D plane is calculated from that information, in terms of the rotation of the plane relative to x y and z axes.

So if you have an image like this one:
And you define the points of the four corners, maybe like this:

It would define the 3D plane that the surface must live on relative to the x y and z axes. Researching this has led me to some tutorials on drawTriangles and Homographies, but they all seem to be focused on mapping bitmap data and I can't seem to find anything that defines a 3D plane itself.

View 5 Replies

C# :: Build Interactive Floor With Projection?

Jan 15, 2011

is there any lib or api out to deal with this ? EVEN, if there is any resource , article from another language c++ , c , .. i just didn't have enough time to test lot of ways

If you search interactive floors , or interactive floor projection you can find some companies who provide such a thing

View 2 Replies

ActionScript 2.0 :: Scaling And Projection On Stage?

Mar 18, 2010

i have a following problem with displaying a scaled and moved image. cliffs:

1. create movieclip

2. draw a square inside, with a starting point (top left corner) in (75000, 75000)

3. move the movie clip so that the square is visible on stage. its important that the movieclip for each iteration is the same.we reapeat this procedure, each time doubling the x/y of starting point, and its width and height. each time we also scale down the movie clip (so its two times smaller than the previos one). we position the movie clip.basic math suggest that all squares should appear one over another. this is what i get:zoomed:

Code:
container square2 x/y: (-47900,-47900)| zoom: 2| w/h: 500| 64%| x/y: (75000,75000)| stage x/y: (99.95,99.95)| stage w/h: 320
container square3 x/y: (-47900,-47900)| zoom: 3| w/h: 1000| 32%| x/y: (150000,150000)| stage x/y: (98.8,98.8)| stage w/h: 320[code]....

View 1 Replies

ActionScript 3.0 :: Get The Depths Of All The Blocks To Be At The Correct Levels At The Correct Times

Dec 30, 2009

I'm trying to get the depths of all the blocks to be at the correct levels at the correct times so that the 3d effect is maintained. I've tried many things, but have had little success. All the instances of the blocks are stored in an array, but since it's adding them in accordance with when they're added to the stage, it doesn't help me locate them to swap depths. Is there a way to arrange them by location on the board?

View 4 Replies

Flash :: Get Visible Size Of DisplayObject With Perspective Projection

May 2, 2010

The following is entirely a math question. As we know, PerspectiveProjection delivers perspective transformations in 3D represented by the interdependent values of fieldOfView and focalLength according to the following formula:

focalLength = stageWidth/2 * (cos(fieldOfView/2) / sin(fieldOfView/2)

Q: How to get the visible on-screen size of the DisplayObject (Cube on the above-linked image) to which PerspectiveProjection has been applied? A more thorough description and illustrative code on the issue in ActionScript 3 lacks functionality for visible bounds of DisplayObject.

View 1 Replies

ActionScript 2.0 :: Opening Popup Page In Standalone Projection

Apr 28, 2005

I am creating a standalone projector (CD with autorun). This means my swf files are NOT contained within html. I would like to, when clicking on button, open a popup html page with specific dimensions. I was wondering if it is possible to do that, and what AS to use,
or if I have the obligation, to openpopups, to launch my swf files within html mother page.

Here is the code of button that works (but does not open popup):
on (press) {
getURL("URL", "_blank");
}

Here is the code for popup but does not work (opens html page normally):
on (press) {
getURL("URL", "", "width=580,height=400,left=100,top=100");
}

View 2 Replies

Actionscript 3 :: Calculate An Objects Scale Using A Perspective Projection Matrix?

May 31, 2011

Im currently building a little 3D particle engine in flash the uses sprites.to set the position of each sprite I am using the projectVector function below. (the viewTransform matrix is the particles world matrix concatenated with a perspective projection matrix)

var projectedPoint:Vector3D = Utils3D.projectVector(viewTransform, point);
sprite.x = projectedPoint.x;
sprite.y = projectedPoint.y;

[code].....

View 1 Replies

Actionscript :: Define Projection Matrix In Stage3d Without Using PerspectiveFieldOfViewLH Method

Jan 24, 2012

url...The interesting part is that he didn't use perspectiveFieldOfViewLH and instead he defined his own projection matrix. I'm new to the 3d programming, so after reading this explenation of projection matrix:[code]And i got the black screen. All i did was exchanging the matrix from the tutorial with this matrix. I tried to play with it for some time, but with no results. This is the matrix from the tutorial[code]

View 2 Replies

ActionScript 1/2 :: Bullets Only Shoot 1 Way?

Mar 4, 2012

this is in my bullet movie clip on the timeline.[code]It all works but when i turn around it still shoots the same way im sure its something simple but i just cant work it out.

View 7 Replies

ActionScript 2.0 :: OOP: Balls That Bounce Off Each Other?

Dec 18, 2006

I have a simple ball class where it bounces and such and stays on the stage based on boundaries. right now im using a for loop to attachMovie("ball",...) in my main fla file
which is basiclaly my movieclip that has the AS 2.0 class pointed to it. It bounces fine using the tutorial on Kirupa(by senocular?) i want these balls to bounce off each other too?

View 1 Replies

ActionScript 3.0 :: Shoot An Moving Object Exactly In The Center?

Dec 5, 2011

I have a TargetCirlce_mc which moves on "y" axis from top to bottom. And I have an arrow_mc which is on x:100 & y:200. How can I shoot an arrow exactly on the registration point of the TargetCircle_mc (automatically) while it is exactly opposite to the arrow_mc?

View 1 Replies

Flash :: Event Flow In AS3 - Shoot A Bullet?

Aug 11, 2011

My goal is to shoot a bullet everytime I click on ship. What happens, in fact, is that If I click on it once, the bullet is shot, but if I click on it twice before the first bullet is off the screen, the first bullet literally stops(it does not disappear, only stops) and the second bullet is shot.

public var ship:Ship = new Ship();
public var bullet:Bullet = new Bullet();
stage.addChild(ship);[code]...

View 2 Replies

ActionScript 3.0 :: Character Movement And Shoot Not Working?

Nov 8, 2009

I'm doing a simple game where you move the character using the arrow keys and shoot using the Mouse. The character rotates based on the Mouse angle. I have two problems: when I move the character, he moves once, then stops then moves again as normal. My other problem is that when I click over a MovieClip, the bullet goes to the wrong angle.My moving function:

Code:
stage.addEventListener(KeyboardEvent.KEY_DOWN, keyHandler);
function keyHandler(event:KeyboardEvent):void {

[code]....

View 2 Replies

ActionScript 2.0 :: Make A MC Like Shoot A Gun / Something When You Press Spacebar?

Aug 13, 2004

How do you make a MC like shoot a gun or something when you press the spacebar?

View 1 Replies

Refer To Balls That Are Created By DuplicateMovieClip?

Dec 12, 2008

I have balls (...sounded pervert) that are created by duplicateMovieClip, yes, they spawn, but right on top of each other, and I don't seem to be able to do anything to them, I tried ball+i.onEnterFrame = function(){} typed in several different ways ("ball"+i, ["ball"+i] etcetc...) And I just couldn't find How to refer to them. i'm trying to spawn them to random positions and make them move in random directions (got the moving part already coded but like I said I can't name them -> can't use it atm.)

Short version: How to refer to balls that are created by duplicateMovieClip?

View 2 Replies

ActionScript 3.0 :: Predictive Collision Between Balls

Feb 9, 2012

I want to detect perfect collision between two balls. i mean. when balls move in ENTER_FRAME. their (x,y) are updated with such a large value that it sometimes miss the complete collision. and also how to find the collision point.

View 2 Replies

ActionScript 3.0 :: Making Two Balls That Bounce Into Each Other

Feb 13, 2009

I'm trying to make two balls that bounce into eachother and walls for a school assignment. My problem is I don't really know the maths to make this work myself so I've tried to get help from others who don't know AS but who do know the maths, but I couldn't get that to work. Then I found a site that had exactly what I was looking for, but it was in AS2. I've tried to translate it to AS3 but it doesn't work properly either. The balls either get connected to eachother and stay that way or go out of the stage. This example is here:[URL] Attached my files. Probably lots of redundant code in my code from previous attempts at solving it, but I don't think it affects anything as it is now.

View 2 Replies

ActionScript 2.0 :: Bouncing Balls Off Each Other Around Screen

Jun 15, 2004

I've got this ball that bounces around the screen. There are a bunch more that are made with the duplicate movie clip command. I want them to bounce off eachother, as well as the walls. The problem is, I cant just put the code on the original ball because then balls want to bounce off themselves which creates problems. So my question is, is there some kind of loop I can use to make it so each duplicate ball will bounce off the others but not itself?

View 5 Replies

ActionScript 2.0 :: Balls Bouncing Off Each Other, Resting On Each Other?

Jan 1, 2007

I've been trying to recreate the yugop examplewhere the balls seem to bounce off each otherbut the difference is, they can also rest on top of each other.click to add more balls.

Code:
main.fla
var ballcount:Number=1;

[code]....

View 3 Replies

ActionScript 1/2 :: Get To A Certain Distance Of The Enemy It Should Trace (shoot) - Won't Work

Aug 5, 2011

what i whant is when any of the units get to a certain distance of the enemy it should trace(shoot).

[CODE]...

View 6 Replies

ActionScript 2.0 :: [mx] Create Shoot Lasers From The Nose Of The Plane?

Feb 8, 2003

I'm working on a new project, its a side scrolling game where an airplane (user) has to shoot down a bunch of other enemy planes. how to create an AS to shoot lasers from the nose of the plane

View 6 Replies

ActionScript 2.0 :: Making A Movie Clip Shoot A Bullet From It?

Dec 25, 2006

How would you go about making a movie clip shoot a bullet from it, but have the movieclip able to move around, like a sidescroller game...

View 2 Replies

ActionScript 3.0 :: Shoot An Object And Create An Arc Based On An Angle

Sep 21, 2009

I found a basic example of how to create something that'll shoot an object and create an arc based on an angle. I added a power Bar to it, but I noticed something bad about it.

The way it works the higher the speed is the further it goes and the faster it moves across the screen. This doesn't give me enough control. Because essentially I want fast moving projectiles but I want to also be able to shoot both near and far.

With this current system that's an impossibility.. Can anyone shed some light on how I can do this better? Here's the current way it's being done (important parts):

Code:
bullet = new Bullet;
this.stage.addChild(bullet);
bullet.speed = 1 + powerBar.scaleX * 20;

[Code].....

View 2 Replies

ActionScript 3.0 :: Mouseclick Event - Shoot The Zombies, None Of Them Are Clickable?

Oct 11, 2010

When I run the file and try to shoot the zombies, none of them are clickable. I really can't tell what I have done wrong here. Here is my code:

stage.addEventListener(Event.ENTER_FRAME, moveBullseye);
function moveBullseye(event:Event) {
bullseye_mc.x=mouseX;[code].....

View 2 Replies

ActionScript 3.0 :: Undefined Addchild - Make A (missile) Upon Shoot?

Nov 23, 2011

THIS THREAD IS SOLVED.. Answer lies upon a website tutorial. Final Page on this Thread.So far so good, i've gotten most my as2 to as3.. And coming out good Buttons are working, The only last part im working on is upon shooting, it'll bring in the calls to Fire the missle.. (tracein the button works great).

[Code]...

This is what im trying.. But it says undefined use for addchild.. so im taking im missing somthing..

(the missile is a animation graphic i created).I have made a Missile.as to control what the missle does when its addchild is placed on stage. Problem is, (addchild isnt doing it) and im not sure if its going to shoot out the nose of the hero..

View 14 Replies

ActionScript 2.0 :: Make A Bullet Hole Appear When Shoot An Object

Sep 28, 2002

i've posted many times and got loads of responses but i dont understand how to make a bullet hole appear when you shoot an object. MSN me a [URL] to have a chat about doin the actionscript.

View 1 Replies







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