Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2010
    Rep Power

    Default getting class to recognize variables from another class

    I'm not sure what to ask, what I'm trying to do is have the keylistener stuff in one class, while the actual movement is in another class. I have keys set to make boolean values true, and my character is supposed to move when these values are true. How do you go about "carrying over" variables to another class?

  2. #2
    m00nchile is offline Senior Member
    Join Date
    Feb 2010
    Ljubljana, Slovenia
    Rep Power


    Well, this is a pretty general question, so without more details I can only offer a few general tips. The easiest way would be to have a reference to your character object in the control class, so when a key event goes off, you can give your character commands.

Similar Threads

  1. Accessing Variables From a Different Class?
    By Sterling in forum New To Java
    Replies: 1
    Last Post: 04-08-2010, 05:01 PM
  2. Replies: 1
    Last Post: 01-03-2010, 09:48 PM
  3. Replies: 4
    Last Post: 10-22-2009, 05:45 PM
  4. Replies: 3
    Last Post: 03-14-2009, 07:22 AM
  5. Replies: 13
    Last Post: 08-23-2008, 09:09 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