This week’s Oracle’s Eye development wasn’t too fruitful, but I did spend a bit more time trying to figure out what I needed in the first place. The lack of actual code doesn’t bother me so much now that I have some ideas of the problem domain.
The problem domain of the moment is the Event system. I don’t want to hardcode the movement of the Ball and the Player since I might want to tweak the way things are handled. I’ve had a general idea of how the Ball and Player should interact, but I haven’t explicitly defined it.
So while in the middle of a presentation last week, I started to write down some ideas. What is it that I am trying to accomplish?
Well, I want to finish the game. How do I do that? Well, I’ll basically need to allow the Player to end a Level by kicking the Ball into a Goal. That line basically sums up what would make this game into a game, regardless of the amount of fun possible. The idea is that if I can do that, I can then design as many levels as I want, but the basic game is complete.
Well, how do I get to that point from here? Currently I can move the Player, and the Ball can also be moved, but I don’t have a clean way of keeping the Ball stationary until the Player touches it. I also don’t have a way to tell the Ball when to stop moving when it hits a Wall or the Player.
What I need is an Event handler and some Events. I need some indepdendent system to handle things such as telling the Ball when to move and when to stop moving. I need something to decide that the Level has been completed or needs to be reloaded. How about the creation and destruction of objects during a game? Maybe there are four Balls, and when one gets into the Goal, it disappears.
Now, when the Player collides with another object, the GameWorld can create a CollisionEvent, or maybe it knows that the Player hit an object of type Ball and so creates a KickBallEvent.
I’ve read a few tutorials and the book Game Coding Complete, and so I should be able to come up with something workable fairly easily. Well, maybe not too easily. Still, once I get an Event system working, it should be much easier to make the Player kick the Ball, to get the Ball to enter the Goal, and to let the game know that the Level has ended.
Or at least that’s the theory.










While complex designs are good when you need flexibility, I’d say it’s better to start with doing the simplest thing possible to acheive your goal. It will take you a lot less time to hardcode this logic and find out if your game works than it will to create a complicated architecture. If you later decide you need a more complex system its relatively easy to remove the hardcoded parts with more flexible code.
I’m assuming your goal is to make a game, and if it is, I would do things that move toward the goal of having a playable game, not a nicely designed engine. Even if your goal is to design a nice game engine, chances are there are a lot of things you aren’t thinking about (having no actual game running on the engine.)
Left by Impossible on November 11th, 2005