Tilemap Rendering
I fixed the problem With the bitmap rendering. It was assuming that the first pixel of the bitmap is in the top left corner. While it is actually in the bottom right. So just removing a minus sign(-) solved the issues.

That meant I could draw images for all the tiles correctly. I made an array with some test tile images. Based on the tile value it now picks up the correct image from that array. There was an if statement in there which would only let the game draw an image if the tile value was above 2. But now all tiles can be drawn. Since 0 means uninitialized I can also have a graphic to showcase that.

So yeah, pretty happy again with how this looks right now. Though I think I need to add a way to determine dynamically which textures I need and add them. While removing old ones that aren’t used anymore. Which is really the difficult part of this system :p

Finished the last video that was left from Monday. Got some nice rotating points now 🙂 However I did notice that the player is colliding weirdly with the tilemap. Seems that the bitmaps are offset incorrectly. I’ll have to investigate this further tomorrow in the train.

The next video is filling rotated rectangles. So would be nice to follow that this weekend maybe. That may even give me enough to start working on some gameplay stuff again.

I mean I can create a test track, improve the car handling and then test that pickup mechanic I came up with. If that all feels good and nice to play. Then you sort of got your game right there haha It will probably not be so easy 😛 But it is exciting to think about!

Last modified: September 22, 2022