Power-ups (Space Shooter)

POWER <tick <x triple|shield drops a power-up (+) in the top row; it falls one row every tick (after enemies move). If it reaches the bottom row in the ship’s column it is collected (t=<tick power <kind), otherwise it is lost. triple makes the next 5 ticks fire three bullets (x − 1, x, x + 1). shield absorbs the next enemy that reaches the bottom (t=<tick shield blocked (<x,<y) instead of losing a life).

Input: As before, plus POWER lines.

Output: As before.

Difficulty: Hard. Write your answer in the browser editor, run the examples, then submit it against hidden tests. Python and JavaScript are free; other languages are part of licode Club.

Hint

  • Power-ups move every tick; enemies only on their step ticks.

More Space Shooter practice