drracket代写 CISC 108: Introduction to Computer Science Project 1: Flappy Plane!

CISC 108: Introduction to Computer Science I, Spring 2014! Project 1

Project 1: Flappy Plane!

!

Goals!

• To make sure you can write programs using combinations of lists and structures.! • To practice using the design recipe to organize a nontrivial program.!

!

It goes without saying (we hope), but you must use the Design Recipe for all functions. In particular,!

  • Don’t forget to write a signature, purpose statement, and unit tests for every function.!
  • Write the tests before you write the function definition.!
  • Break up functions into smaller functions if they become too complex.!
  • Define every data type you use.!

    !

    Flappy Plane is inspired by Flappy Bird (http://en.wikipedia.org/wiki/Flappy_Bird). The goal of the game to achieve as high a score as possible with out hitting an obstacle or the edges of the world. In our version, you increase your score by collecting stars.!

    While we have dramatically simplified many aspects of the the game play, it still will be by far the largest program you have constructed in class. Strict adherence to the Design Recipe is required to keep everything straight. In Project 1 we still provide a large amount of structured help, but be aware than unlike a lab most design decisions will be up to you and your partner. Beyond the first part of the project, we will not be telling you “develop this function, then that one, then…”.!

    We clarify the minimum functionality in the game required for an “A”, however we also point out many opportunities for extra credit, as this is a very extensible premise.!

    !

Page 1 of 4

CISC 108: Introduction to Computer Science I, Spring 2014! Project 1

The Assignment!

Your job is to develop Flappy Bird. A screen shoot of the finished game is provided below:!

Game Components!

As you can see, there are four main components of the game: the plane, the stars, the score, and the rocks.!

The Plane!

The plane is controlled by the player.!

The Stars!

There are three types of stars: gold, worth the most amount points; silver, worth a medium amount of points; and bronze, worth the least amount of points. !

The Score!

The score shows the total amount of points that have been collected by the player!

The Rocks!

Rocks are obstacles that the player needs to navigate around to collect the stars. There are three types of rocks: small, medium, and large. The number, type, and location of the rocks should be random.!

!

Page 2 of 4

CISC 108: Introduction to Computer Science I, Spring 2014! Project 1

!

Gameplay!

The plane is constantly being pull towards the bottom the of the world by gravity.!

Pressing “up”, “left”, or “right” makes the plane move in short bursts in the corresponding direction.!

Each time the player collects a star, two things occur: (1) the score is incremented by the star’s point value and (2) a new star is created. The type of the new star and its location should be randomly chosen.!

The game ends if the plane hits an obstacle or if the plane hits the edges of the world (top, bottom, left, or right).!

Software Engineering Strategy!

If you and your partner prefer to work separately, work out and agree on the data definitions first, then proceed to work on the rest of the code (together or independently). In a professional setting, one person or team is responsible for each data definition and all the functions that operate on that data definition. Function signatures become literal contracts between you and your teammates.!

Implement the game in stages (“increments”), not all at once.!

Hints!

You will be graded primarily on the structure of your code, not on efficiency.!
We have a provided several libraries of additional code that you will need to use. !

  • vec.rkt provides a two dimensional vector type and several useful functions.!
  • collision.rkt provides a function collision? that determines whether or not two images will overlap when draw at specific locations. This will be help in detecting when the plane collects a start or hits a rock.!

    Grading!

    When we grade you projects, we are primarily looking at the functionality you have implemented.!

  • To earn a D, your project must implement the plane including its movement and ending the game if it hits the edge of the world (This is Lab 5.)!
  • To earn a C, your project must implement everything needed to earn a D plus adding stars to the game!
  • To earn a B, your project must implement everything needed to earn a C plus score keeping, including placing a new stars after stars are collected by the player!
  • To earn a A, your project must implement everything needed to earn a B plus obstacles (i.e., the complete game).!

    Once we determine you’re starting grade, we’ll look at the code and deduct points for the usual problems: missing signatures, tests, poor formatting, etc.!

Page 3 of 4

CISC 108: Introduction to Computer Science I, Spring 2014! Project 1

You will get more credit for a fully-working, well-designed solution to part of the game than for a non-working solution to the whole game.!

Extra Credit!

This project lends itself to many extensions. If you care about exactly how much credit we will award, please check with us first. In general we won’t award more than 50 points extra even if you re-implement the full game.!

Here are some specific ideas:!

  • Increasing the number of obstacles as the game progresses!
  • New types of obstacles with different behaviors (e.g., obstacles that move back and forth, obstacles that increase and decrease in size, obstacles that track the plane)!
  • Additional items to interact with (e.g., bombs that destroy obstacles, boosters that make the plane move faster)!
  • External level definitions read in from a file (locations of the obstacles)!
  • High score tracking!

    What to turn in!

    Turn in a single file project1.rkt containing all code and documentation for this assignment. Make sure that both students’ names are in a comment at the top of the file. Projects may be submitted late, at a penalty of 15% of your grade per day. (Yes, weekends count).

Page 4 of 4