Friday, November 14, 2008

Hong Pong Phewey

Answer the following in a comment to this blog:
  1. What are the 4 parameters for the function draw_sprite()?
  2. What are the 5 parameters for the function play_sample()?
  3. What are the x and y coordinates of the upper-left corner of any bitmap?
  4. What code would you use to randomly generate a number between 1 and 480?

You'll need THIS IMAGE FILE later in class.


.

Wednesday, November 12, 2008

? Pong ?

Answer the following questions concerning the pong code in a comment to this blog.

  1. What is the screen resolution?
  2. How large are the paddles? (length & width)
  3. How many functions are we using?
  4. If dir = 4, is ball_x getting larger or smaller? What about ball_y?
  5. How do you generate a random number between 2 and 4?
  6. Explain why we use a screen buffer.

.

Tuesday, November 11, 2008

Pong v2.0

We'll be making the following additions to the PONG CODE we began yesterday. We'll be spending a few days on this.
  1. Keep track of the current score.
  2. Keep track of the current number of times the ball has hit the paddle; reset this number when somebody wins.
  3. There should be a sound played when the ball strikes a paddle.
  4. There should be a different sound played when the ball strikes a wall.
  5. The paddles should be replaced by similarly sized bitmap images.
  6. The ball should be replaced with a similarly sized bitmap image.
  7. The rest time in the main logic loop should get shorter as the number of hits increases.

.

Monday, November 10, 2008

Pong

Pong - parft deux


.