HOME | DD
Published: 2008-02-11 14:19:24 +0000 UTC; Views: 658; Favourites: 3; Downloads: 9
Redirect to original
Description
An engine I made to see if I could make a "fake 3d" kind of game. It's all an illusion, no actual use of the Z axis at all.Related content
Comments: 7
leprousharry [2008-02-11 22:43:43 +0000 UTC]
You should try to make the hittest a little more precise. When you use a movieclip for hittest in flash, its boundingbox is used and not its shape, as in this example:
Mc_1 and Mc_2 are both circles
.../¯¯¯¯\
./............\
|..............|
.\............/
...\____//¯¯¯¯\
............/............\
...........|..............|
............\............/
..............\____/
Mc_1.hitTest(Mc_2) will return true. Since they are MovieClip, it's their boundingbox that are used for the hittest, even if their shapes aren't hitting.
Because you are using trapesis (I'm not sure how to spell it in english... sory), each of the shapes you are using could have an array containing 4 point (import Flash.geom will be necessary). Look at this example:
1,0......5,0
...../¯¯\
0,2¯¯¯6,2
import Flash.geom
var pointArray:Array = Array(new Point(1,0), new Point(5,0), new Point(6,2), new Point(0,2));
With these point, you will be able to test if two trapesis are hitting each other with their shapes.
../¯¯\
/........\./¯¯\
¯¯¯¯¯/........\
..........¯¯¯¯¯
import Flash.geom
var Trapesis_1_array:Array = Array(new Point(1,0), new Point(5,0), new Point(6,2), new Point(0,2));
var Trapesis_2_array:Array = Array(new Point(5.5,1), new Point(10.5,1), new Point(11.5,3), new Point(4.5,3));
function checkForHit(){
for(var i:Number = 0; i
}
return false;
}
Well... something like that might work.
👍: 0 ⏩: 1
Computer-Turret In reply to leprousharry [2008-02-12 01:03:55 +0000 UTC]
I really didn't bother with any advanced hittest. There was no real need for it in this, and yes I already know all about the boundries around MCs and various hittesting methods ranging from basic to advanced.
👍: 0 ⏩: 0
zJoriz [2008-02-11 14:25:00 +0000 UTC]
Sounds interesting, but somehow it doesn't work here... all I get is the black screen with "click to start", and clicking doesn't help of course...
👍: 0 ⏩: 1
Computer-Turret In reply to zJoriz [2008-02-11 18:01:02 +0000 UTC]
That's odd, a left click should start the game... Works for me.
👍: 0 ⏩: 1
zJoriz In reply to Computer-Turret [2008-02-12 08:29:35 +0000 UTC]
I'm working on a Mac, with Firefox and Safari... both don't seem to react to my clicking.
👍: 0 ⏩: 1
Computer-Turret In reply to zJoriz [2008-02-12 12:09:51 +0000 UTC]
Mac... that's probably the problem. It just checks if the key code "1" is in action. Which is the left mouse button. I didn't think that a mac would have a different mouse but it's possible. I'm using FireFox.
👍: 0 ⏩: 1
zJoriz In reply to Computer-Turret [2008-02-12 13:04:08 +0000 UTC]
Ah well, better next time ^_^
👍: 0 ⏩: 0

























