Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I've seen a schematic of a Pong like game made with digital circuits like counters and comparators.

Each player has a Y position controller. So and Y1 and Y2 register. Then the ball has an x and y position. The game logic is controller by comparators to detect events like reaching borders or within the paddle width range. So for example if you reach the left border and is within left paddle range then bounce the ball back right otherwise the left player loses.

In terms of drawing to the screen, again compare the screen pixel position to each of the two paddles and ball position. Drawing the score was a little more complex but your have a counter for each players score and that determines which lines to draw. So you OR together the output from many comparator logic to determine the pixel should be lit or not.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: