Sign in to follow this  
Spawn_Kcb

The Great Graphics Mystery.....

Recommended Posts

Spawn_Kcb    120

Hello All,

This is going to sound like a REALLY strange post but....

 

I am a professional C#/VB .NET developer, working with both desktop and web applications, who is looking to brush on up on his Java skills by writing an RPG.

 

Now I have had a look around, read some tutorials etc. and it all seems fairly straight forward (Building player objects, state machines, basic game loop logic etc.) however, is there somewhere I could look for a GOOD explanation of the big black box that is GRAPHICS. 

 

In my day job I don't really use graphics as such, or if I do they are simply static images for decorative purposes, so I have never really given it much thought. We where never taught about them in any real fashion at University either.

 

Basically at the moment I have a state machine machine with the various game state classes etc all ready to start testing and building up. I have a JFrame and a extended JPanel to draw on....but I have no idea how I join A to B.

 

As I said this may sound strange but I am just stumped. This doesn't have to a beginners level tutorial or anything just one with good code samples that show the principles behind the process.

 

Thanks for the help and apologies if I have put this in the wrong place.

 

Kevin

Share this post


Link to post
Share on other sites
krinosx    606

May I suggest a book?

Killer Java Game Programming: ( http://fivedots.coe.psu.ac.th/~ad/jg/ )

 

this book will help you to understand the basic concepts of java drawing, how to manage a game loop in java and will build your knowledge about Java programming step by step.

 

I am also a programmer, I live by codding for about 12 years now, and I still love the 'JKGP' book a lot. 

 

The most chapters are free on that site ( fivedots.coe.psu.ac.th ) so you can give it a try.

 

Hope it helps.

Share this post


Link to post
Share on other sites
kop0113    2453

Since you mentioned that you have been programming for a while the following might give you the clue you need.

 

Once you have your drawing frame or canvas prepared just iterate through all the objects in your game and call update / draw on them (passing in some sort of reference to the paint system). You then need to trigger another repaint (probably through some sort of Java timer). This is effectively then the game loop

 

In this same loop you do things like query key presses, set new positions for each game object based on gameplay etc...

Edited by Karsten_

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this