An Archived Managed World

This blog has moved to http://www.managed-world.com/blog

  Home  |   Contact  |   Syndication    |   Login
  473 Posts | 0 Stories | 429 Comments | 1288 Trackbacks

News

Twitter












Tag Cloud


Archives

Post Categories

Blog Roll

[Crosspost from Managed World]

I have now ported over most of the Console functionality from Boom!. I still haven't ported over the ConsoleRenderer yet, so I'll just tackle that tomorrow hopefully. As a little background, Boom! was originally written in 1.1, so I've been pleasantly surprised with how much code I've been able to remove simply because I can use Generics now. The downside? We're not using 2.0 at work yet so it's torture everytime I need a strongly-typed dictionary or list during my day job. I'm starting to realize just how spoiled I might be by being able to choose exactly what technology I want to use on my private projects :).

The current thought that I am having regarding the Console functionality is that I'll implement it using the MVC pattern (Model/View/Controller). The MVC pattern has been floating around at the back of my mind as of late. For the implementation, I'm contemplating introducing a GameContext object which will be the "context" for a GameState. Basically, the GameContext will contain the current Model, View, and Controller that the GameState is working with. Then I'll have the GameState actually have a stack of GameContexts which will enable pushing and popping of contexts. For example, if the user opens the Console a new ConsoleContext will be pushed onto the current GameState. Then when the Console is closed, it will pop itself off of the GameState.

There are some issues I have to work through on this one though: like the fact that I want the GameView to continue to render even if the Console is open (since the Console will only be taking up 1/3rd of the screen). Perhaps it is not the context in which I am pushing and popping, but it is just the GameControllers. If that is the case, there may not even be a need for a GameContext object (as it is just a glorified "wrapper" anyways). Even that idea I'm not entirely comfortable with though as I want to support both a List of GameControllers as well as a Stack. In the case of the Console object, I want to actually push the ConsoleController onto the stack to make sure that _it_ is receiving the current events. However, in the case of two controllers like a PlayerController and a ComputerController (for computer opponents), I want both of them receiving all events at the same time. So, perhaps both a Stack and a List are needed. Or perhaps I can get away with just one if I use an adaptation of a Composition-type pattern? Anyways, there is a lot to think through :).

Well, until then, I'm off to bed and I'll see all y'all on the flip side :). Maybe I'll have those pleasant software design dreams tonight :).

posted on Sunday, April 30, 2006 6:21 AM

Feedback

# re: Tanks - Update 2 5/1/2006 6:27 AM Ben Scheirman
Keep it up, man.

I, too, have jumped on the wagon again, though this time I re-familiarizing myself with the next release of mdx (2.0 this time).

I've got a simple tetris clone going, but it's not ready for prime time. Plus I think I'll have to change the name to something really stupid to avoid issues with trademarked names. (And think of the MILLIONS I could make off of another Tetris clone! It's almost like cheating! muahahahaha)

btw, when's the next source code release comin' ?

# re: Tanks - Update 2 5/1/2006 6:00 PM Jason Olson
Well, welcome back Ben :). How you feelin' buddy?

Perhaps you have been gone a while. Do you know that there really isn't going to be an "official" MDX 2.0, right? It's going to be integrated into the XNA Framework now (I believe Tom and his boys have even switched teams over near the XBox/XNA folks).

Anyways, I'll probably start doing source code drops when I write the articles. I might be able to get started on those this coming weekend if everything goes well.

Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification: