Day 2


Day 2 was both fun and frustrating. I got about an hour of coding time in and managed to begin a structure for the game. I created an Entity class and an EntityStore for creating and finding entities by id. This would allow me to use references for Entities instead of straight pointers, which is much better for serialization. However, with some structure also came a lack of visible progress. I was essentially just re-writing the code to do the same thing but in a 'better' way.

What I really wanted to was prototype the basics of the game. Dropping the refactoring work where it was I jumped back to prototyping some ideas. First on the list was selection, second was buildings.

Selection wasn't hard. Until I get some form of spatial query up and running I'm doing it the brute force way and just looping through each entity. An entity is asked if it overlaps with the clicked coordinates and the first one retrieved is considered 'the one'. Good enough to do things like testing movement and unit orders.

Buildings I'm going back and forth on. I started by having them be an extension of an entity, but instead of having one glyph they can have an array of them. This seemed like a good idea, but I spent way too long playing with the look of the buildings and it was distracting me from what I wanted to create. In the end I left the code but made my few testing buildings just use a single glyph. Need to move on after all.

After uploading the progress and calling it a day I noticed that the build was just a black screen. That's what I get for pushing it late and not checking my work. More on day 3.

Leave a comment

Log in with itch.io to leave a comment.