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.