Thread: Some angle help
View Single Post
  #16  
Old 10-31-2007, 08:57 AM
Tolnaftate2004 Tolnaftate2004 is offline
penguin.
Join Date: Jul 2004
Location: Berkeley, CA
Posts: 534
Tolnaftate2004 is a jewel in the roughTolnaftate2004 is a jewel in the rough
Send a message via AIM to Tolnaftate2004
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.
__________________
◕‿‿◕ · pfa · check yer syntax! · src

Killa Be: when i got that locker in 6th grade the only thing in it was a picture of a midget useing a firehose :/
Reply With Quote