Handmade Hero»Forums»Game
9 posts
Day 35, my drawing of Tile Chunks is not as expected.
I am having problems with drawing the random, or well any map for that matter using the ScreenX/Y For loop.

It will make the tilemaps more or less, but they are not aligned correctly or something.

And using the randomchoice with Door bool32 stuff shows it even more, it's not squares, it's like half squared ( [ like that, but from top going down a bit, then it's empty till the next one).

And they aren't aligned within the tilechunks, so some just get cut off.

Not sure how to explain, been trying to figure out what i do wrong, i tried write everything exactly as i see it on the video to no avail.


As it's licensed i don't want to copy the code here etc, so not sure how i should try to get help?
Simon Anciaux
1337 posts
Day 35, my drawing of Tile Chunks is not as expected.
You can post part of the code (where you think the problem is coming from), especially if you typed it yourself. A screenshot of the problem would help too.
9 posts
Day 35, my drawing of Tile Chunks is not as expected.
Well i typed it myself, but i mean it's basically copy paste as it looks the same:S

It's around this part:

https://youtu.be/i5-oY8EHkzw?t=241

I can't make it work, my version looks like this.
I get it pretty close to what it should be, but it seems to be offset by a row or something.

Simon Anciaux
1337 posts
Day 35, my drawing of Tile Chunks is not as expected.
There are 2 possible problems:
- the tile map data is wrong
- the rendering of the tile map is wrong.

To find the problem I suggest you try with a simple case: put wall tiles only in the corners of a room and see if they display where you want. If it works try creating a room without doors and see if it works, then add doors, then more rooms... Validate each step.

If something is not what you expect, try to find if it's the rendering that is wrong or the tile map data. You can do that by stepping in your code using the debugger looking at what variables contains.

Don't be afraid to post part of the code here.

Also if you have pre-ordered the game, you have access to Casey's code so you can compare the differences.