Java programming (advice, suggestions needed).

Discussion about everything. New games, 3d math, development tips...
Post Reply
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Java programming (advice, suggestions needed).

Post by serengeor »

I started learning java few days ago and started building 2d games. The first was pong, now I'm creating brick breaker game.
You can download it from here:
breakout.jar - 21.5 Kb
The game might be buggy, it's far from finished.

I'm looking for advice on learning java programming (on whole, not just game programming) from some more experienced java developers. If you know some good articles/books please tell.
Also I'd like to ask what common mistakes do beginners make in java?
Working on game: Marrbles (Currently stopped).
kazymjir
Posts: 727
Joined: Sat Feb 20, 2010 4:05 pm
Location: Munich, Bayern

Re: Java programming (advice, suggestions needed).

Post by kazymjir »

Maybe try http://mindview.net/Books/TIJ4 .
Btw, I had somewhere very nice Java book about 2D graphics programming, if I find it I will let you know.


edit:
Got it, it's:

Computer Graphics for Java Programmers
Second Edition, Leen Ammeraal, Hogeschool Utrecht, Kang Zhang
University of Texas at Dallas

btw, check your forum mailbox :)
sudi
Posts: 1686
Joined: Fri Aug 26, 2005 8:38 pm

Re: Java programming (advice, suggestions needed).

Post by sudi »

Don't know where to click on that page to download....anyways
Well as learning the language...just keep coding. If you can programm any other language is nothing special really. And C++ is really not that far away from Java.
Concept wise its pretty much the same. But interfaces in java are somewhat special. You can do some crazy stuff with them which would take way more time in c++.

Code: Select all

 
interface myinterface {
        public void dostuff();
}
 
public class Test {
        
        public int i;
        
        public static void main(String[] args) {
                
                Test t = new Test();
                t.run();
        }
        
        void run() {
                i = 5;
                func(new myinterface() {
 
                        @Override
                        public void dostuff() {
                                System.out.println("DATA: "+Test.this.i);
                        }
                        
                });
        }
        
        public void func(myinterface i) {
                i.dostuff();
        }
 
}
 
But you probably knew that already. And Generics are basicly templates as you know them from c++.

Edit: Oh and threading is a breeze in java :D
Besides you should take a look at all the java standard libs
We're programmers. Programmers are, in their hearts, architects, and the first thing they want to do when they get to a site is to bulldoze the place flat and build something grand. We're not excited by renovation:tinkering,improving,planting flower beds.
kazymjir
Posts: 727
Joined: Sat Feb 20, 2010 4:05 pm
Location: Munich, Bayern

Re: Java programming (advice, suggestions needed).

Post by kazymjir »

Sudi wrote:Don't know where to click on that page to download....anyways
Download?! Piracy?! I am filling now report form to FBI and SOPA.
:D

This is nice and thick book, worth of investing these few dollars in buying one.
sudi
Posts: 1686
Joined: Fri Aug 26, 2005 8:38 pm

Re: Java programming (advice, suggestions needed).

Post by sudi »

kazymjir wrote:
Sudi wrote:Don't know where to click on that page to download....anyways
Download?! Piracy?! I am filling now report form to FBI and SOPA.
:D

This is nice and thick book, worth of investing these few dollars in buying one.
lol...talking about his game...
We're programmers. Programmers are, in their hearts, architects, and the first thing they want to do when they get to a site is to bulldoze the place flat and build something grand. We're not excited by renovation:tinkering,improving,planting flower beds.
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Re: Java programming (advice, suggestions needed).

Post by serengeor »

Thanks for all responses so far. If you have anything else to say, please :)

Oh, and yeah.. I forgot that most of you can't read lithuanian, so here's a new link with a bit updated game: http://dl.dropbox.com/u/29244943/breakout.jar

@Sudi: I haven't yet written interfaces myself so far. But they look similar to c++ abstract classes.
And this:

Code: Select all

void run() {
                i = 5;
                func(new myinterface() {
 
                        @Override
                        public void dostuff() {
                                System.out.println("DATA: "+Test.this.i);
                        }
                        
                });
        }
Looks strange a bit, though I understand what it does.

PS. I used this http://pages.cs.wisc.edu/~hasti/cs368/JavaTutorial/ so far, with a combination of samples I found around the net.
Working on game: Marrbles (Currently stopped).
kazymjir
Posts: 727
Joined: Sat Feb 20, 2010 4:05 pm
Location: Munich, Bayern

Re: Java programming (advice, suggestions needed).

Post by kazymjir »

Serengeor, sent!

About Lithuania, it remembers me a great poem of Adam Mickiewicz:
Lithuania, my country! You are as good health:
How much one should prize you, he only can tell
Who has lost you. Your beauty and splendour I view
And describe here today, for I long after you.
Post Reply