Can you just sit down and make a game?

I have been working in JavaScript and HTML5 for 3 months now, as part of an internship i am doing for a small company. I find that after 3 months of programming in JavaScript, that i know more about that scripting language than i did learning Java which i had been studying for close to 7 years (through college courses), so i suppose if there is any lesson that could be picked up it is as others in this thread have said (including Notch) the best way to learn programming is to program. I however feel the differences between the likes of JavaScript and Java. It seems to be easier to work in JavaScript for games development, that i suppose has a lot to do with my main area of struggle, the game loop. The internship will be done in a week from today so my next focus is the Java game i promised to make. Let me ask though, am i really better off using a library like Slick2d or LWJGL now as opposed to trying to create the most simplistic games? that is one reason why i can’t just sit down and start coding, because i know there are tools available to reduce the whole reinventing the wheel issue.

Well, if you don’t want to reinvent the wheel, go with LibGDX. But really, game loops aren’t that difficult, here’s an example of the one I use in my game library:


private void run() {
		frames = 0;
		int frameCounter = 0;

		final double frameTime = 1.0 / frameCap;

		long lastTime = Time.getTime();
		double unprocessed = 0;

		while (running && !Window.isWindowCloseRequested()) {
			boolean render = false;
			long startTime = Time.getTime();
			long passedTime = startTime - lastTime;
			lastTime = startTime;

			unprocessed += passedTime / (double) Time.SECOND;
			frameCounter += passedTime;

			while (unprocessed > frameTime) {
				render = true;
				unprocessed -= frameTime;

				if (Window.isWindowCloseRequested())
					stop();

				Time.setDelta(frameTime);
				update();

				if (frameCounter >= Time.SECOND) {
					if (debugMode) {
						System.out.println("FPS: " + frames);
					}
					currentFPS = frames;
					frames = 0;
					frameCounter = 0;
				}
			}
			if (render) {
				render();
				frames++;
			} else {
				try {
					Thread.sleep(1);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
			}
		}
		stop();
	}

I will take a look at the code more in depth later, i am actually in work at the moment. Thanks

Somebody probably mentioned this already, but Ludum Dare is coming up in a couple weeks, and it’s a great way to see what you’re capable of doing. Check it out: http://www.ludumdare.com/compo/

I’m doing LD this time, I’m really excited to see what I can create under all that pressure! I’ve been studying up and learning new algorithms/functions.

THAT guy understood it.