
Angles what direction is 0 degrees?
Hi all,
I just wondered, when dealing with angles (im reading about maths alot now) i was just wondering, in flash when you attach a fresh object to the screen, what direction is its initial _rotation?
I dont have a copy of flash here.
Thanks.

Iron Chef InTraining
Huh. Good question. I thought it started at 0, but now I'm not so sure.

Well nah, i mean like, in this maths book it uses a different axis system and says 0 degrees is true east. 45 degrees is southeast etc.
So do you know what i mean?

ism
i believe when an mc is at 0 degrees it is facing to the right like so;
>
Graphics Attract, Motion Engages, Gameplay Addicts
XP Pro  P4 2.8Ghz  2Gb  80Gb,40Gb  128Mb DDR ATI Radeon 9800 Pro

thanks :P can i ask you another question? This ones much more difficult to answer....
I am reading a game book for flash games, i dont really want to make flash games as i think they are a waste of time (each to their own) but i am none the less itnerested in understanding several of the concepts involved.
I was doing fine until this afternoon i reached CircleCircle frame independant detection.
Quite frankly it disgusts me. I go from slightly following the text, to just not having a clue what hes talking about in about 3 lines of text.
If its ok to type a portion of the text then this is what i dont get:
Solving for the time is very difficult. We must insert the equations for x1, y1, x2, and y2. We then square both sides of the equation (to get rid of the square root sign). What we are left with is a quadratic equation. Quadratic equations have two solutions, which means that when we solve for the time, we will get two answers. Conceptually we can see why in this case we will get two separate times. Imagine two circles moving toward each other. At one time they will be touching on an edge. As time goes on, they will move through each other, but just as they are about to separate, they will be touching exactly at one point again. The two times found by solving the quadratic equation give the two times that a collision can occur. When we have our two answers, we look at the lower of the two times and discard the other one.
By defining these constants,
R = radius1+radius2
a = 2*xmov1*xmov2+xmov12+xmov22
b = 2*xl1*xmov22*xl2*xmov1+2*xl1*xmov1+2*xl2*xmov2
c = 2*xl1*xl2+xl12+xl22
d = 2*ymov1*ymov2+ymov12+ymov22
e = 2*yl1*ymov22*yl2*ymov1+2*yl1*ymov1+2*yl2*ymov2
f = 2*yl1*yl2+yl12+yl22
g = a+d
h = b+e
k = c+fR2
we can write the vastly simplified quadratic equation as
g*t2+h*t+k = 0
Where does he pull all this stuff from? I mean he just neglects to explain why c = 2..... I cant even understand where he gets c from in the first place, never mind why it starts 2.
Quadratic Equation??
Anyone have any idea where i need to begin to understand that term?
Thanks
Last edited by The Scotsman; 11172005 at 06:03 PM.

ism
i gotta admit i know nothing about this. i know ericlin has done some work on it though;
http://ericlin2.tripod.com/collision/bb5.html
Graphics Attract, Motion Engages, Gameplay Addicts
XP Pro  P4 2.8Ghz  2Gb  80Gb,40Gb  128Mb DDR ATI Radeon 9800 Pro

Thanks blink
Also by the way, before i noticed your post i found this, and i was just about to say it dont matter.
For anyone else in the world that finds this post.
http://www.bit101.com/forum/viewtop...ratic&start=15
The dude on that boards site: (what is a quadratic....)
http://stoldark.spidatek.com/features/030115.html
Thanks

Senior Member
Hey there
I've had this problem of finding circlecircle collisions independent to the frame rate, and I myself found the solution, so here are some tips
First, forget quadratic equations and all that nonsense  Its just a lot of algebra
Use trig. and vector math instead  it's alot simpler (if you know trig. that is)
There's a good article in gamasutra about that exact same topic:
http://www.gamasutra.com/features/20...nhuevel_01.htm
it helped me, so if u have any questions, i'll gladly answer them

