class myClass2 extends myClass1: Same name Methods

Hi there,

I am trying to programm a Pong game with the shakebox.org tutorial.

public class BasicGame extends GLPong

I am still quite new to Java but I understand that BasicGame inherrits all methods and attributes from the GLPong class.

Both classes have an init method. In the BasicGame init-method I use the LWJGL Object Keyboard but Eclipse outputs “Unhandled exception type LWJGLException”. Now in the same class in a method called cleanup I use the Keyboard method destroy and that works fine.
Why?
What exact effect has the extention on the methods?

The aim of those tutorials was to keep the things simple.

By creating a BasicGame class that handle all the LWJGL initialization stuff, making a LWJGL game become easier : you just have to extends the BasicGame class. By the way, this class is only designed to create small games.

Oh, and it’s the GLPong class that extends BasicGame :wink:

public class GLPong extends BasicGame

About the keyboard problem, it’s a bit strange… What version of LWJGL are you using ? Have you tried to run the precompiled classes ?

Chman