Hi !
Featured games (85)
games approved by the League of Dukes
Games in Showcase (636)
Games in Android Showcase (178)
games submitted by our members
Games in WIP (688)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Supernewbie needs a gentle (but firm) first guiding hand to java.  (Read 3498 times)
0 Members and 1 Guest are viewing this topic.
Offline tackle

Senior Newbie

« Posted 2008-06-04 00:35:10 »

Hello there!

I'm new here, and I bring with me a couple of questions. I (somewhat) realize this may not be the absolute first place to start, but this community seems like the place I'd get the most out of, thus I hope I can be forgiven for some perhaps too basic questions. I suspect someone will advice me to a field trip with more basic tutorials and then have me come back.
I only have one main question for starters but I'll pester you more in this thread when I get to the next level.

- What IDE to use? I asked my busy programmer friend and he said Eclipse is the shit if you're going java. Said and done; I've got it downloaded and managed the hello world app tutorial (wow!).
When looking for more extremely basic tutorials though I always see other programs mentioned, like netbeans for example. Sure, java is java I guess, but I can't seem to find stuff that doesn't pertain to a specific IDE for some reason.

About me:

I'm mainly a music guy, but I program for fun. There's something with having a nice programmed structure with classes and object oriented programming that can be just as beautiful as a musical masterpiece.

When it comes to programming, I've done a little php/mysql; put together an intranet for a trucking company with some basic functions like admin adding a message and other users confirming they've read it. I've also dabbled with Actionscript 3.0.

My goal:

To be able to make something similarly advanced as for example this game mentioned above:
And if it'll take me 3 months or 3 years doesn't really matter.

In the end I'd like to be able to make a small playable game which I can push to the next level by making super awesome music for it.

Offline fletchergames

Senior Devvie

« Reply #1 - Posted 2008-06-04 03:12:29 »

Basically, you need to buy some books.  I buy such books cheap on, and I have bought some as ebooks from and

First, you need some kind of introductory book about Java.  I don't have any suggestions about a specific  book because the ones I read were all written at least 8-10 years ago.

Sun's Java Tutorial is relatively effective for starting out, but will be much better off if you have a book of some kind as well.

Second, you need a book about programming games in Java.  I suggest you buy both "Developing Games in Java" and "Killer Game Programming in Java".  They are a few years old, but there don't seem to be any adequate replacements as of yet.  I'm planning to buy "Pro Java 6 3D Game Development: Java 3D, JOGL, JInput and JOAL APIs" as an ebook, but I think that book's a little bit more advanced and also less important.

I've tried figuring this stuff out on my own.  I figured out most of it, but there were alot of odd little things that made a big difference.  Those 2 books address those odditties.

Third, you need to start programming a bunch of games.  The best advice is to program some simple games first and then program some more complicated ones.  The key here is that you must practice.

Fourth, you will need to buy at least a couple of books about designing code.  "Code Complete" is a good one, and there's a 2nd edition now.  A book about design patterns will also be helpful.  Messing around with different design methodologies would be helpful, but less so than the other material.

If you want to be really serious about this, you will also need to buy alot of books about advanced Java topics and about game programming/design.  You need to complete the first 3 steps first, though.  The advanced topics are really only useful if you want to make a career out of this.  It's one of those "the more you know, the better off you are" kind of things.
Offline noblemaster

« JGO Spiffy Duke »

Medals: 25
Projects: 10

Age of Conquest makes your day!

« Reply #2 - Posted 2008-06-04 03:21:15 »

I agree with the books! Although, I advice not to read too many books but start programming early on!

Eclipse is fine!

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline kevglass

« JGO Spiffy Duke »

Medals: 272
Projects: 25
Exp: 18 years

Coder, Trainee Pixel Artist, Game Reviewer

« Reply #3 - Posted 2008-06-04 07:18:30 »

I'm an Eclipse fan also. However, I'm not a fan of books on technology, mostly because they're so out of date so quickly. Most of the Java games books I've seen do one of two things:

1) Focus mainly on pure Sun Java (i.e. Java2D), this is hardly scratching the surface of the wonderfully rich technology set available.

