Im having troubles with using a KeyListener.
When running the game, the loop starts, calls the board.update() which in turn calls the kille.update().
kille.update() is reachable but it doesnt do anything because the Keylistener doesnt “work”.
I googled and read about Observers, but didnt quite understand it.
Can someone please take a look at this code and tell me what im doing wrong?
This is what my program looks like atm.
(Sorry for some swedish comments and overall shitty code)
Main class and game loop(used the “Fixed Timestep” from http://www.java-gaming.org/topics/game-loops/24220/view.html)
http://pastebin.java-gaming.org/9377a0b9345
Board class, paint/update method:
http://pastebin.java-gaming.org/377ab139549
Kille class, my character, contains the KeyListener:
http://pastebin.java-gaming.org/77ab3259948
There might be some leftover code in there from testing stuff out…