homework_02 - The first should be blue and 5 pixels from...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
CS1372 Spring 2009 Homework 02 – Pong Paddles Designed to Teach You: 1. Loops in C 2. Function in C 3. C Preprocessor Macros 4. GBA Game Loop Dynamics Assignment Instructions: 1. [5%] Include a block at the top of your main.c file with the following: a. Name and Date b. GT Account and GTID c. Collaboration Statement 2. [10%] Define a Color macro that will store 3 five bit values (for the red, green, and blue components) into a single unsigned short. 3. [20%] Use loops to create a function that draws a rectangle of a specified size, at a specified location, and with a specified color. For example: void drawRectangle(int row, int col, int height, int width, int color) 4. [65%] Create two rectangular pong paddles, both of size 8 pixels wide and 30 pixels tall.
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: The first should be blue and 5 pixels from the left end. It should begin with a vertical speed of 1 pixel/loop downward, and when it reaches the bottom or top of the screen, it should bounce off. The second should be red and 5 pixels from the right end. It should begin with the same speed, but when it touches the bottom of the screen, it should appear back at the top and continue with the same speed, so it has a scrolling effect. 5. [10%] Extra Credit: Make the scrolling effect when the right paddle reaches the bottom smooth. That is, as each row of the rectangle passes the boundary, only that row will appear back at the top, so it is a continuous transition. To Submit on T-Square: 1. Submit your file main.c for Assignment 2....
View Full Document

This note was uploaded on 10/20/2009 for the course COE 1 taught by Professor Many during the Spring '09 term at Georgia Institute of Technology.

Ask a homework question - tutors are online