示例#1
0
    def __init__(self):
        self.size = 60
        self.x = 0.0
        self.y = 80.0
        self.offensePower = 9999
        self.isExplosion = False
        self.frame = 0.0
        self.timePerAction = 0.9
        self.actionPerTime = 1.0 / self.timePerAction
        self.framesPerAction = 14
        self.right = self.x + self.size / 2
        self.left = self.x - self.size / 2
        self.top = self.y + self.size / 2
        self.bottom = self.y - self.size / 2
        self.degree = 0

        self.initVelocity = self.shootSpeedPps
        self.launchAngle = float(random.randint(5, 20))
        self.xVelocity = self.initVelocity * math.cos(
            math.radians(self.launchAngle))
        self.yVelocity = self.initVelocity * math.sin(
            math.radians(self.launchAngle))

        if self.cannonBallImage is None:
            self.cannonBallImage = camera.load_image(
                "effectImages\\cannonBall.png")
        if self.cannonExplosionImage is None:
            self.cannonExplosionImage = camera.load_image(
                "effectImages\\explosion.png")
        if self.explosionSound is None:
            self.explosionSound = camera.load_wav('sound\\bomb_explosion.wav')
            self.explosionSound.set_volume(50)
示例#2
0
 def __init__(self):
     self.x = 25
     self.y = camera.windowHEIGHT - 160
     self.width = 450
     self.height = 150
     if self.scrollImage is None:
         self.scrollImage = camera.load_image("effectImages\\oldScroll.png")
示例#3
0
 def __init__(self):
     self.x = camera.windowWIDTH - 100
     self.y = camera.windowHEIGHT - 70
     self.size = 70
     self.updateTime = 0.0
     self.font = camera.load_font('textfile\\Sofija.TTF', 35)
     if self.image is None:
         self.image = camera.load_image('effectImages\\coin.png')
示例#4
0
 def __init__(self):
     self.x = 150
     self.y = camera.windowHEIGHT - 80
     self.size = 80
     self.font = camera.load_font('textfile\\Sofija.TTF', 25)
     self.cost = 10
     self.currentRespawnTime = 0.0
     self.maxRespawnTime = 2.0
     self.state = MOUSE_OUT
     if self.clickButtonImage is None:
         self.clickButtonImage = camera.load_image(
             'button\\knight1Click.png')
     if self.onButtonImage is None:
         self.onButtonImage = camera.load_image('button\\knight1On.png')
     if self.outButtonImage is None:
         self.outButtonImage = camera.load_image('button\\knight1Out.png')
     if self.waitButtonImage is None:
         self.waitButtonImage = camera.load_image('button\\knight1Wait.png')