Sunday, January 26, 2014

Lazy Sunday Work

Didn't get nearly as much done today as I wanted to. I implemented a basic player tracking/scoring system build into anything that can take damage. Theoretically the level at this point could gain scores from killing the player? That could be a fun statistic to track.

Somehow Unity decided several of my files would get wiped so I spent a majority of my time re-writing code that mysteriously vanished. Lesson learned, installed perforce server on my machine, and I'll be using that from now on. I meant to do that for a while, anyway.

The scoring system works by having each player own a ScoreTracker, which reports back to a ScoreMaster at then end of a run/level.  The ScoreMaster is a singleton, or what passes for one in Unity since I made it a MonoBehaviour, which I might go back and blow that away, but we'll see. I don't have any pressing need to make it a pure singleton at the moment.

ScoreMaster serializes records in/out upon load and save functions, standard affair.  Every item in the game that can take damage is required to have a scoreable component on it, but scoreable components can be put on non-damageable objects as well.  The basic scoreable component only adds value when the object is destroyed, though with an enum switch and a derived class it can be made to add score upon contact with certain classes, etc.

Nothing too exciting, didn't get a chance to work on any of the actual gameplay like I wanted too, or even get to the score visualizations.  :(

Well, the girlfriend is gone this week so perhaps I can get a few really productive nights in after work!  I'm still excited for this game, just sucked to have to re-write code for unknown reasons.

If I got to bed in the next 15 minutes I can get a whole 8 hours of sleep...! Fingers crossed.

No comments:

Post a Comment