Jump to content

View more

Image of the Day

Boxes as reward for our ranking mode. ヾ(☆▽☆)
#indiedev #gamedev #gameart #screenshotsaturday https://t.co/ALF1InmM7K
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.

Sign up now

I want to make video games.

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 ZackyZack   Members   


Posted 27 July 2012 - 03:37 PM

So, I want to learn how to make video games. I do have knowledge of Java. You know, classes, methods, if statements, etc. But, I want to learn how to make the code be for a game. I've made some simple text applications, but I want to make a game. Not the-best-thing-in-the-world, just a simple game, like a Tetris Clone, or a platformer.

#2 SimonForsman   Members   


Posted 27 July 2012 - 04:27 PM

1) Open the java documentation.
2) Look up how to display images on screen, grab input using a KeyboardListener and get the current system time in milliseconds.
3) Write a fairly basic gameloop

timestep = 20; //20ms between each frame.
lastFrameTime = currentTime = GetTheSystemTimeinMilliseconds();
while (theGame.isRunning()) {
     currentTime = GetTheSystemTimeinMilliseconds();
     while (currentTime+timestep > lastFrameTime) {
          theGame.update(timeStep); //timeStep might be a property of theGame instead.

There you go, a basic game loop, all thats left to do is to insert proper Java methods for input, timing and rendering and create a game class that has an update method that brings the simulation one step forward each time its called.
I don't suffer from insanity, I'm enjoying every minute of it.
The voices in my head may not be real, but they have some good ideas!

#3 french_hustler   Members   


Posted 30 July 2012 - 11:25 AM

It seems that you want to focus on programming. If you already know the basics, then I would focus on getting as much practice in and really enforcing your software architecture skills. You should learn new paradigms and work on creating modular, reusable, simple, and clean code that works. Start small, and build on top of what you've previously created.

Search for things like the subscriber/observer patterns, MVC architecture, entity system architectures, and so on... This should point you in the right direction.

Try the "Thinking in Patterns with Java" by Bruce Eckel.

#4 !Null   Members   


Posted 30 July 2012 - 01:16 PM

you mentioned making a Tetris clone.

I was once in the same position as you and with Java I stared with Slick2d.

Here is the slick site

you will need slick2d and Light weight java game library (lwjgl)

There are many tutorials on there site but one for tetris is.

It sounds like you know all the basics as french_hustler says. But at first I would say follow tutorials and read what they say, and type it out (even if you don't understand whats going on)
after the game is working, try to work out bits of code you don't get, things like commenting out the code to see what's going on, or try changing code to mess about with it.

Once you understand what's going on, try to make your own really simple basic game. Slick is good because it handles the game loop for you and you don't have to worry too much about double buffering or flipping.

If you do decide to take this approach and want some help. I'm happy to assist if you have any questions.
/**********************He Who Dares, Wins**********************************\

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.