Changing 2 images at mousePressed

41 views Asked by At

I have 2 images of legs of a character, I want them to be changing while I pressed the keyboard for example left or right arrow key. It's like the character is walking. How to do this in java slick2d? I have no codes to provide because I have no Idea how to start coding it. Thank you very much.

1

There are 1 answers

0
user2226786 On

If you just want to handle basic input and you don't need to use slick2D then you can just use a KeyListener or MouseListener for input. These are Java features and are very simple to use.

To use Slick2D, my best guess would be to start here, Slick Commands

These are for more advanced inputs I believe but you should do some research on each to see what you need to use.