https://github.com/codingminecraft/MarioYoutube/blob/ce95234da9b6ff22268969c8c0446d4557ba6804/src/main/java/jade/KeyListener.java#L24 Fix these lines because there is a chance the key callback returns -1 which would throw an array index out of bounds error.