
10-31-2007, 08:57 AM
|
|
penguin.
|
Join Date: Jul 2004
Location: Berkeley, CA
Posts: 534
|
|
|
That's probably an issue with the position of the onwall checks. You need to check from the center of the object outwards, or you'll have it hitting walls about 1 tile too soon when headed up/left, and a tile too late the other directions. But this all also depends on the velocity, as is apparent in your script.
More elegant scripts use a for loop to check more elementary distances (e.g. 1 pixel) and determine if a wall is within 1 "velocity's" range. |
__________________
Killa Be: when i got that locker in 6th grade the only thing in it was a picture of a midget useing a firehose :/
|
|
|
|