Mar 5, 2012

Magic

You know, it isn't that difficult as I thought!
There is no need to rewrite all code, 95% of it works and works well enough, but there was critical issue: code of magic, bullets etc has real OOP problems, Code was removing magical object every time when it should be removed, so it makes code big and really odd. Also, from time to time there were actions collisions and, for example, object was remover before it did something important.

I added just one flag, it mark object as "should be removed" and it would be removed at the end of it turn.
This let me to cut bulk of repeating check code, making it simple, easy to read and stable.
There are few issues yet, but I think that would finish objects in a day or two.

Update:
I have finished objects moving, collisions with creature and removing objects, fished there task (it was real problem).
So, I have to add animation tail for objects and final animation for explosions and, well, we are done here, I would return to traps.

No comments:

Post a Comment