Results 1 to 2 of 2
  1. #1
    nolsen01 is offline Member
    Join Date
    Jul 2009
    Posts
    18
    Rep Power
    0

    Default Question about creating a Game State Manager

    I'm making a Game State Manager of my own. It uses a stack, to pop Game States onto. my Render and Update methods simply call GameStateManager.render and update respectively.

    My question is, whats the best way to send information about events to the current gamestate? Right now I only need KeyEvents, but sometime in the future I may need information about the Mouse and the Window and such.

    Anybody have any experience with this, or perhaps some reference code?

  2. #2
    nolsen01 is offline Member
    Join Date
    Jul 2009
    Posts
    18
    Rep Power
    0

    Default

    I think I've figured this out.

    Each of my gamestates has a "handleKeyEvents" method.
    It gets called by the gamestatemanager's handleEvents method, which casts an EventObject to a KeyEvent if the EventObject is an instance of KeyEvent.

Similar Threads

  1. Help creating a Masterminds game.
    By viper98 in forum New To Java
    Replies: 4
    Last Post: 11-09-2009, 05:13 AM
  2. Help with creating the game pairs
    By dave141000 in forum New To Java
    Replies: 1
    Last Post: 08-15-2009, 07:25 PM
  3. Creating a Card Game in Java
    By Natrix in forum New To Java
    Replies: 1
    Last Post: 05-05-2009, 06:55 PM
  4. need help creating my Tic Tac Toe game!
    By bobmasta5 in forum New To Java
    Replies: 6
    Last Post: 12-09-2008, 06:45 PM
  5. creating a text based game
    By Phobos0001 in forum New To Java
    Replies: 1
    Last Post: 02-12-2008, 05:35 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •