i've been analyzing collisions in your game and i don't have any reasonable answer to what you're doing, yet. its obvious to me that your ship's collision shape is a circle. you've made it so that the ship's collision circle can eat the walls of the map in certain circumstances:
- you can fly through very thin bits of wall
- if you fly very close to a wall, you can eat it a little bit as you fly by
i can smooth a corner by just flying along it. when i go fullbore at a wall and drift into it, i bounce off in a direction that isn't usually unreasonable. how the hell are you doing that?! i honestly can't figure it out. the reason i haven't ever done a game like this is because i could never figure out a good way to guess the rebound direction. i know how to check to see IF you're touching, and i know how to get a rebound angle if the wall is represented with vectors, but i could never figure out a decent way to guess what the wall's angle was with bitmaps.
i think you mentioned that you hadn't either.
the solution is to figure out what the normal of the surface you'd be rebounding off of would be, right? i'm guessing at a possible solution here, but lets pretend we can figure out an average point of contact between our sphere and the wall. lets take a small area around that point and look at the bitmap data there. for every solid wall pixel in that area, we could make a vector from the pixel to the ship's center, couldn't we? lets suppose we did that and we took an average of those vectors and pretended that it was the perpendicular to the wall.. using our original average point and this new perpendicular, would that be unreasonable to figure out the reflection vector with?
there's no way for me to know unless i actually write a test and see it with my own eyes. maybe that'll be tomorrow's exercise ^_^
a couple of last thoughts before bedtime. scattered pixels would try to average themselves into a wall, so thats something i have to look at too. just ploughing through loose pixels and erasing them isn't an unreasonable solution to me.. you must be using the contact area sum as a part of the rebound/erase decision..]