2) Provide way too simple examples which focus on software development rather than game development.

There are a lot of online resources for general game development and 90% of those work perfectly well if you choose to use Java. Your best bet is prototype as many games as possible first to get a feel for what works for you. Start simple but build up quickly to keep it interesting.

Once you're a bit more comfortable theres a lot to be said for finishing a game (I hope to one day Wink), it teaches you more in one sitting than 10 prototypes - but you need to have done those prototypes to have a clue how to finish.

Finally, keep showing your work to others and taking feedback! Apart from anything else, I think we all like to see what everyone else is doing.


PS. Oh, and I suppose JavaGaming is always here to help Smiley

Offline tackle

Senior Newbie

« Reply #4 - Posted 2008-06-04 08:45:33 »

Thanks for the answers.

I might seem like the guy wanting to make a mmorpg in a year as a first game, not wanting to listen; but I kind of intend to sort it out without having to buy books. Basically, I have very little to no budget, and I don't except it to take me somewhere a budget would be needed. I'm not aiming at a professional level.
I do have a friend though who's programming and he's got a lot of books, so I can always check what he has and see if I can borrow a few.
Furthermore what I forgot to mention in my first post is my strength and weaknesses; strength being I'm pretty good at grasping new concepts and finding information (I wish my job was to google), weakness being I'm not that good at math other than basic operations. Do you need a strong understanding of more advanced math to cope with game programming? I bet if you start involving 3d engines you probably would...

What I feel like I really need the most right now is a tutorial going from total blank to maybe displaying something, like a square or line perhaps.
Or should I expect to work in a prompt enviroment for the first times of exercise?

I may seem reluctant to listen but I'm convinced there's tons of applicable tutorials. With php, mysql and actionscript it was pretty much a breeze to get over the starting bump. Am I perhaps expecting it to be too easy?

Offline fletchergames

Senior Devvie

« Reply #5 - Posted 2008-06-04 15:28:53 »

If you're not going to buy any books, you might try using a 2d game library like Slick.  There are other options available, and I'm sure you can find lists of them in other topics.

Using a 2d game library will mean that you don't have to mess with as many of the pedantic details of game programming.  On the other hand, you will have to mess around with figuring out the 2d game library itself, but this should be much easier.

You need a good grasp of basic algebra, but that should be sufficient math-wise.  You would benefit from a little physics knowledge, but you basically only need to know about acceleration and velocity, which you should be able to learn about from a game tutorial somewhere.  A knowledge of calculus is generally required for 3d games, but I don't think that's always the case any more.

Sun's Java Tutorial will tell you how to display a square, etc.  You need to look up the parts about AWT and Swing.  If you don't already know Java and aren't buying any books, you must read Sun's Java Tutorial.  There's really no way around it if you're going to program with Java, but it shouldn't take long.  The alternative would be to use Flash or Game Maker (which is a game making program, not a programming language), both of which would probably be easier but less powerful.  (Good luck creating a map editor with Game Maker!)

I'm sure there's other tutorials out there, but Sun's Java Tutorial is probably the best place to start.  I believe there's a tutorial about Slick on its website as well.
Offline tackle

Senior Newbie

« Reply #6 - Posted 2008-06-04 16:20:45 »

Yes, thank you. I'm starting it and it seems just what I need to get going!

Offline erikd

JGO Ninja

Medals: 16
Projects: 4
Exp: 14 years


« Reply #7 - Posted 2008-06-04 17:40:11 »

Coming from a music background myself, I can relate to a lot you're saying  Smiley.

If you're going for something like that Highnoon game, I'd guess your math skills are probably up for the task as I guess that game doesn't require much math.
Regarding IDE's, I use Eclipse myself but Netbeans would be an equally good choice.
I haven't used a book to learn the java language but mainly used the Sun java tutorial and everything I needed to read from the internet. I did read a general book about OOP (From Chaos to Classes iirc) to better understand the concepts, and I read Design Patterns in Java. I feel the latter is not really necessary if you really get the concepts behind OOP though and if you're working alone on your games.

