Re: [Super-tux-devel] Gameloop Rewrite Status
Brought to you by:
wkendrick
From: Tobias <tob...@gm...> - 2004-01-02 21:21:43
|
Am Fr, den 02.01.2004 schrieb Bill Kendrick um 16:04: > On Fri, Jan 02, 2004 at 06:04:51PM -0500, Tobias Gläßer wrote: > > > > 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. > > I almost always stick to 'bounding box' (what you described above) > because it's fast, simple to program, and for most fast action games > it's "close enough." > > The trick is to give the player a slight advantage. (e.g., their > bullet can hit just outside the enemy's x,y/w,h range, but the > enemy's bullet actually has to be a little INSIDE the player's rectangle, > otherwise it's ignored) > > Super Tux is a fast action game, but can go slowly (e.g., the player > can walk around a little to try to make a precise hit, or just be > standing there when a bad guy aimlessly bumps into Tux), so it MIGHT > be worth doing more precise collision detection. > > I think, though, that so far the bounding box method has done well > in Super Tux, so I would much rather we worry about adding gameplay > elements (more enemies, more kinds of objects to deal with, and > more levels and level art). If we REALLY need to fix the mechanics, > we can do it later. :^) > > The biggest complaint in the 3 years since I first released Super Tux > was that there was only one level and few enemies. :^) Not that > Tux didn't collide with laptops 'precisely' ;^) > > > > -bill! > > PS - FYI, I recently had to do line-intersection for collision detection for > a vector-drawn game I'm prototyping for my new job... :^) > I first do bounding-box to decide whether I need to BOTHER with the > slow line-related math, of course. Keep this trick in mind!! I'm trying my luck with bitmask-collisions, but first doing bounding-box tests is obviously. My aim with this rewrite is to make it very is easy to add funky new enemies and items. I'm sure that's a better way of doing something in the long run, than to add more code to already bloated code. Greetz... Tobias Gläßer |