示例#1
0
 def __init__(self, array, orig_x, orig_y,filename,name): 
     GameObject.__init__(self, orig_x, orig_y,name,6,((0,0, 32,28)),"boneco.png", "res/img" + "/" + filename)
     self.skin = filename
     self.jumping = False
     self.jumpingHorz = 0
     self.OnTheGround = False
     self.falling = True
     self.backupPos = orig_x, orig_y
     self.listControls = array
     self.weapon = Rifle()
     self.is_firing = 0
     self.dead = False
     #variavel de quantidade de salto feita por Carlos
     self.bla = 0
     self.shootingPosition = []
     self.shootingPosition.append(0)
     self.shootingPosition.append(0)
     #Player Audio Init
     self.playeraudio = AudioResource()
     self.playeraudio.AddSoundFXList([('res/music/footsteps.wav', 'footsteps'),
                                     ('res/music/laser.wav', 'laser'),
                                     ('res/music/gun_shotgun1.wav', 'gun_shotgun1'),
                                     ('res/music/reload.wav', 'reload'),
                                     ('res/music/pain_01.wav', 'pain_01'),
                                     ('res/music/blood_splat.wav', 'blood_splat'),
                                     ('res/music/gun_shell_drop.wav', 'shell')
                                     ])
     self.playeraudio.get_sound('footsteps').set_volume(0.4)
     
     #DIRECTION
     self.old_direction = LEFT
     self.moveX = 0
     self.moveY = 0 
     self.frameCurrent = FRAME_START
     
     #STAT PLAYER
     self.name = name
     self.bulletTotal = 0
     self.reload = 0
     self.playKilled = 0
     self.life = 100
     
     self.movement = (0,0,NONE)
     
     self.backupPosX = 0
     self.backupPosY = 0
     self.isMoving = False
示例#2
0
from fl.gameobject.GameObject import GameObject
from fl.globals import * #@UnusedWildImport

"""Classe base que define um objecto que os jogadores podem apanhar
-id (nome)
-imagem
-efeitos

"""
class Item(GameObject):
    def __init__(self, (orig_x, orig_y), name, sprite = "box.png"):
        GameObject.__init__(self, orig_x, orig_y+10,"Item",1,((0,0, 12,13)),sprite, "res/img/")
        self.toDelete = False
    def getName(self):
        return self.name
        
示例#3
0
 def kill(self):
     GameObject.kill(self)
示例#4
0
from fl.gameobject.GameObject import GameObject
from fl.globals import * #@UnusedWildImport

"""Classe base que define um objecto que os jogadores podem apanhar
-id (nome)
-imagem
-efeitos

"""
class Portal(GameObject):
    def __init__(self, (orig_x, orig_y), name, sprite = "portal.png"):
        GameObject.__init__(self, orig_x, orig_y+7,"Portal",1,((0,0, 52,48)),sprite, "res/img/")
        self.toDelete = False
    def getName(self):
        return self.name

    
示例#5
0
from fl.gameobject.GameObject import GameObject
from fl.globals import * #@UnusedWildImport

"""Classe base que define um objecto que os jogadores podem apanhar
-id (nome)
-imagem
-efeitos

"""
class Portal2(GameObject):
    def __init__(self, (orig_x, orig_y), name, sprite = "portal2.png"):
        GameObject.__init__(self, orig_x, orig_y+7,"Portal2",1,((0,0, 86,80)),sprite, "res/img/")
        self.toDelete = False
    def getName(self):
        return self.name