I agree with other posters that it's a good thing to get started to code early and not get overwhelmed early by books. All knowledge you need is available on the net somewhere, and you can always ask questions here.

Play with (for example Slick) tutorials, make yourself comfortable with the language and tools/libs you're using.
After all, getting some results is fun (even if they might require rewriting later), reading books is not  Cheesy Wink

Offline Simeon

Senior Newbie

« Reply #8 - Posted 2008-06-04 17:58:49 »

Yeah, I'd use online resources too if I were in your position: there's enough available online and getting a book isn't really that useful.

As far as maths are concerned: if you want to write physics or funky 3D stuff, you'll need it.. but, considering the game you're aiming for, I wouldn't worry too much about it. Once you've got a game loop running and managed to draw things on the screen, you're pretty much there.

I use Eclipse but I've heard good things about Netbeans too.
Offline tackle

Senior Newbie

« Reply #9 - Posted 2008-06-04 20:20:42 »

Ok so now I wonder if anyone else does NOT understand the frickin remainder operator %

I grasp about 30% of what it's actually doing, and 0% of when you would ever use it.

Also, I cannot understand what an interface is, as mentioned in the java tutorial. I understand that it's a group of related methods/functions, but I view it as redundant. What can I do with an interface that I can't without?

Is it ok if I just toss out these beginner questions here as they pop up?

Edit: ok I see now that interface is something bigger than I anticipated, will be understood in near future!

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Bolo

Junior Newbie

« Reply #10 - Posted 2008-06-04 20:37:20 »

The remainder/modulus function simply gives the remainder from a division.  10%9 = 1, since 9 goes into 10 just once, with a remainder of one.  10%8 = 2, 10%7 = 3, etc.  10%5 = 0, since 5 goes into ten exactly twice and there is no remainder.

Here's a page that outlines the uses of the modulus function:

I've mostly used it in a counting fashion.  For example, if you have a loop that iterates several thousand times and you want something to happen every 1000 iterations, you can use "if (i%1000==0) {perform some action;}"  Every 1000 iterations, the action will be executed.  More advanced examples are at the link above.
Offline tackle

Senior Newbie

« Reply #11 - Posted 2008-06-04 20:43:55 »

Thanks, that was super fast and 100% understandable for me!

Offline Wildern

Junior Devvie

« Reply #12 - Posted 2008-06-05 01:50:11 »

I use the % operator in my sprite animation loops.
I have a global variable that is always counting up, let's call it "tick".
Each animation has a set number of frames, let's call that "n".
Then, the current frame of animation that I need to draw for any given sprite animation is tick%n.
Offline tackle

Senior Newbie

« Reply #13 - Posted 2008-06-05 11:46:03 »

Speaking of modulus/remainder.. as I'm reading through the sun java tutorial, I come to this section "regarding arbitrary number of arguments"

You will most commonly see varargs with the printing methods; for example, this printf method:

    public PrintStream printf(String format, Object... args)

allows you to print an arbitrary number of objects. It can be called like this:

    System.out.printf("%s: %d, %s%n", name, idnum, address);

I'll admit I don't understand at all what they're implying here. Are we talking about modulus at all or is this something else? If so, do you know what they mean?

Offline Simeon

Senior Newbie

« Reply #14 - Posted 2008-06-05 12:04:35 »

Also, I cannot understand what an interface is, as mentioned in the java tutorial. I understand that it's a group of related methods/functions, but I view it as redundant. What can I do with an interface that I can't without?

Basically, an interface is a collection of methods that the implementing class must implement. It can be used to create abstraction in your application. For exampe, suppose you have an interface Moveable with the method move(). Any object in your game (like a Chair, a Table) could implement that interface and give a definition for the method move().

Then, you could write a method like this, for the player:

