Friday, April 18, 2008

Wistfuly, it's Friday

I finally got a meddlesome piece of ActionScript to work correctly. The bullet in the cannon test now begins its flight from the end of the cannon, as opposed to the cannon's center of rotation. When the bullet started in the center of the cannon I had to set a minimum charge of 15 or the bullet would fall out of the cannon or the barrel in an unrealistic manner. The bullet also had some lame trajectories if the cannon were angled toward 90 degrees. Now, the bullet starts from the end of the barrel and low charges are fine. I used the mystical arts of trigonometry to calculate the dx and dy offsets that change as the cannon (constant length of r) rotates (angle a). In any event, I had been trying to get this to work in ActionScript and it was just not happening for me. Until now. . . And then I ate two donuts.


Scott Raedeke said...

Nice work on the debug, Miles! Good solution... My math skills are so limited, it really puts me at a disadvantage in programming. Your Yale roots are showing.

I've been at a conference in Bend all week. Let's gather soon... the ActionScript/Latin natives are restless!

Julie Inada said...

Where'd you get the donuts?