PONG Game Paddle Size

I have a pong game setup on an 8x8 matrix. The game works fine but Id like to have an option to change the size of the players paddle. Currently it only has one led, Id like to try 3 leds (one either side of player postion)

I havent a clue how to change this code, any advice would be very helpful.

void getPlayerPositions()
{
  p1_pos = analogRead(player_one);
  p1_pos = p1_pos/128;
  p2_pos = analogRead(player_two);
  p2_pos = p2_pos/128;  
}


void renderPlayerPaddles()
{
  getPlayerPositions();
  registerWrite(rows[p2_pos], cols[0]);
  delay(3);
  registerWrite(rows[8], cols[8]);
  delay(3);
  registerWrite(rows[p1_pos], cols[7]);  
  delay(3);
  registerWrite(rows[8], cols[8]);
  delay(3);
}
registerWrite(rows[p2_pos], cols[0]);
registerWrite(rows[p1_pos], cols[7]);

Please, think about it.
If "cols[0]" is one side of the screen and "cols [7]" is the other side, what do you think the "rows" parameters do?

AWOL:

registerWrite(rows[p2_pos], cols[0]);
registerWrite(rows[p1_pos], cols[7]);

Please, think about it.
If "cols[0]" is one side of the screen and "cols [7]" is the other side, what do you think the "rows" parameters do?

Thanks for the reply.
So can I change it to?:

registerWrite(rows[3][p2_pos], cols[0]);
registerWrite(rows[3][p1_pos], cols[7]);

Surely the [p*_pos] is detailing how many rows are used. Adding the [3] wont fix it will it?
I think I need to add a command which says;
add an extra row to the top and bottom of [p*_pos]?

Adding the [3] wont fix it will it?

Quite correct, and the compiler will complain.

If registerWrite(rows[p2_pos], cols[0]);
draws a one pixel paddle, how about

registerWrite(rows[p2_pos -1], cols[0]);
registerWrite(rows[p2_pos], cols[0]);
registerWrite(rows[p2_pos+1], cols[0]);

(with, of course, some code to ensure you don't go out of arrays bounds with the +/- indices)

Note that if you increase the width of the paddle, you should restrict the range of possible positions so that the edge of paddle doesn't go off the screen. (This would also address the clipping issue that AWOL refers to.)

PeterH:
Note that if you increase the width of the paddle, you should restrict the range of possible positions so that the edge of paddle doesn't go off the screen. (This would also address the clipping issue that AWOL refers to.)

You'll also want to change the collision detection code so that you can tell when the ball hits the ends of the paddle.

If registerWrite(rows[p2_pos], cols[0]);
draws a one pixel paddle, how about

registerWrite(rows[p2_pos -1], cols[0]);
registerWrite(rows[p2_pos], cols[0]);
registerWrite(rows[p2_pos+1], cols[0]);

[/quote]

When I set a +1, what it does is prevent the paddle from going to the top (1 short) and will disappear off the bottom. These number are detailing the position of the paddle in relation to the 8x8 grid, its not detailing the actual size of the paddle.

I'm not sure I understand your question.
"p2_pos" defines the vertical position of the paddle (it is derived from a A/D reading divided by 128), so "p2_pos - 1" is the row above, and "p2_pos +1" is the row below.
It is up to you to write the tiny extra bit of code to ensure it doesn't go out of bounds.

AWOL:
It is up to you to write the tiny extra bit of code to ensure it doesn't go out of bounds.

That's where I get lost mate... I don't know what to change/add.
Any help would be fantastic.

PMKimpton:
When I set a +1, what it does is prevent the paddle from going to the top (1 short) and will disappear off the bottom. These number are detailing the position of the paddle in relation to the 8x8 grid, its not detailing the actual size of the paddle.

Ah - without inspecting the code, I had supposed that was the code that actually drew the paddle on the display (and perhaps others made that assumption too). In that case, the code to render the paddle must be in, or called within, registerWrite().

I've taken a look but cant see how/where. Any changes I make cause big issues. For now I'll leave it be.
The code I'm using is in a real mess. It will have to stay that way until I understand it better.
Thanks for the advice and help.

Looking at the code, this is where the paddle is drawn.