Example #1
0
    def __init__(self, name=None):
        if name is None:
            name = "registrar"

        Actor.__init__(self, name)

        return
Example #2
0
    def __init__(self, name=None):
        if name is None:
            name = "registrar"

        Actor.__init__(self, name)

        return
Example #3
0
    def __init__(self, image, laser, position):
        Actor.__init__(self, image, position, 100)

        self._laser = laser

        self._rotationSpeed = 100 #Degrees per second
        self._fireDurationSec = 0
Example #4
0
    def __init__(self, image, laser, position):
        Actor.__init__(self, image, position, 100)

        self._laser = laser

        self._rotationSpeed = 100  #Degrees per second
        self._fireDurationSec = 0
Example #5
0
	def __init__(self, tree):
		Actor.__init__(self, "An apple", 0x147514)
		self.ignoreBlocking = True
		self.lifetime = 0
		self.tree = tree
		self.edible = True
		self.hungerValue = 10
		self.canPass = True
Example #6
0
    def __init__(self, x_position, y_position):
        Actor.__init__(self)
        self.image = self.spritesheet[0]
        self.state = GhoulStates.DROPPING
        self.xvector = 0

        (width, height) = self.image.get_size()
        left = x_position - width / 2
        top = y_position - height / 2
        self.rect = pygame.Rect(left, top, width, height)
Example #7
0
 def __init__(self, game, **kwargs):
     Actor.__init__(self, game, **kwargs)
     '''self.height = h
     self.width = w
     self.x = _x
     self.y = _y'''
     self.Disabled = False
     self.Absolute = True
     self.focused = False
     self.Collision = False
     self.priority = -1
Example #8
0
	def __init__(self, name, colour = 0x000000):
		Actor.__init__(self, name, colour)
		
		# How many blocks in front can we see?
		self.los = 5
		# Whats our field of view?
		self.fov = 120

		# Ignore these
		self.path = None
		self.direction = (1, 0)
		self.FOVLines = []
Example #9
0
    def __init__(self,x,y,movespeed):

        Actor.__init__(self, x, y, movespeed)

        #self.up()
        #self.setheading(random.randrange(360))
        # self.down()
        self.newHead = None
        self.velocity = Vec2D(0, 0)
        self.vlimit = 2
        self.repulsionforce = 2
        self.minNieghborDist = 100
        self.neighbordist = 1000
        self.neighbors = []
        SchoolingActor.swarm.append(self)
Example #10
0
 def __init__(self, name, cash):
     Actor.__init__(self, cash, name)
     self.location_on_board = 0
     self.sum_of_numbers_rolled_on_dice = 0
     self.consecutive_doubles_counter = 0
     self.list_of_numbers_rolled = []
     self.locations_visited_by_player = []
     self.just_visiting_jail = True
     self.get_out_of_jail_free_card = False # Initially, player does not have the "get out of jail free" card.
     self.total_number_of_houses_owned = 0 # Initially player owns 0 houses
     self.total_number_of_hotels_owned = 0 # Initially player owns 0 hotels
     self.game_board = None
     self.collectSalary = False
     self.bank =  Bank.Instance()
     self.playAnotherTurn = False
Example #11
0
    def __init__(self, x_position, y_position):
        Actor.__init__(self)
        self.image = self.spritesheet[0]
        self.state = GhoulStates.DROPPING
        self.xvector = 0
        self.sprite_loop = lsm.create({
            0: Ghoul.spritesheet[0],
            15: Ghoul.spritesheet[1],
            30: lsm.end
        })

        (width, height) = self.image.get_size()
        left = x_position - width / 2
        top = y_position - height / 2
        self.rect = pygame.Rect(left, top, width, height)
Example #12
0
    def __init__(self):
        Actor.__init__(self)

        self.weapon = None
        self.armor = None
        self.accessory = None
        self.eqItem = []  # player can equip up to 4 usable items to use in battle
        self.inv_Ar = []  # inventory
        self.attacks_Ar = []  # associated array for attack string names and attack power values
        self.currentInput = ""
        self.currentProb1 = 0
        self.currentProb2 = 0
        self.currentAnswer = 0
        self.fractionSum = 0
        self.akhal = 0
Example #13
0
    def __init__(self):
        Actor.__init__(self)

        self.weapon = None
        self.armor = None
        self.accessory = None
        self.eqItem = [
        ]  #player can equip up to 4 usable items to use in battle
        self.inv_Ar = []  #inventory
        self.attacks_Ar = [
        ]  #associated array for attack string names and attack power values
        self.currentInput = ""
        self.currentProb1 = 0
        self.currentProb2 = 0
        self.currentAnswer = 0
        self.fractionSum = 0
        self.akhal = 0
