Comp 150-001, MWF 12:35, Crown 105
Week 8
Homework 6: Invaders
Start with invaders.py. Add some features.
Here are a few suggestions:
- graphics when weapon is fired, beyond a vertical line
- change the invader visual appearance
- graphics when ball is hit (eg a different color line, or an explosion,
or a line that stops at the invader)
- increasing speed of invaders as the game progresses, either
horizontally or vertically or both
- increasing the angle of descent (which is related to the ratio of
horizontal speed to vertical speed) as the game progresses
- decreasing vulnerability of the invaders: perhaps a smaller radius, or
at least a smaller radius of vulnerability (eg the ball still
has radius 20, but you have to hit within ±10 of the center to stop it).
- try to randomize the starting position of the invader
- have the invader speed vary, as an evasion??
A harder feature would be launching a "missile" that gets animated along
with the invader. If they collide (at a later point!) the invader
disappears. Having multiple things at once that are moving can be hard. All
of them need their positions updated in the same animation loop.
nbounce does this.
nbounce.py
major bug: position of time.sleep()!
animate loop
global variables
grouping: tuples, lists, objects
nbounce2.py:
update method inside the object.
invaders.py
illusion1.py