Very potato and not finished but hey that was fun to code :)
needs lots of everything...
-- 0.6 update: drift!!! wheeeeeeeee! totally unrealistic though...
-- 0.5 update: a lot less potato and fast thanks to @fred72 :)
-- 0.4 update. forgot to put checkpoints on the second track...
-- 0.3 update: sound, checkpoint, still need better driving physics...
-- 0.2 update: more optimization and refactoring
-- 0.1 update: better perfs...
Wow!
Wouldnt know where to even begin making something like this!
Great work ;-)
@ Paul Knight (how do you tag someone with a space in his name????) hey thanks. I'm late to the party and other managed to do this a lot more performance than me, but my version at least is quite straightforward: I first draw the track (in 2D) to the screen (but it will never be display...), then I use some trigonometry (basic ray casting) to render the 3D view in a part of the spritesheet, and finaly I redraw my final frame (drawing the sky and background, using sspr to copy the 3D view, etc...)
clever but way too many cos/sin per pixel!
have a look at the various sprite rotation routines on the bbs, you can calculate sin/cos once and use delta steps to move along the rotated axis.
much faster
@freds72 ha! your message was enough to send me in the right direction, I can render a 128 image wide now instead of 64 before and still keep 30fps :) . It works great ingame but I have strange artefacts in the intro scene (with a higher camera...), I'll see if I can fix this, or maybe I'll keep the slow function just for the intro...
(not posted yet)
So it seems it was a precision issue with small angle changes, I designed around it (and like it better this way...). Thanks a lot for the pointer! (now posted)
[Please log in to post a comment]