gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Coding > Car racing demo - advice needed

#7843 - igorfromspb - Thu Jun 26, 2003 3:13 pm

Supposing I wanted to write a mode7 car racing demo.... What would be the best way to impliment the house walls along the road? Should I use sprites or should I draw walls using raytracing? There must be a well-established way of doing this, I just don't want to invent the wheel, you know.
_________________
Guns for show, knives for a pro

#7850 - Lupin - Thu Jun 26, 2003 5:26 pm

since you couldn't draw pixels when you use mode7, you would have to use sprites, but you could of course create some large sprites wich cover the whole screen and render into these sprites in real time, if you would be able to make this at an descent frame rate, it would look really nice! But you could only have 256 colors :/

I would use simple sprites though

#7871 - tepples - Fri Jun 27, 2003 7:32 am

If you want to draw walls along the side of the road, then I would suggest using mode 4 instead of mode 1/2 and then using a raycasting or BSP graphics engine. You'll probably only get 20 frames per second if you optimize the code.

If, on the other hand, you just want to display some stuff in the distance (as in Mario Kart and F-Zero for Super NES and GBA), then use mode 1 and put the stuff in the distance into "text" background layers.

If you want to draw objects that always face the camera, such as if your camera always points down the track (as opposed to the direction the player's car is facing), you can use scaled sprites for that. Mario Kart: Super Circuit makes good use of scaled sprites. In fact, several WarioWare levels are created entirely from scaled sprites.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#7981 - igorfromspb - Sun Jun 29, 2003 8:39 pm

Thanks. Think I'll make do with flat landscapes a-la Krazy Races for the time being... If only I could also work out the formula to calculate the player's position on the background map...
_________________
Guns for show, knives for a pro