Example #14
0
    def __init__(self, xpos, ypos):
        Actor.__init__(self)
        self.image1 = pygame.image.load("assets/bat/bat1.png")
        self.image2 = pygame.image.load("assets/bat/bat2.png")
        self.image3 = pygame.image.load("assets/bat/bat3.png")
        self.image = self.image1

        self.hitboxoffset = 0
        self.rect = pygame.Rect(xpos+self.hitboxoffset-30/2, ypos-30/2, 30, 50)
        self.swoop = 120
        self.swoop_frame = self.swoop
        self.swoop_velocity = 5
        self.swoop_decay = .1
        self.velocity = 0
        self.xvector = 0
        self.yvector = 0
        self.__name__ = "Bat"
Example #15
0
    def __init__(self, xpos, ypos):
        Actor.__init__(self)

        self.image = pygame.image.load("assets/simon/stand.png")
        self.hitboxoffset = 56
        self.rect = pygame.Rect(xpos+self.hitboxoffset, ypos, 32, 61)
        self.maxhealth = 7
        self.health = self.maxhealth

        self.is_jumping = False
        self.is_climbing = False
        self.is_falling = False
        self.is_attacking = False
        self.left_jump = False
        self.right_jump = False
        self.is_standing = True
        self.is_big_toss = False
        self.invul = False
        self.invul_frame = -1
        self.max_invul_frames = 120

        self.inputs = []

        self.attack = pygame.Rect(0, 0, 0, 0)
        self.attack_frame = -1
        self.attack_size = (50, 15)

        self.move = 2
        self.jump_velocity = 8.0
        self.jump_decay = .25
        self.velocity = 0
        self.sjmod = 1

        self.climb_index = -1

        self.spritesheet = {}
        os.chdir("assets/simon")
        for files in os.listdir("."):
            if files.endswith(".png"):
                self.spritesheet[files] = (pygame.image.load
                                           (files).convert_alpha())
        os.chdir("../..")
Example #16
0
	def __init__(self, actorJSON):
		Actor.__init__(self, actorJSON)
		attributes = {
			'spawnTime'		: datetime.datetime,
			'pluralName'	: '',
			'is_perm'		: False,
			'wanderRate'	: 0
		}
		
		for key in attributes.keys():
			if self.attributes.has_key(key) == False:
				self.attributes[key] = attributes[key]
		
		if self.attributes['is_perm']:
			self.attributes['adjective'] = ''
		else:
			self.attributes['adjective'] = (lambda char: 
												((char == 'a' or char == 'e' or char == 'i' or char == 'o' or char == 'u') and 'an') or 'a')(self.attributes['name'].lower()[0])
		
		self.addEventHandlerByNameWithAdjusters('Actor.EventHandlers.NPC.GameTickedHandler', None)									
Example #17
0
    def __init__(self, id):
        Actor.__init__(self)

        self.weakness=None
        self.eqItems_Ar = []    #equipped items
        self.attacks_Ar = []    #associated array for attack string names and attack power values
        self.eqItem_Ar = []
        self.inv_Ar = []
        self.attacks_Ar = []
        self.sprite=pygame.sprite.Sprite()
        self.place=0

        #load image based on type later
        self.name=ENEMY[id]['name']
        self.sprite.image=pygame.image.load(CHAR_PATH + ENEMY[id]['img'])
        self.HP = ENEMY[id]['hp']
        self.MHP=ENEMY[id]['hp']
        self.ATT = ENEMY[id]['att']
        self.weakness=ENEMY[id]['weak']
        self.sprite.rect=(200,200,50,300)
Example #18
0
    def __init__(self, id):
        Actor.__init__(self)
        #id = 'a'
        self.weakness=None
        self.eqItems_Ar = []    #equipped items
        self.attacks_Ar = []    #associated array for attack string names and attack power values
        self.eqItem_Ar = []
        self.inv_Ar = []
        self.attacks_Ar = []
        col,row,width,height = ENEMY[id]['sprite']
        self.sprite = DynamicDrawableObject( Spritesheet(CHAR_PATH + ENEMY[id]['img'] ).img_extract(col,row,width,height) , "", 24)
        self.place=0
        self.alive = True

        #load image based on type later
        self.name=ENEMY[id]['name']
        #self.sprite.image=pygame.image.load(CHAR_PATH + ENEMY[id]['img'])
        self.HP = ENEMY[id]['hp']
        self.MHP=ENEMY[id]['hp']
        self.ATT = ENEMY[id]['att']
        self.weakness=ENEMY[id]['weak']
