Posts RSS Comments RSS Del.icio.us Digg Technorati Blinklist Furl reddit 77 Posts and Comments till now
This wordpress theme is downloaded from wordpress themes website.

Body HUD, misc

Another good week of progress (part-time):
* VR: a little more progress
* Move system: refactor / fix / enhance
* Hero Body HUD

With hero Body HUD I ran into a good use for shared_ptr.  At first there was a bug when displaying a dead hero’s health.  When any figure dies (hero or monster), the corresponding HqSpaceOccupant is deleted, which deletes the pointer to the HqFigure (HqHero or HqMonster).  We still had another pointer to the HqHero for the HUD, but it was now pointing a deleted object, so the HUD displayed –35 (instead of 0) Body.  I fixed this by using using shared_ptr.  I suppose a messier way to do it would’ve been to have HqSpaceOccupant dtor conditionally skip deleting its figure when the figure is a hero (HqHero).  The video lets heroes die to show the bug fix.

The video also shows the latest Move system with mouse input and arrow key input.  For debugging, the hero rolls 255, which is why there’s so many red squares (otherwise the game only displays valid Move spaces).

The current turn order system (including the Body HUD) lets you (in code as there’s no UI for it yet) use any order for the heroes.  The HUD assumes four heroes, though I don’t think it would be much work to make it N heroes.

Trackback this post | Feed on Comments to this post

Leave a Reply