Results 1 to 5 of 5
  1. #1
    ccrone99 is offline Member
    Join Date
    May 2014
    Posts
    3
    Rep Power
    0

    Default Couting Scoreboard

    I need to make a scoreboard that can count how many times a ball hits a moving platform in pong and have no clue how to approach this. Help Please any answer is helpful

  2. #2
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    4,036
    Rep Power
    6

    Default Re: Couting Scoreboard

    Do you just need to make a score board or the Pong game too? The game requires graphics.
    The scoreboard could probably be done with text areas and fonts. But you need to make an attempt yourself
    possibly with the help of a classmate or professor.

    Regards,
    Jim
    The JavaTM Tutorials | SSCCE | Java Naming Conventions
    Poor planning on your part does not constitute an emergency on my part

  3. #3
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,902
    Rep Power
    25

    Default Re: Couting Scoreboard

    a scoreboard that can count how many times
    A "scoreboard" could display the value of a variable in a component like a JLabel
    the counting would require a variable and code to change its value
    If you don't understand my response, don't ignore it, ask a question.

  4. #4
    ccrone99 is offline Member
    Join Date
    May 2014
    Posts
    3
    Rep Power
    0

    Default Re: Couting Scoreboard

    Quote Originally Posted by jim829 View Post
    Do you just need to make a score board or the Pong game too? The game requires graphics.
    The scoreboard could probably be done with text areas and fonts. But you need to make an attempt yourself
    possibly with the help of a classmate or professor.

    Regards,
    Jim
    I already have the game figured out. But our teacher doesn't really teach us so we have to self learn and I don't know how to make the score board count every time the ball collides with the paddle. Would you mind helping?

  5. #5
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    4,036
    Rep Power
    6

    Default Re: Couting Scoreboard

    I already have the game figured out. But our teacher doesn't really teach us so we have to self learn and I don't know how to make the score board count every time the ball collides with the paddle. Would you mind helping?
    Well, in my opinion you have done the hard part. Since the ball has to bounce off the paddle you clearly must know when that happens (since you need to programmatically change the direction of the ball). So you could just create another JPanel and then use something like drawString to draw the hits. You could even create a nice border around it. If two people are playing then its the same, you still must know which paddle hit the ball and thus you can increment the appropriate counter.

    Regards,
    Jim
    The JavaTM Tutorials | SSCCE | Java Naming Conventions
    Poor planning on your part does not constitute an emergency on my part

Similar Threads

  1. Help with Intro Java class: How to make scoreboard
    By tdenning in forum New To Java
    Replies: 7
    Last Post: 11-18-2013, 03:34 AM
  2. Replies: 3
    Last Post: 03-19-2012, 06:17 PM
  3. vowel couting
    By aizen92 in forum New To Java
    Replies: 4
    Last Post: 01-12-2011, 10:41 PM

Tags for this Thread

Posting Permissions

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