ActionScript 3.0 :: Circle Circle Frame Independant Collision Reaction?
Apr 10, 2010
Trying to do circle circle collisions via math which I'm really having trouble with. One circle (player) just moves from keyboard. The ball reacts to the player. All the code shown is in my players class and I passed in a reference to the ball.
On my enterframe I have:
Code:
var xmov1 = xSpeed;
var ymov1 = ySpeed;
var xmov2 = ballRef.xSpeed;
var ymov2 = ballRef.ySpeed;
[code]....
Perhaps I'll go with a box2d equivalent instead of trying out my own physics shenanigans.
View 2 Replies
Similar Posts:
Jul 5, 2010
Does anyone know of any tutorial or code example that deals with resolving circle-circle collisions including rotation?
View 2 Replies
Mar 22, 2009
most efficient way to test for a collision between a circle and a rectangle?
View 3 Replies
Nov 14, 2009
I have a whole heap of circles which are user created and they all bounce off one another. Generally it works fine but occasionally two balls join together and sort of .. orbit each other.
my collision code is this: (it's within two loops going through an array of movie clips, where mc1 is the current movie clip in the first loop and mc2 is the current movie clip within the second loop)
ActionScript Code:
dx = mc1._x-mc2._x
dy = mc1._y-mc2._y
[Code].....
View 1 Replies
Mar 8, 2005
I'm developing a game atm, and I need some help on the mathematics/coding of colliding circles (and their change in x/y speed). What i need to know is how to calculate the direction and speed a circle has after colliding with a static (non-moving) circle. I know how to detect a collision between the two, but I'm not sure about the maths I need to give the circle the right speed and direction after the collision
If i do know how far away the two circle-points (in the middle of each) are to each other (in both x and y coords) would it be easy for me to find the new speed and direction of the large circle in the example above? I know that I somehow should use the angles to pretend the circle hits a flat "wall" (as it only hits one point), and then calculate the new speed/direction. My only problem is that I'm not sure how to decide the angle of this flat "wall" and how x and y speeds should change when colliding with a wall that is angled. Does anyone here have any insight, links or tips on how I can du this?
View 6 Replies
Sep 30, 2005
i want to make one circle follow the mouse cursor, inside another circle. Similar to an eye looking at the cursor. Ive attached an example.
View 4 Replies
Nov 5, 2008
I have text in a dynamic field showing up as circle. I want to say if circle shows up change it to cercle (french).
[Code]...
View 1 Replies
Mar 8, 2005
What i need to know is how to calculate the direction and speed a circle has after colliding with a static (non-moving) circle. I know how to detect a collision between the two, but I'm not sure about the maths I need to give the circle the right speed and direction after the collision.If i do know how far away the two circle-points (in the middle of each) are to each other (in both x and y coords) would it be easy for me to find the new speed and direction of the large circle in the example above? I know that I somehow should use the angles to pretend the circle hits a flat "wall" (as it only hits one point), and then calculate the new speed/direction. My only problem is that I'm not sure how to decide the angle of this flat "wall" and how x and y speeds should change when colliding with a wall that is angled.
View 6 Replies
Aug 24, 2009
I`m working on a app that you can draw lines.....like circles, rectangles... my problem is when a user draw a circle for example....i wanna be able to paint (change color) inside of this circle. I`ve tried working on Shapes with cacheAsBitmap = true and Bitmaps with BitmapData but it doesn`t seens to work.
View 4 Replies
Mar 16, 2012
I want to create circle, and put 8 points on it. So, user can drag each point in order to change it's shape.
Is there any way to do this in flash?
I have some following code:
Ref. - How to draw a continuous curved line from 3 given points at a time
package{import flash.display.Sprite;
import flash.events.MouseEvent;
import flash.geom.Point;
[Code].....
So, can anyone convert these three point curve line to 8 points circle?
View 1 Replies
Oct 6, 2009
I have to draw a circle using action script. The Circle Diameter has to be controlled by a button.
View 0 Replies
Sep 19, 2004
Here I what i need is : Start drawing first circle and when first circle is on half way, Start second circle.same way second and third circles. and after completing 3 circles, just gotoAndPlay 2nd Frame .
View 3 Replies
Feb 24, 2012
I'm trying to implement a aabb to circle collision.
[Code]...
Somehow the collision does work as expected. Either they never move at all and "collided" was traced, or they'll continue moving and never collide when I tried swapping values around. Is there something i'm missing in my logic??? My box-box and circle-circle collision are working fine.
View 2 Replies
Feb 18, 2010
I have a simple three ring animation where the three rings fade in and out.On the stage the rings are a perfect circle, in the publish preview they look fine, but once I publish the SWF, all of the sudden the rings are not perfectly round anymore.
They are almost perfect but right at the top and bottom there is just a small portion which has sort of "flattened out"...
View 2 Replies
Apr 26, 2011
I bought a Flash video tutorial online for Animating and the FIRST step is to create a circle with the circle tool, and the guy does it online, and it fills itself in. I repeat his actions exactly and I cannot get the same result at all. I just get a circle.
View 5 Replies
Apr 5, 2007
I have two MC's, circular in shape. One of the circles is stationary and you can drag the other. I'm trying to get the moveable circle to be able to move around the circumference of the stationary circle, but not overlap. I'm able to detect when they overlap, not using hittest. I just can't figure out how to code it so that the draggable circle can't be moved over the stationary circle.
View 4 Replies
Jan 6, 2012
I have been trying to get this right for hours now it cant be as hard as I am finding it! but basically I have a circle and in that circle is a circle and all I want is for the inner circle to not be able to leave its parent. that's it but I just cant get it to work.
View 1 Replies
Jul 3, 2009
I'd like to make a circle slide ( Slider that on the shape of circle instead of vertical and horizontal Slider) like this one:
[URL]
Is there a ready Component on the web.
View 0 Replies
Nov 9, 2007
could anybody point me in the direction on how to create a circle on enterframe....basically, a circular loading bar. As the percent loaded goes up, more of the circle is created.
View 3 Replies
Sep 13, 2005
I am trying to make a circle preloader, so I need to convert it to be frame based.
Check it out: [URL]
Zip with Fla: [URL]
Code:
function loadExtMov(movieName, targetMovie, transEnabled:Boolean) {
var mcListener:Object = new Object();
mcListener.onLoadProgress = function(target_mc:MovieClip, bytesLoaded:Number, bytesTotal:Number) {
status_txt.text = Math.round((bytesLoaded/bytesTotal)*100);
// Radius Preloader
[Code] .....
View 1 Replies
Jul 28, 2009
I need to allow the user to create a circle with a specific radius and colour in a certain frame (lets say frame 2), and then add that circle as a symbol to a different frame (say frame 1). First off, im simply creating a circle.. This is what ive got in frame 2 so far:
(in Frame 2 of the timeline)
Code:
stop();
import flash.display.DisplayObject;
import flash.display.Graphics;
import flash.display.Shape;
[code]....
Ive got this much working, but I dont understand how to convert the output of this function to a symbol usable in another frame..
View 3 Replies
Jun 22, 2009
I have been given the task to create something similar to the flash navigation on the link below. I have tried googling things such as "flash image rotation", "flash rotation circle", etc?[URL]
View 1 Replies
Jul 2, 2009
I am trying create a rotating circle with buttons/menus around the edges and this would simply rotate around, not like a 3D carousel, just basic rotation of a circle triggered by movement of the mouse on a vertical axis!I have attached a jpg example to give you an idea of what I am trying to create.Would anyone be able to direct me to some tutorial something similar as I can't seem to find anything.
View 1 Replies
Dec 12, 2009
Is there a way I can arrange instances in a circle by their registration points?
View 6 Replies
Jul 27, 2010
How to draw a circle using action script (as a component) i tried some xample did not work.
View 2 Replies
Jan 7, 2010
I am making a simple drawing application, and i have come across a problem. Im not very good with trig at all so i got the code for drawing a circle and customised it and it goes a little dodgy. Could someone tell me why it is happening, and how i should fix it?
View 3 Replies
Apr 30, 2010
I need to get a random xy value from a circle, for example going to spread circles on stage randomly. Its quiet easy to spread the circle in a square. Here that was done.
var MC:MovieClip=new MovieClip();
var squareWidth:Number=200;
var squareHeight:Number=200;
[code].....
View 3 Replies
Dec 26, 2011
How do you get all the points that are on a circle?
I've already tried a for loop using the equation x^2 + y^2 = r^2 but so far it doesn't seem to be working...
I'd like to find out how because I want to place MCs dynamically on a random point that is outside a certain mc.
View 2 Replies
Mar 21, 2012
I have this animation to do that when you press a button a circle must be created with a twinning effect.
This is the sequence of the animation [url]...
View 1 Replies
May 20, 2008
I'm building a touchscreen project that consists of flash and max/msp using Olaf Matthes flashserver as bi-directional control.
how I create a function in flash that will provide me with the distance of a concentric circle, so that as it grows I can use trace() to give me a constant stream of it's x & y coordinates?
I've also implemented a collision detection between two or more circles for the purpose of an overlap function. Trouble being that it's not quite working properly. I want the overlap function for the purpose of morphing sounds between the intersecting parts of the circles.
Here's the code I'm using:
[Code]....
View 2 Replies