Let's see your githubs, and let's get forkin' - Community & Forums Related Discussions

Users browsing this thread: 23 Guest(s)
bottomy
Registered
(16-11-2013, 07:28 AM)kirby Wrote: Wow, thanks a lot, very useful. I haven't got as much time to work on it at the moment, but I'll certainly give it a look when I can. I'm still very new to gamedev (as in, this is the first thing I've ever made bar a quick test and some tutorial exercises), and if you compile and run it you'll see it's very amateur, so any comments are welcome. I don't think there's any difference in the collision detection, but you checked the 'game' branch right, all the work is being done there.

Yes it was from the game branch. Anyway there's nothing inherently bad about how you're handling movement collisions (since it's definitely a common way), it's just if you do have objects moving fast enough then yeh it wouldn't work correctly.

Although as far as the collision check itself (the above comments were as far as the entire check with movement) you're creating rects for each side (I can see you're doing that to determine the side of the collision) however you don't seem to be checking the inside of the bounds. So unlike a rect-rect intersection check (which is what I assume you want) it's not going to detect that one case. Another issue with the sides check is that it is greedy, there is more likelyhood of TOPLEFT being returned (or the other down the list) if there is an object that is colliding with multiple sides as it's the first comparison (this may be an issue or it may not). Lastly if you're only performing the checks on movement, then the side detection seems redundant as you would only be able to collide with something in the direction you move (so the sides facing that direction).


Messages In This Thread
RE: Let's see your githubs, and let's get forkin' - by bottomy - 16-11-2013, 08:48 AM