public void push(Moveable moveable) {
  // moveable.move() can be used to move the object

Basically, if you call the method push for the player with any Moveable object, you can let the player push that object. It could be a chair or a table but that doesn't matter to the push method: all that matters is that the object can be moved by calling the move() method. The push method could activate the push animation and move the object at the same time.
Offline Simeon

Senior Newbie

« Reply #15 - Posted 2008-06-05 12:09:22 »

Speaking of modulus/remainder.. as I'm reading through the sun java tutorial, I come to this section "regarding arbitrary number of arguments"

I'll admit I don't understand at all what they're implying here. Are we talking about modulus at all or is this something else? If so, do you know what they mean?

This is not about modulus but it's about varargs.. the three dots allow you to call a method with a variable number of arguments. Suppose you were to write:

public void example(String... strings) {}

then you can call example like this:


but also:

example("Foo", "Bar");
example("Foo", "Bar", "More");
example("Foo", "Bar", "More", "Strings");
example(); // 0 is also allowed

The printf method they mentioned allows you to do that by giving it a String and any number of objects. The strings parameter can be used as an array of Strings.
Offline Herko_ter_Horst

Senior Newbie

Java games rock!

« Reply #16 - Posted 2008-06-05 15:25:50 »

Speaking of modulus/remainder.. as I'm reading through the sun java tutorial, I come to this section "regarding arbitrary number of arguments"

I'll admit I don't understand at all what they're implying here. Are we talking about modulus at all or is this something else? If so, do you know what they mean?
No, in this case the % sign isn't the modulus operator at all, but part of the "sprintf" syntax:

The sprintf syntax works really well with varargs feature because varargs allows you to specify values for the exact number of placeholders in the sprintf formatting string.
Offline tackle

Senior Newbie

« Reply #17 - Posted 2008-06-05 22:47:45 »

I'm trying to start looking at Slick.

I can't figure out where to start. Downloaded the zip, but I'd like to be able to somehow integrate this into Eclipse, and maybe run the demos I find in the folder scripts. They're .jnlp files, but throws an error :

BadFieldException[ Fältet <jnlp>codebase har ett ogiltigt värde: @codebase@,@codebase@]
   at com.sun.javaws.jnl.XMLUtils.getAttributeURL(Unknown Source)
   at com.sun.javaws.jnl.XMLUtils.getAttributeURL(Unknown Source)
   at com.sun.javaws.jnl.XMLFormat.parse(Unknown Source)
   at com.sun.javaws.jnl.LaunchDescFactory.buildDescriptor(Unknown Source)
   at com.sun.javaws.jnl.LaunchDescFactory.buildDescriptor(Unknown Source)
   at com.sun.javaws.jnl.LaunchDescFactory.buildDescriptor(Unknown Source)
   at com.sun.javaws.Main.launchApp(Unknown Source)
   at com.sun.javaws.Main.continueInSecureThread(Unknown Source)
   at com.sun.javaws.Main$ Source)
   at Source)

Considering Slick builds on LWJGL, do I need to download and integrate LWJGL into Eclipse somehow first? And considering that builds on OpenGL, do I need to do the same with that somehow?

Pages: [1]
  ignore  |  Print  
You cannot reply to this message, because it is very, very old.

Dwinin (76 views)
2015-11-07 13:29:08

Rems19 (82 views)
2015-10-31 01:36:56

Rems19 (82 views)
2015-10-31 01:32:37

williamwoles (108 views)
2015-10-23 10:42:59

williamwoles (94 views)
2015-10-23 10:42:45

Jervac_ (113 views)
2015-10-18 23:29:12

DarkCart (138 views)
2015-10-16 00:58:11

KaiHH (119 views)
2015-10-11 14:10:14

KaiHH (160 views)
2015-10-11 13:26:18

BurntPizza (174 views)
2015-10-08 03:11:46
Rendering resources
by Roquen
2015-11-13 14:37:59

Rendering resources
by Roquen
2015-11-13 14:36:58

Math: Resources
by Roquen
2015-10-22 07:46:10

Networking Resources
by Roquen
2015-10-16 07:12:30

Rendering resources
by Roquen
2015-10-15 07:40:48

Math: Inequality properties
by Roquen
2015-10-01 13:30:46

Math: Inequality properties
by Roquen
2015-09-30 16:06:05

HotSpot Options
by Roquen
2015-08-29 11:33:11 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!