04-05-2012, 03:36 AM
|
Will work for food. Maybe
|
|
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
|
|
I didn't use testx for a reason, newx would have sufficed lol. The only position you need to check is its intended(new) position. The testx/testy stuff is for onwall use, because as it was previously mentioned, only checks a single pixel; so typically you'd center the check in the player and then offset the check by half the size of the player. There's no reason to do any of that more complicated checking here.
I feel this is an instance of you using preexisting code and hacking it up but not actually being aware of what any of it does. Examine what you're doing logistically and this sort of stuff will make sense. |
|
|