Results 1 to 9 of 9
Like Tree1Likes
  • 1 Post By SurfMan

Thread: Gameplay Programming

  1. #1
    ian_cox is offline Member
    Join Date
    Nov 2016
    Posts
    10
    Rep Power
    0

    Default Gameplay Programming

    What kind of concepts do you need to know to program games?

  2. #2
    SurfMan's Avatar
    SurfMan is offline Godlike
    Join Date
    Nov 2012
    Location
    The Netherlands
    Posts
    1,991
    Rep Power
    8

    Default Re: Gameplay Programming

    Define "game".
    Norm likes this.
    "It's not fixed until you stop calling the problem weird and you understand what was wrong." - gimbal2 2013

  3. #3
    ian_cox is offline Member
    Join Date
    Nov 2016
    Posts
    10
    Rep Power
    0

    Default Re: Gameplay Programming

    A video game... Pong, snake, 2d platforms, Mario, etc.

  4. #4
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    13,541
    Rep Power
    26

    Default Re: Gameplay Programming

    How much Java do you currently know?
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  5. #5
    ian_cox is offline Member
    Join Date
    Nov 2016
    Posts
    10
    Rep Power
    0

    Default Re: Gameplay Programming

    I currently am taking an AP Computer Science class, and I'm 200 pages into a 600 page head first java book. The highest topics I know are polymorphism, inheritance, interfaces, constructers, and such. I haven't got into GUI's yet, and I'm definietly a beginner. I'm working everyday, and working hard toward learnin

  6. #6
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    13,541
    Rep Power
    26

    Default Re: Gameplay Programming

    OK, so complete the head first book, but start looking at one of the GUI frameworks, JavaFX or Swing. I'd say the former, if only because it's newer.
    That will give you an idea of how GUI event stuff works.

    For typical 2D gaming I would then look at a proper gaming framework.
    LibGDX is a reasonable one.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  7. #7
    ian_cox is offline Member
    Join Date
    Nov 2016
    Posts
    10
    Rep Power
    0

    Default Re: Gameplay Programming

    The head first book actually goes into GUI's haha. What type of math will game programming involve? Can you give an example?

  8. #8
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    6,226
    Rep Power
    13

    Default Re: Gameplay Programming

    As I said before (in a different post), trigonometry. Here is one that rotates a polygon around a pivot point.
    I wrote this a long time ago. It was relatively easy to derive using some basic trig identities. Since then I have been
    using the AffineTransform API as it is much better.

    Java Code:
             for (int j = 0; j < npoints; j++) {
                double x = xpnts[j];
                double y = ypnts[j];
                double xx = pivot.x + (x - pivot.x) * Math.cos(angle)
                        - (y - pivot.y) * Math.sin(angle);
                double yy = pivot.y + (x - pivot.x) * Math.sin(angle)
                        + (y - pivot.y) * Math.cos(angle);
                xpnts[j] = xx;
                ypnts[j] = yy;
            }
    Most of this type of stuff 2D and 3D rotation requires a lot of trig. Especially the latter. The good news is
    that it is mostly removed from the programmer (unless you want something special or are writing your own
    graphics library). If you program games that have collisions, or bounce around, you would need to calculate
    those too using trig. But since a good gaming library (imho) would help with those, you shouldn't have to worry
    about it. None the less, it is interesting to learn how that stuff works.

    Regards,
    Jim
    Last edited by jim829; 12-01-2016 at 06:52 PM.
    The JavaTM Tutorials | SSCCE | Java Naming Conventions
    Poor planning on your part does not constitute an emergency on my part

  9. #9
    ian_cox is offline Member
    Join Date
    Nov 2016
    Posts
    10
    Rep Power
    0

    Default Re: Gameplay Programming

    Thanks for all the help, Jim! I appreciate the in depth example. :)

Similar Threads

  1. Java programming or Android programming
    By sieciowiec in forum Android
    Replies: 1
    Last Post: 11-11-2014, 07:11 PM
  2. Replies: 3
    Last Post: 05-24-2014, 08:26 PM
  3. android programming vs game programming using java
    By vgoel38 in forum Forum Lobby
    Replies: 2
    Last Post: 09-08-2012, 12:11 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •