[SDL] Collision Detection
ultifinitus
spy4hearts at gmail.com
Tue Mar 2 22:51:23 PST 2010
I have never thought, for some strange reason to lower the number of collision checks per frame... But it makes sense! I have a solution that while it may not be elegant- it is a solution. I just have one question- I really want to make this a library that has multiple uses outside of my game, so I would really like to make collision detection dynamic. Do you think that I should just make an array of SDL_rects, surfaces, etc and each new sprite I make just increment the variable and store which array number that object is inside of it's class- or should I have an external program to take care of that and just log all of the surfaces, etc outside of the class structure? (sorry if that wasn't clear =/)
In response to the links on lazyfoo- honestly that's where it all started, with an impressive set of tutorials and a little bit of drive on my part =)
As far as the existing sprite libraries- Well I was honestly being rebellious. I wanted to write my own code, reinvent the wheel if you will. But I think I have come up with something that suits me better- and though it may not make sense to someone outside the convolution of my brain- it does in fact click with me.
Hah, sorry for my long-windedness- it may have been so, but I felt obligated to answer at least a few questions...
I hope to implement this in the next couple of days, and if you would like me to I can post some code- really the biggest thing I have worked on so far is the sprites- but the collision detection has eluded my grasp for a slight intermission and has really slowed my enthusiasm. But with renewed vigor I set out in my quest to make the ultimate sidescroller with imperfect physics and horrible graphics!
------------------------
#include <sig>
using ultifinitus::signiture;
int main(int argc, char* argv[]){
sigout << coolest signature ever;
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20100302/f6434443/attachment.htm>
More information about the SDL
mailing list