Level selection interface is done, except that there's no mechanism to load a level. Going to start working on program logic, again, instead of the interface.
Entity minimally implemented; moving on to Actor.
Working on Actor. Actor.attempt_move next.
Two changes. New function: cell_is_passable(x, y) - does what you would expect. Also, and this is important, placing an entity will attempt to call entity.set_coords(x, y) to keep the entity x, y and its location in the level in sync.
Made another alteration to Level, this time adding move_entity_from_to. Also implemented attempt_move in Actor. Tests succesfully, fwiw.
Okay, hold on; rethought how tool works. Also, I need LOS code, which is an algorithm I don't have access to without net access. So, tool will target an entity, not a cell, now.
Wrote algorithm to calculate all coordinates in range, given a set of coordinates. Will return negatives, coordinates off the level (of course it will it has no knowledge of the level!)
Added seismic sense; added a function to level to get all entities from a cell.
Actor.detect_entities test written.
Okay, so, implemented. However, I'm sort of implementing things in a disorganized fashion. Therefore, my next objective: playable prototype with movement for player, enemies(straight line), no end condition. Next up: figure out how to load entities.
I broke some of my tests. Fixing them. From now on, I shall write my tests so that different tests do not both rely on the same resource, because really, why did I do that? Well, laziness, but that doesn't make it acceptable.
Okay, solution to my quandry, and the solution is json. Going to create a Template class for loadable entities, and then when level loader hits the keyword it goes to the entities index, which searches the entities directories for the appropriate object, constructs it from the Template with additional parameters from the loader, and sends it back.
Simple json converter in z_json.py.
It probably won't matter that everything is ascii instead of unicode, but I wrote a function to convert it anyways. Wrote in scratch_paper and transferred to z_json.
Template now a class; Template has a create_instance function. LoaderEntityIndex must now know of the level. Next up, write tests for LoaderEntityIndex, Template.