Search:

Type: Posts; User: aussiemcgr

Search: Search took 0.07 seconds.

  1. Replies
    7
    Views
    1,821

    Re: How can I improve on this?

    Instead of sending the switch statement the keyPressed variable, just send it: e.getKeyCode()
    e is the KeyEvent parameter of the method.
  2. Replies
    7
    Views
    1,821

    Re: How can I improve on this?

    Constants are just values. So, you can say:

    switch(someKey) {
    case KeyEvent.VK_W:
    do something;
    break;
    case KeyEvent.VK_S:
    do something;
    break;
    ...
  3. Replies
    7
    Views
    1,821

    Re: How can I improve on this?

    A few suggestions from my point of view:
    1. Class Variables that you intend on ONLY being used inside of the class, should be set to private instead of public (or protected if you think the variable...
Results 1 to 3 of 3