Classes | |
class | WrappingSprite |
class | AsteroidSize |
class | Asteroid |
class | Player |
class | MovingSprite |
class | Bullet |
class | EffectSprite |
class | Starfield |
class | Overlay |
class | Banner |
class | Menu |
class | MenuItem |
class | ToggleMenuItem |
class | DifficultyMenuItem |
class | MainMenu |
class | OptionsMenu |
class | InstructionsMenu |
class | PauseMenu |
Functions | |
def | center_anchor |
def | wrap |
def | to_radians |
def | check_collisions |
def | begin_main_menu |
def | begin_options_menu |
def | begin_instructions_menu |
def | begin_game |
def | begin_first_round |
def | next_round |
def | begin_round |
def | begin_play |
def | begin_life |
def | life_lost |
def | game_over |
def | pause_game |
def | resume_game |
def | end_game |
def | set_overlay |
def | begin_menu_background |
def | begin_clear_background |
def | on_key_press |
def | on_draw |
def | update |
Variables | |
int | PLAYER_SPIN_SPEED = 360 |
int | PLAYER_ACCEL = 200 |
float | PLAYER_FIRE_DELAY = 0.1 |
int | BULLET_SPEED = 1000 |
int | MAX_ASTEROID_SPIN_SPEED = 180 |
int | MAX_ASTEROID_SPEED = 100 |
list | INITIAL_ASTEROIDS = [2, 3, 4, 5] |
int | ASTEROID_DEBRIS_COUNT = 3 |
tuple | MAX_DIFFICULTY = len(INITIAL_ASTEROIDS) |
int | ARENA_WIDTH = 640 |
int | ARENA_HEIGHT = 480 |
KEY_FIRE = key.SPACE | |
KEY_PAUSE = key.ESCAPE | |
int | COLLISION_RESOLUTION = 8 |
float | SMOKE_ANIMATION_PERIOD = 0.05 |
float | EXPLOSION_ANIMATION_PERIOD = 0.07 |
float | PLAYER_FLASH_PERIOD = 0.15 |
int | GET_READY_DELAY = 1 |
int | BEGIN_PLAY_DELAY = 2 |
int | LIFE_LOST_DELAY = 2 |
tuple | FONT_NAME = ('Verdana', 'Helvetica', 'Arial') |
INSTRUCTIONS = \ | |
tuple | win = pyglet.window.Window(ARENA_WIDTH, ARENA_HEIGHT, caption='Astraea') |
tuple | batch = pyglet.graphics.Batch() |
tuple | wrapping_batch = pyglet.graphics.Batch() |
list | asteroid_sizes |
tuple | bullet_image = resource.image('bullet.png') |
tuple | smoke_images_image = resource.image('smoke.png') |
tuple | smoke_images = pyglet.image.ImageGrid(smoke_images_image, 1, 8) |
smoke_animation = \ | |
loop = False) | |
tuple | explosion_images_image = resource.image('explosion.png') |
tuple | explosion_images = pyglet.image.ImageGrid(explosion_images_image, 2, 8) |
explosion_animation = \ | |
tuple | pointer_image = resource.image('pointer.png') |
tuple | pointer_image_flip = resource.image('pointer.png', flip_x=True) |
tuple | explosion_sound = resource.media('explosion.wav', streaming=False) |
tuple | bullet_sound = resource.media('bullet.wav', streaming=False) |
tuple | starfield = Starfield(resource.image('starfield.jpg')) |
tuple | player = Player(resource.image('ship.png'), wrapping_batch) |
overlay = None | |
in_game = False | |
paused = False | |
int | score = 0 |
int | difficulty = 2 |
show_fps = False | |
enable_sound = True | |
tuple | score_text |
tuple | fps_display = pyglet.window.FPSDisplay(win) |
list | bullets = [] |
list | animations = [] |
def unlock.view.asteroids.begin_clear_background | ( | ) |
def unlock.view.asteroids.begin_first_round | ( | args | ) |
def unlock.view.asteroids.begin_game | ( | ) |
def unlock.view.asteroids.begin_instructions_menu | ( | ) |
def unlock.view.asteroids.begin_life | ( | args | ) |
def unlock.view.asteroids.begin_main_menu | ( | ) |
def unlock.view.asteroids.begin_menu_background | ( | ) |
def unlock.view.asteroids.begin_options_menu | ( | ) |
def unlock.view.asteroids.begin_play | ( | args | ) |
def unlock.view.asteroids.begin_round | ( | args | ) |
def unlock.view.asteroids.center_anchor | ( | img | ) |
def unlock.view.asteroids.check_collisions | ( | ) |
def unlock.view.asteroids.end_game | ( | ) |
def unlock.view.asteroids.game_over | ( | ) |
def unlock.view.asteroids.life_lost | ( | args | ) |
def unlock.view.asteroids.next_round | ( | args | ) |
def unlock.view.asteroids.on_draw | ( | ) |
def unlock.view.asteroids.on_key_press | ( | symbol, | ||
modifiers | ||||
) |
def unlock.view.asteroids.pause_game | ( | ) |
def unlock.view.asteroids.resume_game | ( | ) |
def unlock.view.asteroids.set_overlay | ( | new_overlay | ) |
def unlock.view.asteroids.to_radians | ( | degrees | ) |
def unlock.view.asteroids.update | ( | dt | ) |
def unlock.view.asteroids.wrap | ( | value, | ||
width | ||||
) |
list unlock::view::asteroids.animations = [] |
int unlock::view::asteroids.ARENA_HEIGHT = 480 |
int unlock::view::asteroids.ARENA_WIDTH = 640 |
00001 [AsteroidSize('asteroid1.png', 100), 00002 AsteroidSize('asteroid2.png', 50), 00003 AsteroidSize('asteroid3.png', 10)]
tuple unlock::view::asteroids.batch = pyglet.graphics.Batch() |
tuple unlock::view::asteroids.bullet_image = resource.image('bullet.png') |
tuple unlock::view::asteroids.bullet_sound = resource.media('bullet.wav', streaming=False) |
int unlock::view::asteroids.BULLET_SPEED = 1000 |
list unlock::view::asteroids.bullets = [] |
float unlock::view::asteroids.EXPLOSION_ANIMATION_PERIOD = 0.07 |
tuple unlock::view::asteroids::explosion_images = pyglet.image.ImageGrid(explosion_images_image, 2, 8) |
tuple unlock::view::asteroids.explosion_images_image = resource.image('explosion.png') |
tuple unlock::view::asteroids.explosion_sound = resource.media('explosion.wav', streaming=False) |
tuple unlock::view::asteroids.FONT_NAME = ('Verdana', 'Helvetica', 'Arial') |
tuple unlock::view::asteroids.fps_display = pyglet.window.FPSDisplay(win) |
unlock::view::asteroids.in_game = False |
list unlock::view::asteroids.INITIAL_ASTEROIDS = [2, 3, 4, 5] |
unlock::view::asteroids.KEY_FIRE = key.SPACE |
unlock::view::asteroids.KEY_PAUSE = key.ESCAPE |
unlock::view::asteroids.loop = False) |
unlock::view::asteroids.paused = False |
tuple unlock::view::asteroids.player = Player(resource.image('ship.png'), wrapping_batch) |
int unlock::view::asteroids.PLAYER_ACCEL = 200 |
float unlock::view::asteroids.PLAYER_FIRE_DELAY = 0.1 |
float unlock::view::asteroids.PLAYER_FLASH_PERIOD = 0.15 |
tuple unlock::view::asteroids.pointer_image = resource.image('pointer.png') |
tuple unlock::view::asteroids.pointer_image_flip = resource.image('pointer.png', flip_x=True) |
int unlock::view::asteroids.score = 0 |
00001 pyglet.text.Label('', 00002 font_name=FONT_NAME, 00003 font_size=18, 00004 x=ARENA_WIDTH - 10, 00005 y=ARENA_HEIGHT - 10, 00006 anchor_x='right', 00007 anchor_y='top')
unlock::view::asteroids.show_fps = False |
float unlock::view::asteroids.SMOKE_ANIMATION_PERIOD = 0.05 |
tuple unlock::view::asteroids.smoke_images = pyglet.image.ImageGrid(smoke_images_image, 1, 8) |
tuple unlock::view::asteroids.smoke_images_image = resource.image('smoke.png') |
tuple unlock::view::asteroids.starfield = Starfield(resource.image('starfield.jpg')) |
tuple unlock::view::asteroids.win = pyglet.window.Window(ARENA_WIDTH, ARENA_HEIGHT, caption='Astraea') |
tuple unlock::view::asteroids.wrapping_batch = pyglet.graphics.Batch() |