Tuesday, December 22, 2009

Coding.

So, I've realized that much of my coding has been really sloppy and should have been made much more organized. At this point, I really don't want to go back and reorganize all my code, but it looks like I might have to.

Part of the problem lies in that I have certain variables which I want to remain constant throughout the span of the game (ex: points), other variables which will only need to be refreshed with each new level (ex: health) and the remaining variables would be particular only to the portion of the level in which they belong (ex: enemy variables).

So I would need at least 3 different layers of code, each spanning over various chunks of the game.

Also, I realized how terribly ugly and poorly written my hitTest coding for all my enemies has been. I really should go back and condense it, not just for the sake of organization but because the way that I currently have it written is just plain embarrassing.

I just don't feel like going back and dealing with this quite yet. Maybe once I've gotten a bit more of the art I need done, I'll go back and fix all this junk code.

I did however already go back and fix a bit of the code that I realized was just plain stupid. I managed to condense about 30 or 40 lines of code down to about 2 or 3. I don't even want to talk about how I did that because I feel really dumb for it was written before.

For some of the hitTest stuff, I think I'll have to go back and make some new hitboxes. I really realize now why making hitboxes are so important. It isn't about the structure of the box, or where it is that's important to the programmer, it's because it serves an independent purpose as an instance which makes coding SO much easier. This may however negatively effect the way some interactions occur between Daisuke and his enemies.

No comments:

Post a Comment