~danigm/pixwar/trunk

« back to all changes in this revision

Viewing changes to Planet.py

  • Committer: danigm
  • Date: 2008-04-12 11:47:42 UTC
  • Revision ID: danigm@arch_box-20080412114742-lxb9teivypp0dak6
Modo mision implementado

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
import Unit
9
9
import time
10
10
from copy import *
 
11
import os
11
12
 
12
13
class Planet(pygame.sprite.Sprite):
13
14
    """
21
22
        self.escala = self.size / 100.0
22
23
        #tamanio del planeta, determina la resistencia, y el numero maximo de unidades
23
24
 
24
 
        self.orig = pygame.image.load("data/planet.png")
 
25
        path = os.path.join('data', 'planet.png')
 
26
        self.orig = pygame.image.load(path)
25
27
        self.orig = self.orig.convert_alpha()
26
28
        self.orig = pygame.transform.scale(self.orig, (int(self.orig.get_width()*self.escala), int(self.orig.get_height()*self.escala)))
27
29
        self.rect = self.orig.get_rect()
30
32
        self.image1 = copy(self.orig)
31
33
        self.image = copy(self.orig)
32
34
        #la imagen del planeta
33
 
 
34
 
        self.font = pygame.font.Font('data/font.ttf', 20)
 
35
        
 
36
        path = os.path.join('data', 'font.ttf')
 
37
        self.font = pygame.font.Font(path, 20)
35
38
        self.text = self.font.render(str(self.size), 1, (250,250,250,250))
36
39
        self.textpos = self.rect.centerx
37
40
        #en el centro del planeta se va a escribir el numero de unidades