Monday, February 14, 2011

Death and creation

So this week was rather busy. I seem to be doing that off and on. We're working on a grand awesome project, me and some friends, and I'll announce that when we have something to announce. For now there's just 1 word you need to remember: Thorworks. That's right.

Regardless of these things I still managed to do quite a bit of work on CubeWars. I continued implementing objects, now adding a static actor class. This class will encompass all objects in the level (save goodies) that do not get their logic processed without direct player influence. This would include things like buttons, doors, hazards and the like. Anything that doesn't do squat unless you interact with it or just bump into it. I already made the Hazards work and also implemented dying. I already have plans to have the player explode into gibs when they die, but that's cosmetic and will come at a later time.

Aside from some tweaks to collision for non-tile objects, the major change I made this week was to something I had figured I would add at a later time. I'm talking about the level editor for CubeWars. Originally I had planned this for the Beta release, or whenever I would be needing it more to start making levels, but modifying my levels through a text editor became too unwieldy and I figured I might as well do it now. Rather cleverly, I made the new Editor core depend on the game source files so I wouldn't have to redo those and if I make any changes/additions to them, I don't have to go to great lengths to make it work in the editor.

There are a few things which are needed for the Editor which are mostly done now. First is mouse control. CubeWars will play completely with a keyboard (or controller) and doesn't use a mouse, but the Editor kind of depends on this so I started a class that would hold the mouse position, if it was clicking, what 'brush' the user has selected and so on. After that I added a 'button' class for the GUI and a panel that would hold multiple buttons. Using these simple elements I can easily craft a simple interface that would make building levels a cinch.


I tell ya though, the biggest challenge was figuring out how my makefile would build 2 projects with slightly deviating dependencies. That ended up being real simple though, just like when I ran into some trouble with dynamic arrays causing segfaults. I love programming, don't you?

See you next week!

No comments: