Skip to main content
7 events
when toggle format what by license comment
Apr 13, 2017 at 12:18 history edited CommunityBot
replaced http://gamedev.stackexchange.com/ with https://gamedev.stackexchange.com/
Aug 28, 2011 at 23:08 comment added bummzack @TerryB: I think the Bresenham line algorithm will work just fine here. Draw the line until you hit a wall pixel and that will be your point of collision.
Aug 28, 2011 at 22:56 vote accept TerryB
Aug 28, 2011 at 22:56 comment added TerryB thanks very much! I don't plan to do any deflections so I think thats ok. I wasn't sure what to do with bullets travelling fast that may skip over walls in a single frame. Figuring out if they crossed a wall seems ok, just take a sample of the map image in a long thin rectangle that is the bullets path and look for wall colored pixels. But figuring out the first wall pixel it would have hit seems a bit harder. I think when the bullet firsts fires I'd raycast and take a number of sample pixels at short intervals along the ray looking for the first wall pixel and mark that as the impact point?
Aug 26, 2011 at 12:33 history edited bummzack CC BY-SA 3.0
fixed typo
Aug 26, 2011 at 8:57 comment added Engineer In my experience, the surface normal issue is pretty trivial compared to actually determining angular impulse following an impact, in a pixel-perfect collision detection system. Generally PPCD isn't used for games that require that sort of level of detail, though, probably because it makes things a lot harder than vector-based physics, in this regard. The other problem I experienced with this approach was the possibility of getting "stuck" when you rotate your character in certain positions in your level. Box2D and the like handle this by pushing centroids apart when they're too close.
Aug 26, 2011 at 7:41 history answered bummzack CC BY-SA 3.0