Getting Started

Hi everyone. I have been programming for more than a couple of years, but mostly on and off. I have never quite finished a project, except for a few dynamic web pages, and those weren’t coded in Java. I started using Java when I was in college way back in the day ov 1.1, and now 1.5 is out and I am completely lost. To add to that, all info I find is aimed mostly at application design instead of game design. I am interested in getting started with the nitty gritty Java game coding.

Most people have told me to buy books, but I seldom find books to be helpful, being as they often are expensive, and usually verge off into areas that have nothing to do with what I am doing. So, here it goes.

I have found a couple of problems:

How do I get a Simple window, or fullscreen in which I can code?
How do I make sure I can render images wherever I want?

I have the Java 1.5 SDK and docs, and that’s what I want to stick with for the moment. I am not interested in 3D games yet, as the engines to those are too complicated to get started. I basically wanna do a Tic Tac Toe app, most of the AI stuff I am VERY familiar with, it’s the graphical stuff that’s getting in the way.

Tutorials, or links to threads where this has already been answered would be appreciated. Yes I did search the forums for Getting started, and Making a Window and such, but no luck. Maybe I should RTFM a bit more, but I was wondering if anyone had already invender the wheel before I started with the stonecutting.

Thanks in advance.

  • Carlos

Here is a link to a tutorial on how to make a space invaders game:

http://www.planetalia.com/cursos/index.jsp

I am working on a board game, so it is not even in the same genre as this tutorial, but I found it incredibly useful for the basics on getting started.

Hope it helps. :wink:

Typed in, so watch for typos


JFrame window = new JFrame();
DisplayMode displayMode = new DisplayMode(800, 600, 16, 75);
GraphicsEnvironment environment = GraphicsEnvironment.getLocalGraphicsEnvironment();
GraphicsDevice device = environment.getDefaultScreenDevice();
device.setFullScreenWindow(window);
device.setDisplayMode(displayMode);


Graphics g = getGraphics();
or
Graphics2D = (Graphics2D)getGraphics();

The first code snippit is deliberately taken from David Brackeen’s ‘Developing Games in Java’. Books can save a lot of time…but it has to be the right book

Alan :wink:

You could give my tutorial a lookin over too:
http://www.gamelizard.com/JavaGameProgrammingPresentation.htm
The link at the top gives the source. Play with that and you should find your question answered. It can run the same game in Applets, windowed Frames, and fullscreen Frames in Java2D.