The Actions, and the Special Actions

Yesterday I worked in the Console UI, everything is going out fine and I finished cleaning all building errors.

Now the Console is initiallized with a list of UserActions, a class that relates keycodes with Actions. I had a problem with the Swing Console Interface as it doesn’t want to report Arrow Key presses in the KeyPressed method of KeyListener, I must be missing something…

The last issue I had was when I tried to assign a key to the “Advance” action. Advance is a DirectionAction and thus requires the player to choose a direction in which he will advance. But nobody would like to press, say, ‘w’ and then the arrow key to move.

As for the ConsoleUI, “Advance” is just another action, which must be related to a key and be filled their parameters, but for the player it is a special action, in which their parameters are automatically filled depending on the arrow key that was pressed.

That’s why the ConsoleUI will now support *Bump*; It will be fed with two special Actions, a DirectionAction which will be used as Advance and a NearBeingAction that will be used for Attack; the logic of the bump will be determined into the UI and the game will still just notice the player intention to make a parametrized Action.

I think it is time to write a small article about how I’m handling actions, may be nobody in the world cares, but I just want to 😉

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s