Re: [Super-tux-devel] Gameloop Rewrite Status
Brought to you by:
wkendrick
From: Ricardo C. <ri...@ae...> - 2004-01-02 17:58:11
|
Hey there! Nice to see that the gameloop is being worked, since here is where the act= ion=20 takes place. I've already done a collision func to test collisions between two surfaces= ,=20 but I am sure this is not the right way to go. What I do is to check if=20 there are pixels from both images that are different from the colorkey and= =20 that are in the same position. (since supertux uses the alpha bit, you would had to replace colorkey by=20 alpha). However, this method is slow and I think that it is unnecessary in this ga= me.=20 a better approach would be the use of a bitmask per surface, as explained a= nd=20 implemented over here: http://www.ifm.liu.se/~ulfek/projects/2d_Collision_Detection.html Ricardo Em Sexta, 2 de Janeiro de 2004 23:04, o Tobias Gl=C3=A4=C3=9Fer escreveu: > Hi all, > > I'm making progress and you'll probably see the next CVS commit > tonight. I'm currently thinking about the new collision detection > and decided to move them all into one place. (i.e. collision.c/h ?) > We need a function, wich can do collision detection, but there are many > possibilities on how to do this. > > One possibility is to check if the "rectangle" of an object hits the > "rectangle" of another object, like we currently do, but I don't like > this method, because it isn't very precise. On the other hand it's > relativly fast. > > The other way to do collision detection would be a pixel-per-pixel > solution, where we test, if two non-alpha pixels hit each other. > Maybe someone has already written such a function or a class in C++, > which could be ported. > > My experience in this area is low (tux bless google), but I guess > some of you have experience and can give me some hints and tips. :) > > Greetz... > > Tobias Gl=C3=A4=C3=9Fer =2D-=20 "Hi. This is Dan Cassidy's answering machine. Please leave your name and= =20 number... and after I've doctored the tape, your message will implicate you in a federal crime and be brought to the attention of the F.B.I... BEEEP" -- Blue Devil comics |