Project #2: Scene, creature, dog, birds, bomb. + keypress
SCENE: sky, sun, grass below (lower ~2/3 of screen)
- display title at the top and your name in lower-left corner
- Display the score (upper left corner of sky).
CREATURE: constant velocity DX, DY
- bounce off "walls" (left, right, bottom, horizon)
- reverse X direction, when mouse clicks on creature.
- EXTRA: Creature "shrinks" as he goes toward the horizon.
(Smaller when Y coordinate gets smaller.)
DOG: follow the creature
- chase at a rate that cuts the distance in half every second.
- EXTRA: dog's head should always point toward creature
BIRD: flies thru the sky from left to right;
- resume with new bird, whenever old bird exits right
- Click near bird to start the bomb dropping.
BOMB: bomb begins dropping, when 'b' key is pressed.
- bomb continues falling (until bottom of screen)
- if bomb hits creature, make a flash. DEDUCT 50 points from score.
- clicking on a bomb destroys it.
GOLD: Create a gold nugger If click is on the grass but NOT near the creature (nor in the sky),
. . . create a GOLD nugget: 3 concentric circles, shades of yellow/orange.
- When creature gets within 10 pixels of gold, it vanishes (add 100 points!)
(Note: there is only one gold nugget at a time; it moves to where you click.)
KEY PRESS ACTIONS: Pressing appropriate key does one of theses things:
b Starts bomb dropping from bird.
2. Clicking on the falling bomb makes it vanish (bombY = -1).
3. Clicking on the creature reverses his direction in X only.
4. Clicking elsewhere on grass creates GOLD nugget.
5. Clicking on the sky does nothing.
MOUSE CLICK ACTIONS: As mentioned above, clicking does one of theses things:
1. Clicking near the bird starts the bomb dropping.
2. Clicking on the falling bomb makes it vanish (bombY = -1).
3. Clicking on the creature reverses his direction in X only.
4. Clicking elsewhere on grass creates GOLD nugget.
5. Clicking on the sky does nothing.
NOTE: These descriptions are very approximate.
Feel free to vary the details and/or to add extras.
Be sure to make everything "modular", to make changes easier.
Each method MUST begin with a comment that says what you are trying to do!
In project #2, score is displayed in upper-right corner.
Also: different keys will cause other effects.
|