OpenGL Pong Help

This is a discussion on OpenGL Pong Help within the Game Programming forums, part of the General Programming Boards category; I'm currently attempting to make a 2d pong game with OpenGL, this is probably a logic issue, I've been working ...

  1. #1
    Absent Minded Programmer
    Join Date
    May 2005
    Posts
    964

    OpenGL Pong Help

    I'm currently attempting to make a 2d pong game with OpenGL, this is probably a logic issue, I've been working for about an hour now and I can't get a good result..

    I'm trying to make it do this logically

    glTranslatef(0.0f, y2, -8.5f);

    if y2 is greater than a certain amount (the point where the quad starts moving off the screen) make it so you cant move up on Y anymore

    and vice versa

    if y2 is less than a certain amount......


    I can figure out the certain amount on my own, i'm curious as to what to do when y2 actually gets there, can I disable the key that increases it? can I subtract whatever is above the certain amount, what to do what to do......

  2. #2
    Absent Minded Programmer
    Join Date
    May 2005
    Posts
    964
    I fixed it, just made it so it would -.01 (the movement ratio) every time you went over the certain number, so it looks like it stops you dead in your tracks, perfect

  3. #3
    ---
    Join Date
    May 2004
    Posts
    1,379
    ...No idea what you're saying

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. first opengl game, problems.
    By n3v in forum Game Programming
    Replies: 1
    Last Post: 07-11-2006, 09:22 PM
  2. OpenGL Window
    By Morgul in forum Game Programming
    Replies: 1
    Last Post: 05-15-2005, 01:34 PM
  3. OpenGL .dll vs video card dll
    By Silvercord in forum Game Programming
    Replies: 14
    Last Post: 02-12-2003, 07:57 PM
  4. PONG OpenGL so far...
    By SyntaxBubble in forum Game Programming
    Replies: 15
    Last Post: 03-31-2002, 11:52 AM
  5. opengl code not working
    By Unregistered in forum Windows Programming
    Replies: 4
    Last Post: 02-14-2002, 10:01 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21