Results 1 to 1 of 1
- 02-03-2011, 11:20 AM #1Member
- Join Date
- Feb 2011
- Rep Power
I am designing a game with a step-based game loop in Java. The loop waits for user input, executes the game logic based off the input, updates the screen (a JFrame), and repeats.
I made a class Being (couldn't think of anything else except Character there) which is subclassed by Monster, and Player; these just have a bunch of variables with getters and setters. These little guys move around in a level, so I also have a separate class Level with an array of Squares.
Now I want to create a class GameActions, which are a bunch of different actions the player can take with each different input command. When the game logic resolves this action, the monsters can take their turn to also take an action, although they get a more limited set of actions.
So I've tried a few things but ended up getting confused. I'm not really sure what to define in the GameActions class, and should I implement these in the Being and/or Player class, or in some inputhandling class?
I tried my best to explain everything clearly, because there would be a lot of code to post. If anyone wants to see the code I have anyway, I'll post it as soon as I can. Hope anyone can help me out and many thanks in advance.