Java programming (advice, suggestions needed).

Discussion about everything. New games, 3d math, development tips...

Java programming (advice, suggestions needed).

Postby serengeor » Thu Feb 23, 2012 10:02 pm

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).
User avatar
serengeor
 
Posts: 1695
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Re: Java programming (advice, suggestions needed).

Postby kazymjir » Thu Feb 23, 2012 10:29 pm

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 :)
Warning: Unknown: failed to open stream: No such file or directory in Unknown on line 0
kazymjir
 
Posts: 669
Joined: Sat Feb 20, 2010 4:05 pm
Location: Poland

Re: Java programming (advice, suggestions needed).

Postby Sudi » Thu Feb 23, 2012 10:36 pm

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++.

cpp 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.
User avatar
Sudi
 
Posts: 1600
Joined: Fri Aug 26, 2005 8:38 pm

Re: Java programming (advice, suggestions needed).

Postby kazymjir » Thu Feb 23, 2012 10:58 pm

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.
Warning: Unknown: failed to open stream: No such file or directory in Unknown on line 0
kazymjir
 
Posts: 669
Joined: Sat Feb 20, 2010 4:05 pm
Location: Poland

Re: Java programming (advice, suggestions needed).

Postby Sudi » Thu Feb 23, 2012 11:00 pm

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.
User avatar
Sudi
 
Posts: 1600
Joined: Fri Aug 26, 2005 8:38 pm

Re: Java programming (advice, suggestions needed).

Postby serengeor » Thu Feb 23, 2012 11:01 pm

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:
cpp 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).
User avatar
serengeor
 
Posts: 1695
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Re: Java programming (advice, suggestions needed).

Postby kazymjir » Thu Feb 23, 2012 11:13 pm

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.
Warning: Unknown: failed to open stream: No such file or directory in Unknown on line 0
kazymjir
 
Posts: 669
Joined: Sat Feb 20, 2010 4:05 pm
Location: Poland


Return to Off-topic

Who is online

Users browsing this forum: No registered users and 1 guest