|
-
Senior Member
Platformer Collision Engine.
I have spent the last 2 or so days preaty heaverly trying to get a pixle perfect Platformer engine up and running.
The way i was doing it was checking for a collision on each side of the hero, then running a loop to see how many pixles it went into the object then move it to the right spot. I got all for sides working fine, i then started working on adding in code to support gravity which means the hero would no longer move only in 4 ways. I started running into problems there, i can easerly code what i need done, its just that i dont know when i need to check for the collisions. If i stop running all other collision and just check for 1 collision to test to see if my code works it runns fine but once i start adding in the others my hero starts flying all over the place and getting all screwy.
I am hoping some one has made a good one or even has an article on how it can be done properly.
Cheers
92.7 Fresh FM for all your South Aussies - Doof Doof music FTW people!
-
Senior Member
why do you need pixel perfect collision?
a simple bounding box usually does the trick, or you can use geometry to figure out collisions
looping through every pixel is the most inefficient (and hard to implement) way I can think of
if you expand a bit about what the scope of your game is, I'll try to be a little more helpful
-
Senior Member
Its ok, i got it working in the end.
92.7 Fresh FM for all your South Aussies - Doof Doof music FTW people!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|