Entering LD21…But I Need Some Java Advice!

Posted by (twitter: @jonnopon1)
August 6th, 2011 11:43 am

Hi, my name is Jonno.

I’ve been self-teaching Java for a few months now, after a few years of self-teaching code in one language or another,  and I have decided to use LD21 as a good bit of motivation to push myself into simple game development in the language. I’ve had a passion for gaming since I was young and have always had a back-of-the-mind plan to write games.

I’ve come to the point where I can write applications in Java with confidence, implementing drawing methods and the Swing API to create a good event-driven GUI app.

My only problem right now is animation and timed events (like game loops, for example). I have read that in Java, Swing Timers do not work so well on Microsoft’s Windows Operating Systems…so I was wondering what other methods are available for gaming. I have a small example application that uses a method to define the game loop, which performs all the actions that would normally happen with a timer tick, but it’s not very clear in its implementation and I’ve so far failed to replicate its function.

So, can anyone help me out?

As a side-note, if I’m not supposed to be posting anything at this time (seeing as there’s no category for LD21 yet), I apologise.

– Jonno

4 Responses to “Entering LD21…But I Need Some Java Advice!”

  1. RandomM00 says:

    I don’t use Java usually, but when I tried writing games with it the best way to do it was with a specialised library like LWJGL.

  2. ghillieLEAD says:

    Games are not like a normal program. Games are weird. If you don’t yet understand the basics of creating a game, like how a game loop works, you need to do a little reading if you are going to be successful. My advice would be taking a look at these two free books:


  3. jonnopon3000 says:

    I guess I forgot to mention that I’ve written games before xD
    I program in VB for college (I know, VB :/), and as soon as I could I started taking the work home to write games. I even released one to friends a little while back.
    I’ve also been playing and studying games since I was very young; I fully understand the workings and concept. I even make it a habit nowadays of seeing game mechanics and working out how they’d be done in theory.

    The only trouble I’m having currently is specifically the making of a game loop in Java without using a timer.

    I will check out those books though, thanks much =]

    Using a dedicated games library for Java is a good option, @RandomMOO, but I don’t have time to learn the proper use of a gaming API before LD21. I’m planning on moving into LWJGL as soon as I feel comfortable with writing games in ‘pure’ Java.

  4. RandomM00 says:

    Depending on how much practice you’ve had, it might be possible to get started with a new library within 12 days, if you go for a high level one. I’ve switched compiler and main library in the last couple of days, but I’m still planning to compete with the new tools (from HaXe to Flex and Flixel).

Leave a Reply

You must be logged in to post a comment.

[cache: storing page]