2016-03-20 18:01:41 -04:00
|
|
|
#!/bin/python
|
2016-03-20 18:35:23 -04:00
|
|
|
# -*- coding: utf-8 -*-
|
2016-03-20 18:01:41 -04:00
|
|
|
# Shoot the bottles as fast as possible.
|
|
|
|
|
|
|
|
from storm_games import *
|
|
|
|
|
2016-03-21 06:42:53 -04:00
|
|
|
sounds = initialize_gui("Bottle Blaster")
|
2016-03-20 18:01:41 -04:00
|
|
|
|
|
|
|
# loop forever (until a break occurs)
|
|
|
|
while True:
|
|
|
|
# wait for an event
|
|
|
|
event = pygame.event.wait()
|
|
|
|
# if the event is about a keyboard button that have been pressed...
|
|
|
|
if event.type == pygame.KEYDOWN:
|
2016-03-21 06:42:53 -04:00
|
|
|
sounds['bottle'].play(-1)
|
2016-03-20 18:01:41 -04:00
|
|
|
if event.type == pygame.KEYUP:
|
2016-03-21 06:42:53 -04:00
|
|
|
sounds['bottle'].stop()
|
2016-03-20 18:01:41 -04:00
|
|
|
# and if the button is the "q" letter or the "escape" key...
|
|
|
|
if event.key == pygame.K_ESCAPE:
|
|
|
|
# ... then exit from the while loop
|
|
|
|
break
|
|
|
|
time.sleep(.001)
|