Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

Im now starting to create my own side scroller in java but before i start i want one question answeared.. I didn't find any answear for this on google so i will try my luck here..

Basicaly i think i've seen somewhere that when you create a game in java there is something you can extend your class with something like GamePanel or something or is this not true? Do you just use Jframe for your java games?

share|improve this question
    
Can we have more information about the game? For example, if you are using JOGL or Java3D for rendering, then those would have specific requirements for what you can draw to. If you're doing a 2D game and not using any libraries (i.e. overriding paintComponent()), then I guess pretty much any Swing component would work and a bunch of event listeners, but I wouldn't think that would be the most performant piece of code. –  PatrickB Aug 15 '11 at 3:54
    
Alright! At the moment i am not using any libraries for my game.. But if i should which library is good you think? –  TheCompBoy Aug 15 '11 at 6:26
add comment

1 Answer

up vote 2 down vote accepted

For a Java game that uses no libraries, I would suggest you extend the Canvas class and override the paint(Graphics) method. It is the most basic component you can use without a lot of overhead.

However, I strongly suggest you look into Slick or JMonkeyEngine. They both use LWJGL; the former is for 2D while the latter is for 2D and 3D.

To kill two birds with one stone, I would also suggest you look into Artemis, which is an awesome Entity System that works on top of Slick. The site contains some example games to help you get started.

share|improve this answer
1  
Note that the Slick2D forums are EXTREMELY active and helpful –  liamzebedee Dec 13 '11 at 1:12
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.