Newbie Game Development Starting Point?

I’m not new to Java, I’ve been programming with it for a while now, but I have never understood the graphics portion of Java. I have created a few games using tutorials from youtube, but they quickly become copy & write. I’ve learned the basics of how to make a game, but what I have not learned is how to develop a game. I can always just go back to the videos and watch them, but I have never learned how to DEVELOP the game. So my question is, what is a good starting point in learning how to make a game (using image rasters, and pixel arrays), and basic game development concepts. I want to start from the bottom, where libraries don’t make it simple (excluding Java libraries), I want to know how it works so I can use libraries and know what they are doing behind the scenes. Thanks in advance…

(I have searched the forums, but none of the results are what I was looking for)

Are you looking for something made without external libraries? I can help, PM me your skype and i’ll message you.

Alright sent.

Start very small. Start smaller than you think would be interesting.

Can you create a little program that displays a ball in the middle of the frame? Here is a little tutorial on custom painting: http://docs.oracle.com/javase/tutorial/uiswing/painting/

When you get that working, can you animate the ball so it falls of the screen? Use a Swing Timer: https://docs.oracle.com/javase/tutorial/uiswing/misc/timer.html

When you get that working, can you make it so the ball bounces off the sides of the frame?

From there, you know enough to make Pong. Make Pong.

Once you have Pong, try adding stuff to it: can you add more realistic physics, or add weapons and powerups, or make it 4 player, or make the player control the ball instead?

Then move up to breakout or space invaders. Take small steps.

You might also consider trying out Processing: https://processing.org/

Shameless self-promotion: I’ve written a bunch of tutorials that go through basic game development available here: http://staticvoidgames.com/tutorials/

Just to let you know, if you want to really start “from the bottom” then you do have to use an external library like LWJGL or JOGL and use OpenGL. That’s the core graphics API that Swing is using under the hood.

Not saying you should, just letting you know.

Bwah? This is the first time I’ve heard that Swing uses OpenGL. Are you sure this is true?

I’m not sure a beginner should start out with LWJGL or JOGL. I’d argue that it’s better to start off with Java2D, or better yet Processing.

Of course, there are many ways to get started, so OP should try a few different approaches and see which they like best.

I’m shocked, Kevin, shocked.

But yes really: http://grepcode.com/search/?r=repository.grepcode.com$java$root&start=0&query=opengl&entity=type

It can also use the DirectX backend.

I’m suspicious of this. Those are all in the sun package, which is basically the elephant graveyard from the Lion King.

I don’t doubt that Java can interface with OpenGL, but saying that Swing is built on top of OpenGL seems wrong.

Because Swing is built on top of AWT, which is not built on top of OpenGL. It’s built on top of whatever native components the system offers. Telling AWT to create a checkbox is really just telling the OS to create a native checkbox. I guess that could be OpenGL, but that’s definitely not the same thing as saying Swing uses OpenGL code under the hood, because it doesn’t.

If I’m wrong I’d love to learn more about this, but google isn’t returning much.

Try printlning a Graphics object that you get from a swing component, it’ll be a [url=http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b27/sun/java2d/SunGraphics2D.java]SunGraphics2D[/url].

The swing components are specifically not built on top of AWT and native components, that was the whole point of swing. (and why people who wanted good native components made alternatives like SWT)

Bwah again?

All Swing components extend JComponent, which extends Component, which is AWT.

(For the pedantic, classes like JFrame extend Frame, which is AWT.)

Swing components are just a native blank component (AWT Component), and then Java2D is used to draw the actual component onto them. I’m not saying that creating a Swing JCheckBox is creating an AWT CheckBox, I’m saying that creating a Swing JCheckBox creates an AWT Component, and then a Swing JCheckBox is drawn on top of it.

Reading about it now, I see that AWT supports X Window System, OpenGL and DirectX renderers. I’m also reading about project Caciocavallo, which supposedly is working on an html renderer “to deploy existing Swing applications—without Java support—as ordinary web applications running on a web server” which is VERY exciting. Although I don’t see any up-to-date resources on it, so I’m not sure what the fate of that project is.

They extend Component for API compatibility, if that’s enough to say “they’re AWT” then sure, but I think it’s more useful to differentiate AWT components with native heavyweight peers backing them from swing components, which don’t, aside from the top levels such as JFrame.

For instance, if you create a JComponent and call getPeer() you get one of these: http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/8u40-b25/sun/awt/NullComponentPeer.java#NullComponentPeer

[quote]Implements the LightweightPeer interface for use in lightweight components that have no native window associated with them. This gets created by default in Component so that Component and Container can be directly extended to create useful components written entirely in java. These components must be hosted somewhere higher up in the component tree by a native container (such as a Frame). This implementation provides no useful semantics and serves only as a marker. One could provide alternative implementations in java that do something useful for some of the other peer interfaces to minimize the native code. This was renamed from java.awt.LightweightPeer (a horrible and confusing name) and moved from java.awt.Toolkit into sun.awt as a public class in its own file.
[/quote]
Also:

It uses OpenGL and DirectDraw for a long time (since Java 1.4), the Direct3D Java2D pipeline appears later, maybe in Java 1.6 update 10.