reset password
Author Message
rabbott
Posts: 1649
Posted 23:15 Oct 19, 2018 |

This one beats the computer easily. The first image shows the score as 0 - 20. The player had just won the 21st point. But the system shuts down before showing the final score. 

Last edited by rabbott at 08:44 Oct 20, 2018.
rabbott
Posts: 1649
Posted 22:51 Oct 20, 2018 |

This version has a number of improvements, most notably the algorithm in DynamicInfo.getBlocks that identifies blocks. It's both simpler and significantly faster. It takes advantage of the fact that each block (computer paddle, puck, and user paddle) is a different color. The earlier algorithm just made use of the fact that they were all different from the background.

Also, the user paddle centers itself (more or less) after each hit. This eliminates long sequences of hits in which the paddle doesn't move.

Attachments:
Last edited by rabbott at 23:07 Oct 20, 2018.
rabbott
Posts: 1649
Posted 01:08 Oct 21, 2018 |

More edits.

Attachments:
Last edited by rabbott at 03:07 Oct 21, 2018.
jpatel77
Posts: 44
Posted 10:16 Oct 21, 2018 |
rabbott wrote:

This version has a number of improvements, most notably the algorithm in DynamicInfo.getBlocks that identifies blocks. It's both simpler and significantly faster. It takes advantage of the fact that each block (computer paddle, puck, and user paddle) is a different color. The earlier algorithm just made use of the fact that they were all different from the background.

Also, the user paddle centers itself (more or less) after each hit. This eliminates long sequences of hits in which the paddle doesn't move.

Yes, getBlocks is really optimized, that’s what I noticed first time I ran your code.

rabbott
Posts: 1649
Posted 10:18 Oct 21, 2018 |

A bit of code cleanup.

Attachments: