Boingo_Buzzard User
 Posts: 0 | Re: My First INTERACTIVE Tron Flash Animation on Thursday, February, 16, 2006 6:31 PM
wwwmwww Wrote:
Object 2 I take it is the base of the turret. Correct? So what you want is x2 defined in terms of x1, y1, and theta and the same for y2. At least I think that is what you are after. |
I guess I should explain what I am trying to achieve. Object 2 would actally be the cannon "shot". What I am attempting to do is have the cannon shot,orbit the tank at the point where the tip of the gun turret would be (imagine the shot just hovering right in front of the turret). However I want it to orbit the center of the tank so when the tank rotates, the shot always stays right in front of the turret. That way when the "fired" event happens the cannon shot knows where it's coming from (i.e. out of the turret) and can travel in the path that the turret is pointing at.
So what I need is the cannon shot to orbit around the center of the tank in a path where the tip of the cannon would draw a circle around the tank.
Sounds like that's what your formula would do, right?
 |
wwwmwww User
 Posts: 1,230 | Re: My First INTERACTIVE Tron Flash Animation on Thursday, February, 16, 2006 6:40 PM
Boingo_Buzzard Wrote:
Sure, that would be great. I PM'ed you my e-mail address.
|
It's sent.
Carl
 |
wwwmwww User
 Posts: 1,230 | Re: My First INTERACTIVE Tron Flash Animation on Thursday, February, 16, 2006 7:22 PM
Boingo_Buzzard Wrote:[quoteSounds like that's what your formula would do, right?
|
Depends... here is a top view of a tank.
If in your system (x0,y0) is the same point as (x1,y1) and your turret was always pointing forward relative to the tank what I've given you so far would work.
Carl
 |
wwwmwww User
 Posts: 1,230 | Re: My First INTERACTIVE Tron Flash Animation on Thursday, February, 16, 2006 7:36 PM
Here is a more general solution...
r0 = sqrt((x1-x0)^2+(y1-y0)^2)
t0 = atan((y1-y0)/(x1-x0))
theta = pivot angle of tank body relative to x-direction
x1 = x0 + r0*cos(-theta+t0)
y1 = y0 + r0*sin(-theta+t0)
r1 = sqrt((x2-x1)^2+(y2-y1)^2)
t1 = atan((y2-y1)/(x2-x1))
gamma = pivot angle of turret relative to x-direction (not tank body)
Adding theta to gamma I think will give you angle relative to tank body.
x2 = x1 + r1*cos(-gamma+t1)
y2 = y1 + r1*sin(-gamma+t1)
So in other words if you want x2 and y2 defined in terms of x0 and y0 you'd have:
x2 = x0 + r0*cos(-theta+t0) + r1*cos(-gamma+t1)
y2 = y0 + r0*sin(-theta+t0) + r1*sin(-gamma+t1)
Just keep in mind that the barrel doesn't run though the turret's pivot point or you'll be firing in the r-direction as seen in the above figure instead of the x-direction.
Does that help?
Carl
 |
Boingo_Buzzard User
 Posts: 0 | Re: My First INTERACTIVE Tron Flash Animation on Thursday, February, 23, 2006 6:05 PM
OK all,
I have the latest demo available for you to take a look at. This time the tank fires (Space Bar) and you can hunt down and destroy a recognizer. The reco will not harm you... he's just there to take potshots at.
Let me know of any bugs you find. I didn't ever come up with a solution about the rotation thing, so the tank still rotates oddly  Sorry the graphic for the "explosion" is so lame. I hope to learn how to incorportate flash movies as an action at some point and have a need animation of a reco breaking up when you hit it.
Hey Grid89a or Kamui, if you're reading this... is there some kind of timeout function in Actionscript? I for the life of me could not find one. I had to write my own, but it's LAME. I tried setInterval, but that just does the same thing over and over again at whatever interval you specify.
Here's the link:
http://www.deviantart.com/deviation/29488026/
Remember to click in the animation before you try and move the tank.
Next update will have sound!
abortion pills online abortion questions cytotec abortion  |
Tori User
 Posts: 0 | Re: My First INTERACTIVE Tron Flash Animation on Thursday, February, 23, 2006 6:43 PM
That's pretty neat! I like the firing of the tank.
I wish I could get myself to do something like that...but most likely I'll be lazy and won't bother.
==
 |
TheReelTodd Sector Admin
 Posts: 0 | Re: My First INTERACTIVE Tron Flash Animation on Thursday, February, 23, 2006 7:21 PM
He he - cool!
It works fine for me. Kind of fun. You even have a blast frame in there for when you nail the reco - nice touch.
Looking forward to more!  order abortion pill morning after pill price where to buy abortion pill
        
|
TronFAQ Sector Admin
 Posts: 4,467 | Re: My First INTERACTIVE Tron Flash Animation on Thursday, February, 23, 2006 9:34 PM
LDSO • Facebook • Twitter • YouTube • DeviantArt
 |
gRiD_89a User
 Posts: 0 | Re: My First INTERACTIVE Tron Flash Animation on Thursday, February, 23, 2006 10:41 PM
i think i will create a flash based vector tank for you  royalty free  order abortion pill http://unclejohnsprojects.com/template/default.aspx?morning-after-pill-price where to buy abortion pill
|
gRiD_89a User
 Posts: 0 | Re: My First INTERACTIVE Tron Flash Animation on Thursday, February, 23, 2006 11:32 PM
hmmm let me think about that timing function...
ok thought about it... i think what you are looking for is event listeners and I have a great link for a few tutorials
[All Tutorials] http://actionscript.org/tutorials.shtml
[Event Base Triggers] http://actionscript.org/tutorials/intermediate/Flash_Broadcasters_and_Listeners/index.shtml
Isometric Game Developmen (flash)
http://www.tonypa.pri.ee/tbw/start.html
oh have you thought of using thse mouse to control the turret? just a thought cause you can calcualte the mouse angle for a hit miss scenario
[edit]I just got the source code for asteroids in flash, its a 100% accurate recreation of the old time fav. Im thinking this could be easily adapted for your tank. *think think*
started vecotorising a tank from a top shop mde my wwwwMMMwwwww 
|
gRiD_89a User
 Posts: 0 | Re: My First INTERACTIVE Tron Flash Animation on Friday, March, 03, 2006 1:01 AM
2d frame done in flash!!! thanks go out to traahn and wwwmmmwww for the shots!!!
now coloring and coding  where to buy abortion pill ordering abortion pills to be shipped to house buy abortion pill online
|
Traahn User
 Posts: 3,305 | Re: My First INTERACTIVE Tron Flash Animation on Friday, March, 03, 2006 2:25 AM
2d frame done in flash!!! thanks go out to traahn and wwwmmmwww for the shots!!! |
LOL, I think I'm missing something. What did I do?? I do appreciate the credit, but are you sure I helped out with something?  Unless you're referring to the shot-outs (shout-outs) to you?  abortion pills online abortion questions cytotec abortion
              
I'm getting out of here right now, and you guys are invited.  -----^ |
gRiD_89a User
 Posts: 0 | Re: My First INTERACTIVE Tron Flash Animation on Friday, March, 03, 2006 6:26 PM
i belive it was one of your screenshots that initially got me started! and then wwwmmmwww got me some more!!  abortion pills online http://www.kvicksundscupen.se/template/default.aspx?abortion-questions cytotec abortion
|
|