Monday, June 18, 2007

Grid, Mouseover, Drag n' Drop, Sever and Retract, Collision Detection

I completed the grid functionality. There were a few cases where a section wouldn't be added to all squares it passed through, but with some hard work and deliberation, I fixed the problem.

I completed the mouseover stuff. I had to make some decisions over which methods to use, accuracy vs. performance. The route sections are rectangular, but there is a semicircle zone at each endpoint that still registers as within the route. However, this small zone is usually beneath the nodes at either end, so the anomaly will usually be unnoticeable. It only happens when a route isn't completely built, so that there isn't a node covering the zone. I may use a more accurate method when the section isn't completely built.

I added the drag n' drop functionality, allowing the player to build new nodes and routes. I also added the ability for the player to retract or sever his own routes. As with my last rendition, this was fairly difficult. Trying to get people to die when they're supposed to was hard. Every once in a while, someone would just keep on running off into the distance. More often than not, it threw an exception. But it's working fairly well now. I'm just waiting for the last few bugs to show up spontaneously.

Next on my list is to add collision detection for the drag n' drop. At the moment, you can place nodes wherever you want, on top of other nodes, intersecting other routes, and you can even place them outside the map's boundaries.

After that, I will add collision detection to the routes that are changing in length in case they are running into an enemy route or node. If the route hits an enemy node, then the route will retract, and the enemy is unaffected. However, if the route hits an enemy route, the player's route retracts and the enemy's route is severed, destroying everything branching from it.

I think (plans tend to change) I will then begin work on the fog of war.

Stay tuned.

clevceo

No comments: