-
hitTestObject but using co-ordinates?
(CS5.5 AS3)
I'm trying my first 2D maze game, and when a key has been pressed the code will look to see what object is next to the player. So I want to do a hittest without actually moving the player to find out what he is standing next to.
This is what I need:
if(player [with a variable added onto its x and y values].hitTestObject(target)){
//do stuff
-
The easiest way is to store the location of the player, move the player and do the hit test, then move the player back to the stored location.
-
Originally Posted by dawsonk
The easiest way is to store the location of the player, move the player and do the hit test, then move the player back to the stored location.
That's what I ended up doing. It works.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|