Hey guys I'm new to these forums, as well as being relatively new to games programming with Java. I've done a introductory course at University on Java and I'm super keen to get neck deep in some serious games coding! So far I've just been doing tutorials on-line based around clones of old arcade games like pong, pacman, tetris, etc. They have been fun but the challenge is kind of lost seeing as all the code for the games are provided for you! Although I have learned a lot within the Java 2D library and have become fairly confident in OOP design and implementation.

Here is what I propose to anyone with any spare time and an interest in helping a new enthusiastic coder.

I need a problem to work on, that is relatively basic yet still challenging. The idea being I will post all my progress in this thread and everyone can offer suggestions or give 'hints' to the problems that I may face. The problem doesn't have to be huge, maybe even something as simple as move a sprite with the keyboard and shoot at a target, that sort of thing.

I may be going out on a limb here, but I know there are some seriously talented programmers on these forums! I see this as a awesome learning experience.

You're in luck! These tutorials are the best around. However, the code is in C++ but you can find the LWJGL ports over here.

However, if you are confident enough that you don't need someone's else code, you can very easily "port" the C++ code yourself. Since LWJGL copies almost all functions exactly, it is safe to assume all functions you see that start with 'gl' are almost exactly the same as in LWJGL. Only one exception, function calls starting with 'glut' is just the windowing API. In LWJGL, that's simply your Display class.

You're in luck! These tutorials are the best around. However, the code is in C++ but you can find the LWJGL ports over here.

However, if you are confident enough that you don't need someone's else code, you can very easily "port" the C++ code yourself. Since LWJGL copies almost all functions exactly, it is safe to assume all functions you see that start with 'gl' are almost exactly the same as in LWJGL. Only one exception, function calls starting with 'glut' is just the windowing API. In LWJGL, that's simply your Display class.

@Jimmt - Thanks for the suggestions man! I've been kind of working on a little project I'll talk more about it below

@pjt33 - That sounds like a very good plan, why didn't I think of that!? haha, thanks man.

So I jumped the gun a little and have been working on a bit of a project for the last few days, based of a few tutorials laying around online. However I'm stuck!

I'm trying to implement a "point and shoot at mouse", type of function, and so far I have been able to get the angle and position of the mouse on mouse clicks. The ship is at the bottom of the screen shooting upwards, so I only use 180 degrees in the equation.

But I'm stumped as to how to fire at that position?

This is how I'm calculating the angle and position of the mouse currently.

Math.atan2 returns an angle in radians, not degrees so leave it as a double Multiplying an angle by 60 (or anything) makes no sense really Also, negative degrees/radians is definitely not the same as positive degrees/radians.

That's not true. Multiplying by 60 and then truncating is an effective way to quantise, which is necessary if you use prerendered graphics in N rotations or convenient if you use lookup tables for trig.

That's not true. Multiplying by 60 and then truncating is an effective way to quantise, which is necessary if you use prerendered graphics in N rotations or convenient if you use lookup tables for trig.

"entity.equals(alien)" <== that checks against only 1 instance of alien. If you want to check if an Entity is an instance of Alien, you would want: "if(entity instanceof Alien)" or whatever your Alien class is called.

Hi guys, still been working away at my little Java 2D project and have had a million ideas for a more in depth game. I can finally see how it's possible to build games from my own imagination now, which is exciting!

Like you guys suggested I'm going to start becoming familiar with OpenGL and the JLWGL.

I'm under the impression that the only way to use the JLWGL is through Slick2D?

I'm a little confused, are JLWGL and Slick2D just 2 different libraries? How do they work together?

If I wanted to user the JLWGL and Slick2D for my next project, where should I start? ( where/how to learn ).

Sweet screenshot! How did you do that deterioration of the shields effect?

Concerning Slick2D, it's a wrapper over LWJGL. It has an API very similar to Java2D but it uses LWJGL underneath. It's mainly for people who want to make games with full hardware acceleration but don't want to get into the specifics of OpenGL.

Sweet screenshot! How did you do that deterioration of the shields effect?

Concerning Slick2D, it's a wrapper over LWJGL. It has an API very similar to Java2D but it uses LWJGL underneath. It's mainly for people who want to make games with full hardware acceleration but don't want to get into the specifics of OpenGL.

Thanks man! For the deterioration effect I just had 4 different sprites loaded into an array, (no damage, little damage, little more damage, and really damaged). Then depending on the "health" of the shields an appropriate sprite was displayed.

I'd also suggest upgrading to the latest LWJGL since Slick ships with an older version.

Sweet, thanks for the heads up! I'm really liking Slick so far, it makes everything so easy! Let's you fully concentrate on the awesome game you want to make, without having to worry about to many technical limitations.

java-gaming.org 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‑gaming.org