Gamedesign in Flash
Gamedesign in Flash
Out of context: Reply #6
- Started
- Last post
- 10 Responses
- Seph0
oldx = getProperty (_root.house.char, _x);
oldy = getProperty
(_root.house.char, _y);finalX = ((Math.sqrt(3)/2)*(oldx+oldy));
finalY = ((oldy-oldx)/2);
Let me explain. (its flash 5 code)
oldx and oldy are the coordinates of a character inside a movie clip that has been inclined -60,-30 that will give you pseudo parralelogram 3d space.
finalx and finaly will convert the points of your character back to stage coordinates. That means you can limit and control your characters movement to within the parrallelogram but have the character itself outside the movie clip. (if it were inside the movie clip it would be all distorted)
It came in very useful when I produced a pseudo 3d game environment. Hope it helps.