Re: [Super-tux-devel] Gameloop Rewrite Status
Brought to you by:
wkendrick
From: Tobias <tob...@gm...> - 2004-01-02 19:39:07
|
Am Fr, den 02.01.2004 schrieb Ricardo Cruz um 13:02: > Hey there! > > Nice to see that the gameloop is being worked, since here is where the action > takes place. > I've already done a collision func to test collisions between two surfaces, > but I am sure this is not the right way to go. What I do is to check if > there are pixels from both images that are different from the colorkey and > that are in the same position. > (since supertux uses the alpha bit, you would had to replace colorkey by > alpha). > However, this method is slow and I think that it is unnecessary in this game. > a better approach would be the use of a bitmask per surface, as explained and > implemented over here: > http://www.ifm.liu.se/~ulfek/projects/2d_Collision_Detection.html Hey, I really like the bitmask approach! Thanks! :) Greetz... Tobias Gläßer > Ricardo > > Em Sexta, 2 de Janeiro de 2004 23:04, o Tobias Gläßer 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äßer -- |