Tuesday, April 25, 2006

Tile edging works

Today I managed to push myself to finish off the code to calculate all the proper edges for each tiles. It was a tedious job, as it was a giant block of if statements and bitwise ORs and ANDs to determine which side was connected.

The code is ugly, but there wasn't much alternative to it. These pieces of code are in the category of "Never touch it again". And that's exactly what I'm going to do: Not touching it anymore, since it's working perfectly.

For those of you who want to see it all in action:
Looks sexy eh? It contains all the tiles, and shows how smooth each tile is getting the right edge, including the tiles that rely on a specific underground(Such as mountains).

The todo list for the editor is now down to:
- Add New Map dialog
- Saving
- Loading
- Adding a 3x3 brush, to quickly cough up large areas
- Use the statusbar to display some information about the map, such as height, width.
- Autosave function for automaticallly save unsaved work every 5 or 10 minutes in a special temp file.

I was thinking about adding a minimap, but I'm not sure if I'm going to do that. If I am going to do it, I need to do it in WinForms code, since I can't render outside the D3D panel, and it would be annoying to show the minimap in the editor screen itself. I'm probably going to leave it out for now, but I can always add it in, it's not something that requires a complete overhaul all the sudden.

2 comments:

Anonymous said...

Looks good. How are you going to do the starting positions?

Keep up the good work :)

Anonymous said...

Looks great