22-Section-Handout

22-Section-Handout - CS106A Spring 2011 Handout 22 Section...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
CS106A Handout 22 Spring 2011 April 27 th , 2011 Section Handout Discussion Problem 1: Blockade [thanks to Chris Piech for this one] Write a GraphicsProgram that plays a one-player game of Blockade—a game where the user navigates a continually growing "snake". Here’s a picture of a game at completion: Initially the snake should be in the center of the screen traveling to the right. Once the game starts every 100ms the snake grows by one 15x15 unit in the relevant direction. The user can control the direction of the snake by clicking on the screen. If the snake is moving left or right the user can change the direction to be up by clicking above the snake head or down by clicking below. Similarly if the snake is moving up or down the user can change the direction to be left by clicking to the left of the head or right by clicking to the right of the head. The game ends when the snake collides with itself (for section you don’t have to worry about it going off the screen).
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 05/28/2011 for the course CS 106A taught by Professor Sahami,m during the Spring '08 term at Stanford.

Page1 / 4

22-Section-Handout - CS106A Spring 2011 Handout 22 Section...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online