90 likes | 182 Views
PONG GAME. Owais Ibrahim Akram Mohsin Murad. PONG GAME. InTRODUCTION. ONE OF THE BASIC ATTARI GAMES. THE PONG GAME CONSISTS OF A BALL RANDOMLY BOUNCING ON THE SCREEN. A PADDLE AT THE BASE ENABLES THE USER TO MAKE THE BALL BOUNCE BACK UP. PONG GAME. requirements.
E N D
PONG GAME Owais Ibrahim Akram Mohsin Murad
PONG GAME InTRODUCTION • ONE OF THE BASIC ATTARI GAMES. • THE PONG GAME CONSISTS OF A BALL RANDOMLY BOUNCING ON THE SCREEN. • A PADDLE AT THE BASE ENABLES THE USER TO MAKE THE BALL BOUNCE BACK UP.
PONG GAME requirements • MULTISYNC VGA MONITOR SUPPORTING 640X480 RESOLUTION. • XILINX SPARTAN-3 FPGA KIT. • TWO ONBOARD PUSH BUTTONS TO CONTROL PADDLE MOVEMENT. • 50MHZ OSCILLATOR. vga_h_sync , vga_v_sync , vga_R , vga_G , vga_B PUSH BUTTONS quadA , quadB
PONG GAME dRIVING The Vga monitor A VGA MONITOR REQUIRES 5 SIGNALS TO DISPLAY A PICTURE: • R,G & B (THE RED, GREEN AND BLUE SIGNALS). • HS & VS (THE HORIZONTAL AND VERTICAL SYNCRONIZATION).
PONG GAME MODULES USED • GENERATING R,G & B SIGNALS. • CLOCK DIVIDER. • VIDEO GENERATOR • DRAWING THE PADDLE • DRAWING THE BALL
PONG GAME DRAWING THE PADDLE • TWO ONBOARD PUSH BUTTONS FOR MOVING THE PADDLE LEFT OR RIGHT. • 50HZ CLOCK REQUIRED FOR SCANNING THE PUSH BUTTONS. • 6 CLOCK DIVIDER MODULES EACH DIVIDING THE CLOCK BY 10 (50MHZ/1000000HZ=50HZ). • IF quadA IS PRESSED THEN PaddlePosition = PaddlePosition – 1; • IF quadB IS PRESSED THEN PaddlePosition = PaddlePosition + 1; • PaddlePosition = PaddlePosition +/- 25; FOR FASTER MOVEMENT.
PONG GAME DRAWING THE BALL • 16X16 PIXELS SQUARE. • RANDOM COLLISIONS. • 4 “HOT SPOT” PIXEL, ONE IN THE MIDDLE OF EACH SIDE OF THE BALL. • IF THE BALL DRAWS ITS “HOTSPOT” AT THE SAME TIME THE PADDLE OR BORDER DRAWS ITSELF, WE SAY THERE IS A COLLISION ON THAT SIDE.
PONG GAME pROBLEMS eNCOUNTERED • THE ORIGINAL CODE USED NON PS/2 MOUSE FOR PADDLE MOVEMENT. • CD4093 IC WASN’T AVAILABLE. • THE PADDLE WAS UNCONTROLLABLE WHEN WE USED TWO PUSH BUTTONS AND 50MHZ CLOCK. • RESTRICTED MOVEMENT OF PADDLE. The original setup used Pluto fpga board with 25MHz internal crystal and a modified mouse to control the paddle movement