Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 14 of 14

Thread: 2D Game Programming

  1. #1
    Member
    Join Date
    Mar 2012
    Posts
    39
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default 2D Game Programming

    So I was a bit curious on your guys opinions,

    I wanna know if I should start learning LWJGL.

    Here is all my knowledge so far:
    I know beginner Java (Games don't need the advanced things(I learned from thenewboston))
    I have made some simple games, and am trying to make a TF2 demake. I would like to finish this, but I can barely gwt the images I made for it displayed.

    On this other community they suggested that I learn LWJGL and OpenGL right after I learn the basics in Java cause most game companies would use these engines in their games.

    i would like to hear some feed back.

    Thanks.


  2. #2
    Member
    Join Date
    Jun 2011
    Posts
    182
    My Mood
    Where
    Thanks
    15
    Thanked 8 Times in 8 Posts

    Default Re: 2D Game Programming

    I would recommend getting a fully functioning Java2D (built in AWT/Swing APIs) game going before jumping into LWJGL or even JME.

    If you're new to Java, and especially if you're new to programming in general, I would not recommend using straight up JOGL. Keep in mind it (and LWJGL to some degree) is 1-to-1 with its C counterpart, so it will look a lot different than the typical Java documentation/code you're used to.

    Game programming is very difficult and really shouldn't be a goto thing for beginners in any language. You should make sure you master Java syntax and GUI construction before attempting it.

  3. #3
    Member
    Join Date
    Mar 2012
    Posts
    39
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: 2D Game Programming

    Ok thanks!
    So I believe now I should ask school mates if they want something to do their homework which would be good practice with user interface?

  4. #4
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,424
    My Mood
    Hungover
    Thanks
    144
    Thanked 636 Times in 540 Posts

    Default Re: 2D Game Programming

    Quote Originally Posted by bgroenks96 View Post
    I would recommend getting a fully functioning Java2D (built in AWT/Swing APIs) game going before jumping into LWJGL or even JME.
    I agree with this.

    Quote Originally Posted by bgroenks96 View Post
    Game programming is very difficult and really shouldn't be a goto thing for beginners in any language. You should make sure you master Java syntax and GUI construction before attempting it.
    I know what you mean, but I do also think that programming a game can be a fantastic motivator to help beginners learn. The trick is to be realistic- start by programming a game that's played via the command line, don't start by trying to make the next minecraft.
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  5. #5
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,424
    My Mood
    Hungover
    Thanks
    144
    Thanked 636 Times in 540 Posts

    Default Re: 2D Game Programming

    Quote Originally Posted by Chillers View Post
    Ok thanks!
    So I believe now I should ask school mates if they want something to do their homework which would be good practice with user interface?
    I'm not exactly sure what you mean by this. But you should start out by learning basic Swing (how to show a gui, how to use layouts, etc), then move on to Java2D (doing basic custom painting), then start using event listeners and Swing Timers to do simple animations.
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  6. #6
    Member
    Join Date
    Mar 2012
    Posts
    39
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: 2D Game Programming

    Ok thanks!
    I meant that like I would have something which an actual person could use so sorry for the confusion.
    Also I know the Java Syntax (Like the things what aren't libraries).

  7. #7
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,424
    My Mood
    Hungover
    Thanks
    144
    Thanked 636 Times in 540 Posts

    Default Re: 2D Game Programming

    Quote Originally Posted by Chillers View Post
    Ok thanks!
    I meant that like I would have something which an actual person could use so sorry for the confusion.
    Also I know the Java Syntax (Like the things what aren't libraries).
    I would not worry about other people for the time being- focus on making a game that entertains you. Keep it simple. Get one simple game under your belt, then try a more complicated game.
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  8. #8
    Member
    Join Date
    Jun 2011
    Posts
    182
    My Mood
    Where
    Thanks
    15
    Thanked 8 Times in 8 Posts

    Default Re: 2D Game Programming

    Quote Originally Posted by KevinWorkman View Post

    I know what you mean, but I do also think that programming a game can be a fantastic motivator to help beginners learn. The trick is to be realistic- start by programming a game that's played via the command line, don't start by trying to make the next minecraft.
    I agree. All I meant was that there is no use in even trying to create a Java2D game if you barely are able to create a JFrame. There will be much less frustration in writing the engine if you good knowledge and at least some experience working with AWT/Swing (custom painting in particular).

  9. #9
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,424
    My Mood
    Hungover
    Thanks
    144
    Thanked 636 Times in 540 Posts

    Default Re: 2D Game Programming

    Quote Originally Posted by bgroenks96 View Post
    I agree. All I meant was that there is no use in even trying to create a Java2D game if you barely are able to create a JFrame. There will be much less frustration in writing the engine if you good knowledge and at least some experience working with AWT/Swing (custom painting in particular).
    Yeah, I can agree with that. Too many people approach programming thinking that they'll be making the next minecraft or angry birds within a week, just to be discouraged and quit when that turns out to be unreasonable. And that's really unfortunate, because if those people just took a more patient approach, they'd find that programming just for programming is fun by itself.
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  10. #10
    Member
    Join Date
    Mar 2012
    Posts
    39
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: 2D Game Programming

    Yeah I do like programing!
    I have been doing it for 2 months now in Java and Java is my first language so it was a bit hard to get the syntax.
    I know how to make a JFrame, but some game devloper said that he learned best when he learned the syntax then modded games.
    So I am going to mod the game Minecraft into a kingdom hearts type deal if you know what I mean.
    Anyways thanks, if you could, where did you learn Java?

  11. #11
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,424
    My Mood
    Hungover
    Thanks
    144
    Thanked 636 Times in 540 Posts

    Default Re: 2D Game Programming

    Quote Originally Posted by Chillers View Post
    Yeah I do like programing!
    I have been doing it for 2 months now in Java and Java is my first language so it was a bit hard to get the syntax.
    I know how to make a JFrame, but some game devloper said that he learned best when he learned the syntax then modded games.
    So I am going to mod the game Minecraft into a kingdom hearts type deal if you know what I mean.
    To be fair, I don't actually know how hard that is, so maybe I should just butt out. But I would think that's a very "top-down" approach, working on something that's complicated to understand the basics. I would instead take a "bottom-up" approach, working my way up from the very basics to the more complicated stuff. I understand the pros and cons of each, but I guess you should do whichever fits into your brain the best.

    Quote Originally Posted by Chillers View Post
    Anyways thanks, if you could, where did you learn Java?
    I learned it back in high school, when my favorite math teacher told me to take the new programming course he was offering. Then I went to college for computer science. But in between all of my "real" schooling, I mostly played around by making little games and programs that I thought were interesting.
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  12. #12
    Junior Member
    Join Date
    Jan 2012
    Posts
    18
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: 2D Game Programming

    I think you should write your own game engine. That way you will have full control of what you are doing, and you can make as many methods as you want and make it as simple as you want =)

    BTW, Make something else, TF2 demake was already taken by Notch =)

  13. #13
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,424
    My Mood
    Hungover
    Thanks
    144
    Thanked 636 Times in 540 Posts

    Default Re: 2D Game Programming

    Quote Originally Posted by Alex555 View Post
    I think you should write your own game engine. That way you will have full control of what you are doing, and you can make as many methods as you want and make it as simple as you want =)

    BTW, Make something else, TF2 demake was already taken by Notch =)
    Again, I strongly disagree with this advice. The OP expressed that he can barely get images to display, so I really don't think he should take on the huge challenge of creating an entire game library. Every new programmer writes terrible code at the beginning (how many times have you looked at code you wrote a year ago and thought "what was I thinking?"... I still do that). And that's fine, but that means your best case scenario is to end up with a poorly written library. The most likely scenario is that you'll end up frustrated and quit.

    Telling somebody who doesn't know how to display images to learn by making a game library is like telling somebody who doesn't know how to drive to learn by building a car.

    OP, I think you statement that games don't require any advanced knowledge is a bit misleading. Even simple games like pong will involve some advanced topics such as animation, threading (or, better yet, Swing Timers), basic collision detection and physics, a game flow (title screen, game, end screen), pausing, etc... And a game engine has to support all of that, but in a generic way that would work with any game.

    In short, start small. Write pong. Don't try doing a remake of a more advanced game until you can do the simple stuff. On that note, why does everybody want to make a remake? Why not come up with your own new idea?
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  14. #14
    Member
    Join Date
    Mar 2012
    Posts
    39
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: 2D Game Programming

    I am able to do animations for the art thing I made for this demake. I do learn quickly -_-
    I think learning how to make a game on my own does help out a lot because I learn everything right there and then. Also I have a book which is explaining things how to do, but I ain't following the main game it is going for though.

Similar Threads

  1. Programming AI for simple game?
    By YouGoLast in forum Java Theory & Questions
    Replies: 3
    Last Post: September 27th, 2024, 02:33 AM
  2. 2D Game Programming
    By Chillers in forum Java Theory & Questions
    Replies: 8
    Last Post: April 6th, 2012, 10:14 PM
  3. Game Programming Question?
    By toofast88 in forum Android Development
    Replies: 1
    Last Post: March 21st, 2012, 07:34 AM
  4. Java Programming - Dice Game Help!
    By blackvelvet in forum What's Wrong With My Code?
    Replies: 3
    Last Post: March 19th, 2012, 11:47 AM
  5. Programming a Card Game (noob questions)
    By Taliesin in forum Java Theory & Questions
    Replies: 17
    Last Post: August 31st, 2011, 12:49 PM