Jump to content
  • Advertisement
Sign in to follow this  
acematti

Java Game Engine

This topic is 4976 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, Im currently wanting to design and create my own little game engine in java that will display the games in a window(not applet). I know i will need to create methods that will paint the screen but i am unsure as to how I draw it to a buffer then to screen. I previously made a simple game engine using the windows GDI and from my experience I realised that the need for double buffering is required. I will have methods for things such as cleanup, initialization, drawing the game screen and also things like a game cycle. I have been looking on the net and can find some good tutorials about creating pong however these all refer to how it is done in an applet which is not really what i want.(Im not wanting to make pong BTW, I just looked at them so I could see how the drawing technique was done.) I can figure out that i think i need to use the paintComponent() method but i am unsure on how i would go about putting this in my own method that I can call when I want to draw the screen. Maybe I have got a little confused with my C++ and Java on how things have got drawn to screen?? Does anyone know of a good example on how to draw something double buffered to the screen in java? Any help would be much appreciated Thanks in advance Matt

Share this post


Link to post
Share on other sites
Advertisement
here (in pdf format) is an article that describes three ways of drawing to the screen in a java application. it also shows you how to obtain information about the graphical capabilites of your/each system, and with the jsdk you'll be able to make a fully functional system very easily. most likely you'll want the last one, FSEM, or fullscreen exclusive mode. you don't need a specific paint(Graphics g) method because you'll be getting the graphics context directly from the backbuffer, which means you can spread the paint calls around. just like in GDI, you have to flip the buffer at the end of your drawing calls. (the part in the article i'm paraphrasing begins on page 17) good luck.

cheers.

Share this post


Link to post
Share on other sites
Quote:
will display the games in a window(not applet)
For the most part, applet/window is the same thing. Conceptually differeny, different code but same result..

Essentially, you have to realise that they're fairly similar if not identical..

Jack

Share this post


Link to post
Share on other sites
What you could also do is take a look at how the JME engine does it. You will also have to decide on whether you are only going to use plain graphics or implement OpenGL and DirectX.

Share this post


Link to post
Share on other sites
Cheers for all the help,

Ill look into that pdf doc so posted asap.

Fullscreen does sound good. Ill have a good luck at it this weekend.


Thanks again


Matt.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
http://grexengine.com/sections/externalgames/

click articles and pay close attention to

'space invaders 101'

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!