💡 In the video, you may notice subtle textures resembling moving asphalt. This isn't a glitch; rapidly turning pixels on and off on this type of display creates a grayscale effect. Play with contrast of your display to see it.
Animation Techniques
For this project, I utilized a game "engine" from LCD Invaders game. It maps 16x4 game field to 16x2 LCD. But instead of implementing a custom character for every state of the sprite I designed a sort of code-pages approach. Think of each sprite as a deck of cards containing various animation frames of the same character. By rapidly switching these "cards" (custom characters), we can create the illusion of animation on the screen. Through experimentation, I discovered that using lcd.createChar() is significantly faster than lcd.print(). Although we are still limited to displaying only 8 custom characters at a time, we can swiftly replace them to achieve an animated effect across the entire screen.
Game Over?
Looking to level up your gaming experience? Dive into customization by personalizing this game or crafting your very own masterpiece using the same animation technique. Get creative with the spritemap array to give your sprites a unique look. And why stop there? You might also want to port the game to a 20x4 character LCD to have enough space for implementing curved roads.
Share your ideas in the comments below!
Awesome project!
@arduinocelentano , could you please publish the code (and maybe the whole project) under some opensource license? So other people can re-use it and improve without legal concerns :)