How many different ways of creating Pong in Java

This is a very curious question, which would inspire me based on the possible replys I might get. More influence I’d say though.

I’ve not been programming in Java for that long, I’ve found it harder to learn than most people but still I have faith. I know this may be a stupid question but on estimate, it doesnt have to be correct but explainations would be a bonus, how many ways could you program a basic game like pong?

Based on:

  1. Any size
  2. Has Score
  3. AI or 2 player (2 sets of keys) (I know this ones gunna add to it!)
  4. No title screen
  5. No third party library

Kinda make sense now?

My main interest is how someone would be ArrayList for objects and others using other methods, if you get me… I’ve asked this question before, on another forum though but it wasnt gaming based.

Like I say, answers to this question is going to help personally when the confidence level drops, we must all have that time some days where you feel you arnt learning as much!

Almost everything can be done in infinitely many ways. Pick one. Then, if you don’t like it, pick a different one.

There is so many ways the would be no point in listing them.

If you need a confidence boost, just think, someone, somewhere has done something just like it to achieve the same result.

So therefore don’t think of your code as wrong, just different.

Not sure what the question is really. I would think the basic 10 lines (or less) of pseudo code for basic Pong would be pretty much the same however it was actually implemented. Unless you count “draw bats, then draw ball” as different from “draw ball, then draw bats” :smiley:

From what I know so far, you can achieve making collision detection using the Rectangle class, and making a getBounds method with some if statements.

I’ve been learning ArrayLists for storing objects, so from my knowledge so far… I could create about 3 various versions of a simple pong from my ‘Based on’ list…

I was just looking for inspiration really, I hardly no anyone in real life who does this so it can be quiet tempting to ask these sort of questions n can get lonely (bless me!)

So to people where this topic doesnt make sense, what other ways could you program pong with various Java classes that could be used?? I’ve mentioned what I know above, I’m yet to study hashmaps as I see them a lot in games. <— I think this question is more approprate btw

I think using pong as an example is more better than lets say, chess… topic friendly straight to the point kinda thing…