Quantcast
Channel: Michael James Williams » Maths
Viewing all articles
Browse latest Browse all 2

Understanding Flash’s Coordinate Systems

$
0
0

screenshot

Have you ever written code like this:

?View Code ACTIONSCRIPT3
newBullet.x = hero.gun.x;
newBullet.y = hero.gun.y;

…and found that the bullet appears in a seemingly random place compared to the hero’s gun?

Or have you ever traced tank.turret.rotation and found that it always returns zero, even when it’s clearly pointing diagonally?

Maybe you’ve compared the width of two identical objects, one obviously double the size of the other, and found that Flash thinks they are the same.

Every Flash dev I know has run across one of these and sat scratching their head — myself included!

So what’s going on?

Well, it’s all to do with addChild()

(...)
Read the rest of Understanding Flash’s Coordinate Systems


© MichaelJW for Michael James Williams, 2009. | Permalink | 30 comments | Add to del.icio.us
Post tags: , , , , ,

Feed enhanced by Better Feed from Ozh


Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images