Hey! I'm new!

Hey Everyone,
I just joined the communite after being pointed here from New Dawn Software and thought I was would introduce myself. I’m a high school student in westren Canada and just started programming in Java a few weeks back. I was previous experince in other languages so I think I’m making acceptable progression.
I’m hoping that I can be an active member of the forums here and be able to learn something while doing it. I have several years of experince with communites like this, so I feel that I might be an asset as well.
Could some please review my first attempt at a game? It is called Titan Strife and can be found at http://java.davidrg.com/. I haven’t worked on it since the start of Febuary and I now know Swing and data structures (plus a better overall understanding). Feel free to ask for the souce.
I’ve already downloaded the source of a few Java games and I’m hoping I can learn something from them. I think that I’m at that stage that I need to mix in reading source with reading my book. Speaking of the books I’ve read, I firsted started out with Just Java 1.1 Third Edition (Old but I’m glad I read it). It was for “experince programmers” and the more advanced topics at the back were a bit out dated so I went out and baught another book called SAMS Teach YourSelf Java 2 in 24 Days Fouth Edition (Beginning - Intermediate level). I really like how it explains Swing in this book, it is very efficent. (I also like the exam questions at the end of each chapter).
Anyhow, I think I’ve talked long enough. Please feel free to e-mail me tips and/or suggestions at cody.somerville@gmail.com

Thanks and hope to hear from someone soon!

Later,

~Me

I am refusing to run 1.5 until all problems have been sorted from it as 1.4.2_04 seems solid enough for my needs. So would you mind recompiling your game for 1.4?

Id love to play it, its just that i can’t…

DP

I tried before and IIRC, I don’t think it worked. Just a second, I’ll go try again…

Alrighty, I attempted to compile it by doing:

javac -source 1.4 titan.java

And I got tons of errors. Here is an excerpt.

titan.java:849: incompatible types
found : int
required: java.lang.Integer
return rand.nextInt(3 + 1);
^
titan.java:858: incompatible types
found : int
required: java.lang.Integer
return temp1;
^
titan.java:865: incompatible types
found : int
required: java.lang.Integer
return temp2;
^
titan.java:869: incompatible types
found : int
required: java.lang.Integer
return 0;
^
Note: titan.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
7 errors

Fun fun, eh? I’ll be sure to see if I can fix it up so people with 1.4 can run it. I know that most people use 1.4 so it’ll be good for me too.

Sorry!!

Later,

~Me

Just don’t use Integers everywhere, use int types instead. Looks like you’re using Integers as though they’re interchangable with ints (as return values etc). This will probably impact on your perfomance in a big way for a start as all the boxing/unboxing is hidden by the 1.5 jdk. I’m not too sure how it handles assignment seeing as the base Integer class is immutable but i presume it does nasty things like create new objects constantly every time you perform an Integer/int type operation.

D.

I’ll see what I can do :slight_smile:

I can’t believe how fast you people reply. This forum is very very active.

Later,

~Me