Read the score database in MenuState.

This commit is contained in:
2013-01-13 13:00:01 -04:30
parent ec80af118b
commit 4d5f03116b
5 changed files with 81 additions and 6 deletions

View File

@@ -24,14 +24,14 @@ class IntroState(BaseState):
self.count = 0
self.next_transition = VALID_STATES['STAY']
self.screen_vertical_half = pygame.display.Info().current_h / 2
self.screen_vertical_half = pygame.display.Info().current_h / 3
image = imloader.cached_image_loader.get_image_to_screen_percent('gfx/burbuja.png')
image2 = imloader.cached_image_loader.get_image_to_screen_percent('gfx/submarino1.png')
image3 = imloader.cached_image_loader.get_image_to_screen_percent('gfx/oneoop.png')
self.sine_movement = actor.BulletActor(0, image, "SineMovement", False, True, False)
self.sine_movement.set_position([-(image2.get_width() / 2 + 10), pygame.display.Info().current_h / 2])
self.sine_movement.set_position([-(image2.get_width() / 2 + 10), pygame.display.Info().current_h / 4])
# The next line calculates the horizontal velocity of sine_movement.
# We want it to cover the width of the screen plus the width of the submarine sprite
# in 20 seconds. We divide by 60 to obtain the speed in pixels per frame.
@@ -52,6 +52,16 @@ class IntroState(BaseState):
self.oneoop_logo = actor.BaseActor(2, image3, "1-Oop logo", False, True, False)
self.oneoop_logo.set_position([10 + (image3.get_width() / 2),
pygame.display.Info().current_h - 10 - (image3.get_height() / 2)])
screen_prop = (25.0 / 768.0)
screen_fract = (float(pygame.display.Info().current_h) * screen_prop) / 768.0
scale_factor = screen_fract / screen_prop
font = pygame.font.Font('font/PressStart2P/PressStart2P.ttf', int(25.0 * scale_factor))
text_surf = font.render("1-OOP Presenta", True, (0, 0, 0))
self.text = actor.BaseActor(2, text_surf, "Text", False, True, False)
self.text.set_position([self.oneoop_logo.get_position()[0] + image3.get_width() + (text_surf.get_width() // 2) + 10,
pygame.display.Info().current_h - 10 - (image3.get_height() / 2)])
if game.DEBUG:
print "Velocity: " + str(self.sine_movement.get_velocity())
@@ -100,5 +110,6 @@ class IntroState(BaseState):
def render(self, canvas):
canvas.fill(self.background_color)
self.oneoop_logo.draw(canvas)
self.text.draw(canvas)
self.submarine.draw(canvas)
self.particle_system.draw(canvas)