You are not logged in.

#1 2011-01-23 16:47:58

M_ller
Member
Registered: 2010-04-17
Posts: 80
Website

ASCII Pyng Pong

(Pyng because it's developed in Python)

So today I was a little bored, and I made this little ping pong game in Python3 using Curses.

Basically it _really_ needs improvement. I need some advice regarding how to make AI able to loose (yep, it can't loose yet, so you can't win), and perhaps some edits to optimize it? Any feedback is welcome.

You can change the mapsize in defines.py, but take note that your terminal _has_ to be the same size or bigger, otherwise it will crash.

You can get the source code here:
https://sourceforge.net/projects/asciip … es/source/

Offline

#2 2011-01-23 19:48:56

tomd123
Developer
Registered: 2008-08-12
Posts: 565

Re: ASCII Pyng Pong

One suggestion is to either package all files into a tarball or even better, host it on github for easy access.

Offline

#3 2011-01-23 22:55:51

cmtptr
Member
Registered: 2008-09-01
Posts: 135

Re: ASCII Pyng Pong

Cool!

The AI is unable to lose because he can move at the same speed as the ball (and so can the player, who could theoretically also never lose).  The ball needs to move slightly faster than the paddles so that the player and the AI have to predict and move ahead of the ball.  This might be easier to accomplish with a bigger board, though.

Offline

#4 2011-01-24 06:04:05

M_ller
Member
Registered: 2010-04-17
Posts: 80
Website

Re: ASCII Pyng Pong

cmtptr: If I make the ball move faster, I'm pretty sure it will be hard for the player to catch up. Perhaps I should lower the speed of the player and AI instead?

Offline

#5 2011-01-27 03:01:45

cmtptr
Member
Registered: 2008-09-01
Posts: 135

Re: ASCII Pyng Pong

M_ller wrote:

cmtptr: If I make the ball move faster, I'm pretty sure it will be hard for the player to catch up. Perhaps I should lower the speed of the player and AI instead?

You might have to play around with the speeds a bit to get it to feel right.  I wasn't specifically saying that you should increase one or decrease the other, I'm just saying that whatever you do, the ball should move faster relative to the paddles.  Also, I would probably make the board either the standard 80x25 terminal size, or if you wanted to get really complicated (not sure how well this would work without fluid movement) you could try to make it resize to fit the terminal size, and speeds adjust appropriately.

Offline

Board footer

Powered by FluxBB