Example #19
0
    def __init__(self, id):
        Actor.__init__(self)

        self.weakness = None
        self.eqItems_Ar = []  #equipped items
        self.attacks_Ar = [
        ]  #associated array for attack string names and attack power values
        self.eqItem_Ar = []
        self.inv_Ar = []
        self.attacks_Ar = []
        self.sprite = pygame.sprite.Sprite()
        self.place = 0

        #load image based on type later
        self.name = ENEMY[id]['name']
        self.sprite.image = pygame.image.load(CHAR_PATH + ENEMY[id]['img'])
        self.HP = ENEMY[id]['hp']
        self.MHP = ENEMY[id]['hp']
        self.ATT = ENEMY[id]['att']
        self.weakness = ENEMY[id]['weak']
        self.sprite.rect = (200, 200, 50, 300)
Example #20
0
  def __init__(self,player):
    Actor.__init__(self)

    self.player=player
    self.weapon=None
    self.armor=None
    self.accessory=None
    self.eqItem=[]          #player can equip up to 4 usable items to use in battle
    self.inv_Ar     = []        #inventory
    self.attacks_Ar = []        #associated array for attack string names and attack power values
    self.currentInput=""
    self.currentProb1=0
    self.currentProb2=0
    self.currentAnswer=0
    self.fractionSum=0
    self.akhal=0

    amulet=get_item('1')
    calculator=get_item('s')
    emptyItem=None
    self.eqItem=[emptyItem,emptyItem,emptyItem,emptyItem]
    self.inv_Ar=[amulet,calculator]
Example #21
0
    def __init__(self, actorJSON):
        Actor.__init__(self, actorJSON)
        attributes = {
            'spawnTime': datetime.datetime,
            'pluralName': '',
            'is_perm': False,
            'wanderRate': 0
        }

        for key in attributes.keys():
            if self.attributes.has_key(key) == False:
                self.attributes[key] = attributes[key]

        if self.attributes['is_perm']:
            self.attributes['adjective'] = ''
        else:
            self.attributes['adjective'] = (lambda char: (
                (char == 'a' or char == 'e' or char == 'i' or char == 'o' or
                 char == 'u') and 'an') or 'a')(
                     self.attributes['name'].lower()[0])

        self.addEventHandlerByNameWithAdjusters(
            'Actor.EventHandlers.NPC.GameTickedHandler', None)
Example #22
0
    def __init__(self, id):
        Actor.__init__(self)
        #id = 'a'
        self.weakness = None
        self.eqItems_Ar = []  #equipped items
        self.attacks_Ar = [
        ]  #associated array for attack string names and attack power values
        self.eqItem_Ar = []
        self.inv_Ar = []
        self.attacks_Ar = []
        col, row, width, height = ENEMY[id]['sprite']
        self.sprite = DynamicDrawableObject(
            Spritesheet(CHAR_PATH + ENEMY[id]['img']).img_extract(
                col, row, width, height), "", 24)
        self.place = 0
        self.alive = True

        #load image based on type later
        self.name = ENEMY[id]['name']
        #self.sprite.image=pygame.image.load(CHAR_PATH + ENEMY[id]['img'])
        self.HP = ENEMY[id]['hp']
        self.MHP = ENEMY[id]['hp']
        self.ATT = ENEMY[id]['att']
        self.weakness = ENEMY[id]['weak']
Example #23
0
    def __init__(self, player):
        Actor.__init__(self)

        self.player = player
        self.weapon = None
        self.armor = None
        self.accessory = None
        self.eqItem = [
        ]  #player can equip up to 4 usable items to use in battle
        self.inv_Ar = []  #inventory
        self.attacks_Ar = [
        ]  #associated array for attack string names and attack power values
        self.currentInput = ""
        self.currentProb1 = 0
        self.currentProb2 = 0
        self.currentAnswer = 0
        self.fractionSum = 0
        self.akhal = 0

        amulet = get_item('1')
        calculator = get_item('s')
        emptyItem = None
        self.eqItem = [emptyItem, emptyItem, emptyItem, emptyItem]
        self.inv_Ar = [amulet, calculator]
Example #24
0
 def __init__(self, actorJSON):
     Actor.__init__(self, actorJSON)
Example #25
0
 def __init__(self, name):
     Actor.__init__(self, name)
     return
Example #26
0
	def __init__(self, colour = 0x333333):
		Actor.__init__(self, "A Block", colour)
		self.ignoreBlocking = True
Example #27
0
 def __init__(self, name):
     Actor.__init__(self, name)
     return
Example #28
0
 def __init__(self, colour=0x333333):
     Actor.__init__(self, "A Block", colour)
     self.ignoreBlocking = True
Example #29
0
	def __init__(self):
		Actor.__init__(self, "An apple tree", 0x855D00)
		self.ignoreBlocking = True
		self.fruit = {}
Example #30
0
    def __init__(self, maxVelocity, image, target):
        Actor.__init__(self, image, (100, 100), maxVelocity)

        self._target = target
Example #31
0
 def __init__(self):
     Actor.__init__(self, "An apple tree", 0x855D00)
     self.ignoreBlocking = True
     self.fruit = {}
Example #32
0
	def __init__(self):
		Actor.__init__(self)