you can dynamically find out. in an object
onClipEvent(enterFrame){
_rotation += 5;
trace(_rotation);
}
0 degrees is not to the right, it's strait up. Also, flash doesn't use the whole 360° system. instead it does: on the right side of an object is 180°, and on the left side of an object is 180°.
Also I would like a brief summery about gamasutra, I've encountered a few links to it already and am wondering weather or not it would be worth it to create an account for it. Anybody?

Baconwrapped closures
Sorry swak, but even if flash has a strange coordinate system, 0 degrees is always east. If you don't believe me, try putting 0 into the Math.tan function (converts from angle to slope). The only strange thing about Flash's coordinate system, and this is true of nearly all comuter applications, is that the Y axis is flipped, with (0,0) being in the upperleft corner and x and y increasing as you go down and to the right.
[edit] If you want to further test the tangent function, know that it takes radians so to convert your degrees you must multiply them by pi and divide by 180.[/edit]

I made a few more tests and just as I suspect and found out earlier 0 degrees is strait up. Take a look at the pictures I've included. I have a game that I've been working on where I have one object (the square with a black circle at top for showing front) following the other (the triangle). The triangle is controlled by the player. If you want I can send over the .fla to show you and you can make your own tests on it. The numbers on the output screen are showing the direction (in degrees) that the square is facing. It's not raidients, the second picture shows that because it's facing to the right and it's about at 90°.
Last edited by swak; 10082007 at 07:42 AM.
.

Baconwrapped closures
you can dynamically find out. in an object
onClipEvent(enterFrame){
_rotation += 5;
trace(_rotation);
}
Say your object is an arrow. If it's facing up in authoring, zero degrees will always have it facing up. If it's facing to the right in authoring, zero is to the right.
I bet you've got your arrow facing up in authoring and, intentionally or otherwise, you slipped a constant of 90 degrees or pi/2 radians into your code so that it would look right after passing through the arc tangent function because it assumes 0 is to the right.
If that's not the case then yes, I'd be interested in seeing the FLA or code. Please send it v7 compatible.

Here's the fla. This is a game that I've been making. I reached the combat style and stopped because I've had other things to do. During this break I might work on it some more but I've got another game that I would like to try and make. If you would like to join in I would be happy to try and work on it with you or anybody for that matter. A lot of this code I got from elsewhere.
Last edited by swak; 10082007 at 07:42 AM.
.

Baconwrapped closures
Can't open it... try saving it as Flash 7 regular (not pro) or just post the code.
[edit] Sorry, I didn't even read your post  maybe just putting up the code isn't such a good option unless the angle part is independent from everything else. [/edit]
Last edited by Nialsh; 12082005 at 02:03 AM.

One big thing about flash 8 that I've found is when you're opening flash, the flash loader stays on top of everything. So basically if you're doing something and you open flash 8, then you have to work around the loader while it loads. Or is this just me?
Last edited by swak; 10082007 at 07:42 AM.
.

I'm using 8 not 7 pro. There doesn't seem to be a flash regular/pro. Probably doesn't make a difference in that area. Why are you using regular? The only difference between the two, I believe, is the amount of tools to work with.

Baconwrapped closures
I think there's more fundamental differences between v7 pro and regular but I'm using regular because it's cheaper
There should be an option to save it a version lower. Try going to File > Save As and then there should be a dropdown menu called "save as type"

I'm using 8. The "FlatLand copy.fla" is republish in 7, try it. For the first one I made the mistake of publishing in 8. That's why you couldn't look at it.

What I like about gamasutra is that their code examples work when implemented almost 100 percent of the time. The article on "Pool Hall Physics" will give you what you need. Like most of their material it is well presented for both those with and without a math background.
What you are looking for is a circle circle collision detection method know as a "sweep" test.
shipstern

To be honest, I think in flash, 0 degrees can be whichever direction you want. North, east, southeast, the direction at which you have to turn your head to see your monitor, basicly whichever direction you draw the object.
Posting Permissions
 You may not post new threads
 You may not post replies
 You may not post attachments
 You may not edit your posts

Forum Rules

Click Here to Expand Forum to Full Width
