Hi all, just thought I'd give an update on the collision situation.
Thanks to you guys, collision works perfect! With quite a lot of angle measurements, and changing of moving states upon different directions of collision, characters can now land on things, get damaged, bump their heads! Even those one-way platforms you get which you can jump through and land on!
But I am having only ONE more issue: if the co-ordinates of any entity are negative (i.e. say if character is partially off the screen near the top, or just walking off of the screen to the left), collision begins to screw up. (i.e. inoperable at all until co-ordinates are back to positive).
I am having a few ideas of what's going wrong, but I'd like to get confirmation of sorts before I delve into solutions too deep, because there may be A LOT of calculations to change and I don't want to screw up and find out when it's too late...
I'll post a (rather large) snippet of code which deals with the angles of collision, and maybe you guys could point out some maths errors or point me to the right direction (nice pun there ;]):
Yes, a lot of angles, no ;)? I am wondering if some of the co-ordinates in those measurements, and the initial positional conditions at the start may need some editing in terms of dealing with negative values.
Here is a lengthy description of what each line does:
If there is no issue with this code as far as using negative values is concerned, then the issue is elsewhere in the engine 8|.
Thanks for all your help guys, I wouldn't be here without it!
EDIT: also forgot to mention, one of my ideas involves the fact that the X and Y values are LONGS, while the WIDTH and HEIGHT values are UNSIGNED LONGS. Could this have something to do with it?