GPWiki.org
GPWiki.org
It is currently Mon May 20, 2013 2:33 pm

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Wed Apr 11, 2012 2:29 am 
Novice

Joined: Wed Apr 11, 2012 2:11 am
Posts: 6
Hello everyone, there might be alot like me out there but still how else am i going to get to your level.

Anyways i have been looking into Java Programming for a while and i can't seem to find a way of learning how to make games at least 2D games. There are some things out there but its just the code and it does not tell you how/why did you need that and how to use it. If there is ever a good tutorial i have always wanted to know how to continue from where i am but it just seems impossible.

If you can help please do.

Thank you,
-DaSnipeKid-


Top
 Profile  
 
PostPosted: Wed Apr 11, 2012 7:00 am 
Harmlessness does no harm
User avatar

Joined: Tue Sep 14, 2004 8:37 pm
Posts: 3807
Location: Ferriday, LA, US
Howdy! Welcome to the forums. :)

Java is a bit weird as far as game development, in that people have been developing games with it for close to two decades... yet the information regarding such endeavors is a bit scant. Most of what *is* out there is often OLD as well, which always leads to confusion when following a tutorial that may been written for Java 1.1 when you're attempting to write for Java 1.6+ (which doesn't work so well most times).

I believe Java is OK for what it is... but as far as a game development language, it seems to be one of the more "challenging" languages to use in game development. If you're fine with that, that's cool -- but I thought it might be worth a passing mention in case you are interested in options. :)

The very best Java game programming books I've seen are both ancient by today's standards, but are still at least somewhat applicable today. They may also still be available even today if you order from Amazon.com.

The first book is "Killer Game Programming in Java" by Andrew Davison: It's a monumental tome (easily over 1,000 pages) that starts you at ground level (but does assume some basic Java programming knowledge) and takes you pretty far.

The other is "Developing Games in Java" by David Brackeen: Like the above, assumes Java knowledge, and starts you from basic game development and runs you through a crash-course in hardcore techniques (it even will have you build a old-school software scanline renderer, similar to the renderer utiliized by Quake).

Those are, to be brutally honest, the only two *decent* resources I've come across for Java games. That said, KGPiJ is good in its own right... and DGiJ has lots of indispensable techniques that will carry over to other languages (I haven't written a Java application in several years, yet I still use the DGiJ book on occasion for conceptual/algorithmic reference). It's an uphill battle... but then again, that is natural for game development in general, regardless of the language used. :)

_________________
What most people don't understand about "enlightenment" is that it is not an end-goal; but where you find yourself just before taking a new "first step."


Top
 Profile  
 
PostPosted: Wed Apr 11, 2012 7:07 pm 
Bytewise

Joined: Sun Oct 16, 2011 3:09 pm
Posts: 277
Location: Here (where else?)
Hi,

DaSnipeKid wrote:
Anyways i have been looking into Java Programming for a while and i can't seem to find a way of learning how to make games at least 2D games. There are some things out there but its just the code and it does not tell you how/why did you need that and how to use it. If there is ever a good tutorial i have always wanted to know how to continue from where i am but it just seems impossible.
With 'normal' programming, you get input, do some calculations, output the answer, and you are finished.

In a game you do
Code:
world = new World();
for (;;) {
    world.display();
    inp = getUserInput();
    world.processInput(inp); // Update the world with what the user did
}
This is about as simple as you can have it.
For a game of hangman, 'world' is the hidden word you have to guess, the letters you have guessed so far, and how often you guessed wrong. 'display' shows the letters you have guessed right, and how close you are to losing. The user input gets a new letter from the user, and 'processInput' updates the 'world' with the new letter.
(for simplicity, I left out details like leaving the loop when you lose or win, but that should be simple to add).

A game like tetris also fits in this pattern. In that case, the user input can be empty (if you don't press any button).

There is nobody that says output must be done with

System.out.printf("text\n"); // Sorry, but being a C/C++ programmer, I use printf in Java as well :)

If you store positions of tetris blocks, you can also 'print' by drawing images at the right place.
If you loop above 20-30 times a second, you get fluent motion (if you move the position a small amount every iteration).

So there you have it. Add a 'global' world to the program, and loop repeatedly, getting input from the keyboard/mouse, and 'printing' by drawing graphics at the right place, and you have a game. :)

Happy exploring this world :)

_________________
My project: Messing about in FreeRCT, dev blog, and IRC #freerct at oftc.net


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group