Currently I'm prototyping a few ideas for carcode features, I have to plan very well what I'm gonna do as everything should be flexible in order to facilitate future development, here are a few things I have been doing:
Tracer lines
One of the features needed was to implement tracer lines, my initial idea was to use an additional surface and just draw them there, this worked well and was very easy to implement, however, this restricts the level size to the screen size, in the future we want to be able to work with maps bigger than the screen.
To alleviate this problem I just recorded the lines coordinates as they where being draw, each new line is checked against the last one in order to see if they have the same angle, if they do we only extend the last line, this helps a lot with memory consumption. In a test I did I generated around 680 lines by just moving forward and doing a half curve, this was reduced to just 15 lines with the checks in place.
OpenGL Rendering
I have a branch with OpenGL rendering as an experiment, which could potentially help with many features, it makes easy to implement big levels and corrects visual problems (skewing) introduced by rotozoom function used to rotate the car surface. Additionally OpenGL rendering is very fast in my machine (with a puny old intel graphics card, mind you), faster than plain pygame.
This could be a good enhancement has it will facilitate future development, we could substitute pixel graphics for 3D models.
Suscribirse a:
Enviar comentarios (Atom)
No hay comentarios:
Publicar un comentario