Docsity

CMPSCI 220: New Features - Miniballs & Block Destruction Homework 5A, Assignments of Computer Science

Partial preview of the text

Download CMPSCI 220: New Features - Miniballs & Block Destruction Homework 5A and more Assignments Computer Science in PDF only on Docsity!

U

U

NIVERSITY OFNIVERSITY OF

M

M

ASSACHUSETTS ASSACHUSETTS

, A

, A

MHERST MHERST •

Department of Computer Science Department of Computer Science

23 - Design: Homework 5A

CMPSCI 220 (291A)

Programming Methodology

Spring 2009

U

U

NIVERSITY OFNIVERSITY OF

M

M

ASSACHUSETTS ASSACHUSETTS

, A

, A

MHERST MHERST •

Department of Computer Science Department of Computer Science

Plan for the day

Describe the new feature(s) that the Homework asks youto design and build

Give you Q+A time with me about the requirements

Spend time in groups doing CRC card design of the newfeature (and changes to existing code)

Report back key design results

Go over the homework assignment (what are its“deliverables”, etc.)

U

U

NIVERSITY OFNIVERSITY OF

M

M

ASSACHUSETTS ASSACHUSETTS

, A

, A

MHERST MHERST •

Department of Computer Science Department of Computer Science

Key new feature:

Miniballs

A block is destroyed by

two

miniball hits

Block destruction is the same, whether by ball or miniball

A miniball travels

through

blocks – it does not bounce

After it hits

three blocks

, a miniball dies

A game is won if there are no more blocks

A game is lost if there are blocks but no balls, miniballs,or active PowerUps

We supply the red PowerUp image, a miniball image, anda miniball/block collision sound file; also a new Levelfile to help with testing

U

U

NIVERSITY OFNIVERSITY OF

M

M

ASSACHUSETTS ASSACHUSETTS

, A

, A

MHERST MHERST •

Department of Computer Science Department of Computer Science

Implementation hints

„

An oddity: Golden T’s collision detector getsconfused and reports the same collision morethan once

So a miniball needs to remember the last block ithit, and a collision should be entirely ignored if it isbetween a miniball and the block it just hit

„

To control firing, count down wait-timeremaining at each call to update

U

U

NIVERSITY OFNIVERSITY OF

M

M

ASSACHUSETTS ASSACHUSETTS

, A

, A

MHERST MHERST •

Department of Computer Science Department of Computer Science

Your task now

In groups of 2-3: „

Do CRC card design of new classes, andrelevant parts of existing classes

„

Suggestion: consider requirements one at atime

U

U

NIVERSITY OFNIVERSITY OF

M

M

ASSACHUSETTS ASSACHUSETTS

, A

, A

MHERST MHERST •

Department of Computer Science Department of Computer Science

Reporting back

New class(es)

U

U

NIVERSITY OFNIVERSITY OF

M

M

ASSACHUSETTS ASSACHUSETTS

, A

, A

MHERST MHERST •

Department of Computer Science Department of Computer Science

Reporting back

Changes to existing classes:

U

U

NIVERSITY OFNIVERSITY OF

M

M

ASSACHUSETTS ASSACHUSETTS

, A

, A

MHERST MHERST •

Department of Computer Science Department of Computer Science

What order to implement things?

Your suggestions for an order that allows incremental

building and testing: