Page 1 of 2

Ping - A twist on Pong

Posted: Sun Jun 15, 2014 2:57 pm
by iPoisonxL
Hi! I made this little game as kind of a refresher of memory, I guess. Haven't programmed in a while so I set myself a challenge. Well after a day, here it is.

Ping!

It's like Pong, except you control the ball.

The controls are up arrow, and down arrow. They control the ball's height, and that's about it.

If you want to set yourself more/less of a challenge, just go in main.lua, and change paddle1's (left) and paddle2's (right) values, like:

thinkspeed - the time, in seconds, it takes to react to the ball's movement
speed - the vertical speed of the paddle
offset - the distance between the paddle and the wall

The rest isn't very important. But, you can change the ball's:
speed - vertical speed of the ball
xspeed - horizontal speed of the ball
size - width and height of the ball (always a square)

If you wish to use the "advanced" bouncing mechanism on the paddles, go enable gamemode2, which is the first line of love.load().

That's pretty much all, I think. Have a screenshot.
Image

Re: Ping - A twist on Pong

Posted: Sun Jun 15, 2014 5:42 pm
by Positive07
I liked this game a lot but I found that if you hold down since the beginning you can score multiple points in a row... doesn't work always but it happens

Re: Ping - A twist on Pong

Posted: Sun Jun 15, 2014 6:11 pm
by bdjnk
Needs more juciness ;)

Re: Ping - A twist on Pong

Posted: Sun Jun 15, 2014 9:43 pm
by iPoisonxL
Positive07 wrote:I liked this game a lot but I found that if you hold down since the beginning you can score multiple points in a row... doesn't work always but it happens
That's true, that's why you have the option to amp up the difficulty.

Re: Ping - A twist on Pong

Posted: Mon Jun 16, 2014 8:19 am
by SiENcE
Interesting, but i found a way how to just press down and i get points on every side each turn. The paddles have to be more dynamic or just make a two or three player game. One or two control the paddles and one controlls the ball.

Re: Ping - A twist on Pong

Posted: Mon Jun 16, 2014 2:27 pm
by SneakySnake
Please don't set the window title every frame! It can be a real performance killer on some systems.
On my system, it causes 100% cpu utilization and I can't even reach a decent FPS.

Re: Ping - A twist on Pong

Posted: Tue Jun 17, 2014 12:17 am
by iPoisonxL
SneakySnake wrote:Please don't set the window title every frame! It can be a real performance killer on some systems.
On my system, it causes 100% cpu utilization and I can't even reach a decent FPS.
OK, sorry about that. I will fix this.

EDIT: Fixed

Re: Ping - A twist on Pong

Posted: Tue Jun 17, 2014 12:53 am
by Jasoco
Really? I use it to set the title to add the FPS every frame and I get no slowdown at all.

Re: Ping - A twist on Pong

Posted: Wed Jun 18, 2014 11:30 pm
by iPoisonxL
Jasoco wrote:Really? I use it to set the title to add the FPS every frame and I get no slowdown at all.
I never heard about this problem

Re: Ping - A twist on Pong

Posted: Thu Jun 19, 2014 6:24 am
by Positive07
It's really OS dependent, so if you want to please them all make a key enable or disable just that...