Jump to content
  • Advertisement
Sign in to follow this  

I want to make video games.

This topic is 2241 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post

Link to post
Share on other sites
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.

Share this post

Link to post
Share on other sites
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.

Share this post

Link to post
Share on other sites
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.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!