Ejemplo n.º 1
0
def feedback():
    if request.method == 'POST':
        data = request.form.getlist('key')
        id = result[int(data[0])]["TweetID"]
        Health.updateFeedback(elasticsearch_connection, id)

    return "Disliked"
Ejemplo n.º 2
0
def run():
    """
    Driver class for the search engine
    """

    print("{}: Get Elasticsearch connection".format(TAG))
    elasticsearch_connection = get_elasticsearch_connection()

    print("{}: Get Health Dataframe".format(TAG))
    health = Health.get_data(health_data)

    print("{}: Index health_data into elasticsearch".format(TAG))
    Health.index_data_in_elasticsearch(health, elasticsearch_connection)
Ejemplo n.º 3
0
def options():
    print("What would you like to do?")
    print("""
    1. Play a text-based adventure game
    2. Check my health figures
    3. Study with flash cards
    4. Exit
    """)
    choice = input("> ")

    if choice == "1":
        print(
            "What would you like to play? \n(1) A Superhero game or (2) a prison-escape game?"
        )
        game_choice = input("> ")

        if game_choice == "1":
            import hero_game
            hero_game.a_map.play()

        elif game_choice == "2":
            import adventure_text
            adventure_text.start()

    elif choice == "2":
        import Health
        Health.start()

    elif choice == "3":
        import flash_cards
        flash_cards.start()

    elif choice == "4":
        quit()

    else:
        print("I don't understand that choice.")
        options()
Ejemplo n.º 4
0
def handle(msg):
	global bot_mode

	LED.one_pink_blink()

	user_id = msg['from']['id']
	chat_id = msg['chat']['id']
	command = msg['text']
	dtnow = datetime.datetime.now().strftime('%d.%m.%Y %H:%M:%S')
	print ('%s - %s - Got command: %s' % (dtnow, user_id, command))

	if command == '/get_pic':
		access = Tools.check_access(user_id, command)
		if access == True:
			pic = Pic.get_pic(user_id)
			pic_file = open(pic,'rb')
			bot.sendPhoto(chat_id, pic_file)
		else:
			bot.sendMessage(chat_id, access)
		bot_mode = 0

	elif command == '/get_temp':
		msg_txt = Env.get_msg()
		bot.sendMessage(chat_id, str(msg_txt), 'Markdown')
		bot_mode = 0

	elif command == '/uptime':
		access = Tools.check_access(user_id, command)
		if access == True:
			bot.sendMessage(chat_id, str(Tools.getUptime()))
		else:
			bot.sendMessage(chat_id, access)
		bot_mode = 0

	elif command == '/get_temp_graph':
		graph_pic = Graph.get_temp(user_id)
		pic_file = open(graph_pic,'rb')
		bot.sendPhoto(chat_id, pic_file)
		bot_mode = 0

	elif command == '/get_hum_graph':
		graph_pic = Graph.get_humid(user_id)
		pic_file = open(graph_pic,'rb')
		bot.sendPhoto(chat_id, pic_file)
		bot_mode = 0

	elif command == '/get_press_graph':
		graph_pic = Graph.get_press(user_id)
		pic_file = open(graph_pic,'rb')
		bot.sendPhoto(chat_id, pic_file)
		bot_mode = 0

	elif command == '/get_t_h':
		graph_pic = Graph.get_temp_hum(user_id)
		pic_file = open(graph_pic,'rb')
		bot.sendPhoto(chat_id, pic_file)
		bot_mode = 0

	elif command == '/bp':
		access = Tools.check_access(user_id, command)
		if access == True:
			bot_mode = 'body_pressure'
			msg_txt = '''Input your blood pressure in any format...'''
			bot.sendMessage(chat_id,msg_txt)
		else:
			bot.sendMessage(chat_id, access)
			bot_mode = 0

	elif command == '/w':
		access = Tools.check_access(user_id, command)
		if access == True:
			bot_mode = 'weight'
			msg_txt = '''Input your weight in any format...'''
			bot.sendMessage(chat_id,msg_txt)
		else:
			bot.sendMessage(chat_id, access)
			bot_mode = 0

	else:
		if bot_mode == 'body_pressure':
			result = Health.send_bp(command)
			if result:
				bot.sendMessage(chat_id, "Successful!")
			else: 
				bot.sendMessage(chat_id, "Something wrong :(")
			bot_mode = 0
		elif bot_mode == 'weight':
			result = Health.send_w(command)
			if result:
				bot.sendMessage(chat_id, "Successful!")
			else: 
				bot.sendMessage(chat_id, "Something wrong :(")
			bot_mode = 0
		else:
			msg_txt = Tools.DEFAULT_MESSAGE
			bot.sendMessage(chat_id, msg_txt, 'Markdown')
			bot_mode = 0
Ejemplo n.º 5
0
    bubble = image.load("bubble.png").convert_alpha()
    bubble = transform.scale(bubble,(74*3,65*3))
    player1WinText = image.load("Player1WinText.png").convert_alpha()
    player2WinText = image.load("Player2WinText.png").convert_alpha()

    #Create Surfaces
    player1Win = pygame.Surface((SCREEN_WIDTH, SCREEN_HEIGHT))
    player1Win.set_alpha(0)
    player1Win.blit(player1WinText,(200,150))
    player2Win = pygame.Surface((SCREEN_WIDTH, SCREEN_HEIGHT))
    player2Win.set_alpha(0)
    player2Win.blit(player2WinText,(200,150))
    

    #Creates Healthbar and Power Bar
    healthBar = Health.HealthBar()
    powerBar = Health.PowerBar()
    timer = Health.Timer()

    
    #Loads Sprites
        #Zero
    zeroIdleAnimList = zeroBuild.idleAnim()
    zeroWalkAnimList = zeroBuild.walkList()
    zeroStartStopAnimList = zeroBuild.startStopAnim()
    zeroJumpAnimList = zeroBuild.jumpAnim()
    zeroDashAnimList = zeroBuild.dashAnim()
    zeroAttack1List = zeroBuild.attackAnim()
    zeroTallest = zeroBuild.tallest()
    zeroWidest = zeroBuild.widest()
    zeroDefault = zeroBuild.default()
Ejemplo n.º 6
0
def game_loop():
    global BACKGROUND
    global SCREEN
    ## Initialize sprite groups
    MOTHS = pygame.sprite.Group()
    ALL = pygame.sprite.RenderUpdates()
    FLOWERS = pygame.sprite.Group()
    if pygame.font:
        ALL.add(Score())
        ALL.add(Health())

    ## Assign default groups to each sprite class
    Bee.containers = ALL
    Moth.containers = MOTHS, ALL
    Flower.containers = FLOWERS, ALL
    Score.containers = ALL
    Health.containers = ALL

    # Create starting values
    FRAME_RELOAD = GameParams.FRAME_RELOAD
    clock = pygame.time.Clock()
    bee = Bee(BEE_IMAGE)

    while bee.alive():
        if GameParams.HEALTH == 0: bee.kill()

        ## get keyboard intput
        for event in pygame.event.get():
            if event.type == QUIT or \
                (event.type == KEYDOWN and event.key == K_ESCAPE):
                return
        keystate = pygame.key.get_pressed()

        # clear/erase the last drawn sprites
        ALL.clear(SCREEN, BACKGROUND)
        # update all the sprites
        ALL.update()
        # handle user player input and move the bee sprite left/right
        direction = keystate[K_RIGHT] - keystate[K_LEFT]
        bee.move(direction)

        # Create new moth
        if FRAME_RELOAD > 0:
            FRAME_RELOAD = FRAME_RELOAD - 1
        elif not int(random.random() * GameParams.MOTH_ODDS) != 0:
            Moth(MOTH_IMAGE)
            FRAME_RELOAD = GameParams.FRAME_RELOAD

        # Create new flower
        if FRAME_RELOAD > 0:
            FRAME_RELOAD = FRAME_RELOAD - 1
        elif not int(random.random() * GameParams.FLOWER_ODDS) != 0:
            Flower(FLOWER_IMAGE)
            FRAME_RELOAD = GameParams.FRAME_RELOAD

        ## has the bee collided with the moth?
        for moth in pygame.sprite.spritecollide(bee, MOTHS, 1):
            splash_sound.play()
            GameParams.HEALTH = GameParams.HEALTH - 1

        ## has the bee collieded with a flower?
        for flower in pygame.sprite.spritecollide(bee, FLOWERS, 1):
            ding_sound.play()
            GameParams.SCORE = GameParams.SCORE + 1

        ## draw the scene
        drawn_screen = ALL.draw(SCREEN)
        pygame.display.update(drawn_screen)

        ## advance the clock
        clock.tick(40)

    if pygame.mixer: pygame.mixer.music.fadeout(1000)
    pygame.time.wait(1000)
    pygame.quit()
Ejemplo n.º 7
0
    def game_arrow_rain(self, game_instance):
        red_dot_interval = 500 #Hvor hurtigt kommer de røde bolde    
        blocks_hit_list = pygame.sprite.spritecollide(game_instance.Princess, self.all_arrows, True)
        health_hit_list = pygame.sprite.spritecollide(game_instance.Princess, self.all_health,True)
        red_dot_hit_list = pygame.sprite.spritecollide(game_instance.Princess, self.all_red_dots, False)
        enemy_hit_list = pygame.sprite.spritecollide(game_instance.Princess, self.all_enemies, False)        

        for hits in blocks_hit_list:
            game_instance.Princess.hit()
            a = Arrow.arrow()
            self.all_arrows.add(a)
            self.all_sprites_list.add(a)    

        for hits in health_hit_list:
            game_instance.Princess.heal(hits.amount)    
        
        for hits in red_dot_hit_list:
            game_instance.Princess.heal(-100)
            self.all_red_dots.remove(hits)
            self.all_sprites_list.remove(hits)    

        for hits in enemy_hit_list:
            #Hvad skal der ske når princessen rammer en sort prik
            continue    

        if game_instance.frames % variables.fps == 0:
            game_instance.score = self.score + 1 
            
        text = game_instance.font.render('HP: {}'.format(game_instance.Princess.hp), True, variables.BLACK)
        score_text = self.font.render('Score: {}'.format(game_instance.score), True, variables.RED)
        
        if game_instance.health_count == 500:
            H_Box = Health.health()
            self.all_sprites_list.add(H_Box)
            self.all_health.add(H_Box)
            self.health_count = 0    

        if self.red_dot_time == red_dot_interval:
            red_dot = redDot.reddot(self.RED_DOT_image, variables.WHITE)
            red_dot.set_move(float(self.Princess.x), float(self.Princess.y))
            self.all_sprites_list.add(red_dot)
            self.all_red_dots.add(red_dot)
            draw_fire = 100
            self.red_dot_time = 0    

        else:
            self.red_dot_time += 1
        
        for health in self.all_health:
            health.counter += 1
            if health.counter == health.time:
                self.all_health.remove(health)
                self.all_sprites_list.remove(health)
        
        for enemy in self.all_enemies:
            enemy.move(self.Princess.x, self.Princess.y)
            
        self.health_count += 1    

        for sprite in self.all_sprites_list:
            sprite.move()
        
        for arrow in self.all_arrows:
            if arrow.x < 0:
                arrow.x = random.randrange(1000, 1500)
                arrow.y = random.randrange(300,680)    

        if self.Princess.hp <= 0:
            return {'text': 'dead', 'score': self.score}
        
        self.frames = self.frames + 1   
        if self.frames % 1800 == 0:
            NYE_PILE = 10
            for i in range(NYE_PILE):
                a = Arrow.arrow()
                self.all_arrows.add(a)
                self.all_sprites_list.add(a)    

        draw_screen(self.screen, self.background_image)
        self.screen.blit(self.CANNON_image, [820, 20])    

        if self.draw_fire > 0:
            self.screen.blit(self.CANNON_FIRE_image, [700, -25])
            self.draw_fire = self.draw_fire - 1
        self.screen.blit(text,[500, 0])
        self.screen.blit(score_text,[200, 0])           
        self.back_button.draw(self.screen)    

        for sprite in self.all_sprites_list:
            sprite.draw(self.screen)
        
        return
Ejemplo n.º 8
0
def runGame():
    # game setup
    pygame.init()
    window = pygame.display.set_mode((800, 600))
    player = Player.Player()
    clock = pygame.time.Clock()
    clock.tick(60)
    delta_time = 0
    corner = [0, 5, 0, 5]
    corner_y = [0, 0, 4, 4]
    #floor = Floor.Floor (0,0)

    # Loads the sprites
    groups = {
        "wall": pygame.sprite.Group(),
        "floor": pygame.sprite.Group(),
        "health": pygame.sprite.Group(),
        "enemies": pygame.sprite.Group()
    }

    groups["wall"].add(Wall.generate_walls(50, 0, 14, 1, 1, 0))  #top wall
    groups["wall"].add(Wall.generate_walls(50, 550, 14, 1, 1, 4))  #bottom wall
    groups["wall"].add(Wall.generate_walls(0, 50, 1, 10, 0, 0))  #left wall
    groups["wall"].add(Wall.generate_walls(750, 50, 1, 10, 5, 0))  #right wall

    for i in range(4):
        if i < 2:
            groups["wall"].add(
                Wall.generate_walls((i % 2) * 750, 0, 1, 1, corner[i],
                                    corner_y[i]))
        else:
            groups["wall"].add(
                Wall.generate_walls((i % 2) * 750, 550, 1, 1, corner[i],
                                    corner_y[i]))

    # generating the floor, health potion and enemy
    groups["floor"].add(Floor.generate_floor(50, 50, 14, 10, 2, 2))
    groups["health"].add(Health.Health(100, 100))
    groups["enemies"].add(Enemy.Enemy(400, 400))

    # game loop
    running = True
    while running:
        # Making actions based off keys clicked
        for event in pygame.event.get():
            if event.type == pygame.QUIT:
                running = False
            elif event.type == pygame.KEYDOWN:
                if event.key == pygame.K_w:
                    player.set_yspeed(-300)
                elif event.key == pygame.K_s:
                    player.set_yspeed(300)
                elif event.key == pygame.K_a:
                    player.set_xspeed(-300)
                elif event.key == pygame.K_d:
                    player.set_xspeed(300)
            elif event.type == pygame.KEYUP:
                if event.key == pygame.K_w:
                    if player.get_yspeed() < 0:
                        player.set_yspeed(0)
                elif event.key == pygame.K_s:
                    if player.get_yspeed() > 0:
                        player.set_yspeed(0)
                elif event.key == pygame.K_a:
                    if player.get_xspeed() < 0:
                        player.set_xspeed(0)
                elif event.key == pygame.K_d:
                    if player.get_xspeed() > 0:
                        player.set_xspeed(0)
        # setting the time of the game
        delta_time = clock.tick(144) / 1000
        player.update(delta_time, groups)
        # updating each group
        for group in groups.values():
            for i in group:
                i.update(delta_time, groups)
        window.fill((0, 0, 0))
        # drawing the spites
        for group in groups.values():
            for i in group:
                i.draw(window)
        # updates the screen
        player.draw(window)
        pygame.display.flip()
Ejemplo n.º 9
0
    def tmode(self, kvdict=None, mode=1, nano=None):
        if (mode != 1):
            self._system.send_code_abort_PicassoTalk()
            return
        ###
        (self.laserType, firmware_version
         ) = self._system.detectMode()  # leaves in picasso tmode
        if (self.laserType == 0):
            print('Laser not detected')
            return
        self._firmware_version = firmware_version
        if nano is None:
            if self.it.getLaserType() == 5:  # FIXME: why is this None?
                Nano = True
            else:
                Nano = False
        else:
            Nano = nano
        if Nano and (kvdict == None):  # NANO
            print 'Error: Nano detected, kvdict parameter is needed!'
            return

        dm = Dictionary.DictionaryManager(kvdict)
        self._dictionary_manager = dm

        if Nano == False:  # not NANO
            if not dm.shelf(System.bridgePath(firmware_version)):
                print "Unable to find bridge files in " + System.bridgePath(
                    firmware_version)
                print('Firmware version [%s] not supported.' %
                      (firmware_version))
                return
            self.it.setupFromTMode(True)

        self._root_dictionary = dm.rootDictionary()
        d = Dictionary.Dictionary()

        if Nano == False:  # not NANO
            # Give it a valid memory object
            d.memory(dm.dictionary('SYSTEM_DICTIONARY').memory())
            d.addEntry('system', dm.dictionary('SYSTEM_DICTIONARY'))

            # Some firmware version may not have this dictionary
            try:
                d.addEntry('ipc_defaults', dm.dictionary('IPC_DICTIONARY'))
            except:
                pass
        else:
            self.type = 2
        self._system.dictionary(d)
        self._sample_stage = Sample.SampleStage(nano=nano)
        self._domain_stage = Domain.DomainStage(self.type)
        self._domain_stage.dictionary(dm.dictionary('DOMAIN_DICTIONARY'))
        self._control_stage = Control.ControlStage(dm)
        self._tuner = Tuner.TunerManager(self, dm, Nano)
        self._discrete_stage = Discrete.DiscreteStage()
        self._discrete_stage.dictionary(dm.dictionary('DISCRETE_DICTIONARY'))
        self._side_mode_balancer = SideModeBalancer.SideModeBalancer()
        self._side_mode_balancer.dictionary(
            dm.dictionary('SIDE_MODE_BALANCER_DICTIONARY'))
        self._ambient_compensator = AmbientCompensator.AmbientCompensator()
        self._ambient_compensator.dictionary(
            dm.dictionary('AMBIENT_COMPENSATOR_DICTIONARY'))
        self._modem = MODEM.MODEM()
        self._modem.dictionary(dm.dictionary('MODEM_DICTIONARY'))
        self._health = Health.Health()
        self._health.dictionary(dm.dictionary('HEALTH_DICTIONARY'))
        self.shortcut_definition()
        #pb self._dictionary_manager.restore()
        self._need_restore = 1
        self._system.picassoMode(True)
        return
Ejemplo n.º 10
0
    def _connect(self,
                 port_param=1,
                 rs232_baud_param=9600,
                 skip=False,
                 **kwargs):
        code = 0
        if (skip == False):
            self.disconnect()
            self.it.disconnect()  # disconnect it serial port
            if rs232_baud_param == 0:
                baud, success = self.it.connect(port_param, 0)
                print baud, success
                if success != 'Connected':
                    return (baud, success)
                rs232_baud_param = baud
                self.it.disconnect()  # disconnect it serial port
            code = self._open_rs232_port(port_param, rs232_baud_param)
            if (code != 0):
                return (code, Utility.ERROR_CODES[code])
            # Sucessfully connected.
        self._system = System.System()
        #self._logger = Logger.Logger()     #pb may be commented out
        ###

        (result_detect_mode, firmware_version) = self._system.detectMode()
        if (result_detect_mode == 0):
            code = -501
            return (code, 'Laser not detected')
        ###
        self._firmware_version = firmware_version
        #self._logger.bridgeFile(System.bridgePath(firmware_version))   #pb may be commented out

        dm = Dictionary.DictionaryManager()
        self._dictionary_manager = dm

        if not dm.shelf(System.bridgePath(firmware_version)):
            print "Unable to find bridge files in " + System.bridgePath(
                firmware_version)
            code = -500
            return (code, 'Firmware version [%s] not supported.' %
                    (firmware_version))

        self.it.setupFromTMode(True)

        self._root_dictionary = dm.rootDictionary()
        d = Dictionary.Dictionary()

        # Give it a valid memory object
        d.memory(dm.dictionary('SYSTEM_DICTIONARY').memory())
        d.addEntry('system', dm.dictionary('SYSTEM_DICTIONARY'))

        # Some firmware version may not have this dictionary
        try:
            d.addEntry('ipc_defaults', dm.dictionary('IPC_DICTIONARY'))
        except:
            pass

        if self.it.getLaserType() == 5:  # FIXME: why is this None?
            self.type = 2
        else:
            self.type = 0
        self._system.dictionary(d)
        self._sample_stage = Sample.SampleStage()
        self._domain_stage = Domain.DomainStage(self.type)
        self._domain_stage.dictionary(dm.dictionary('DOMAIN_DICTIONARY'))
        self._control_stage = Control.ControlStage(dm)
        self._tuner = Tuner.TunerManager(self, dm)
        self._discrete_stage = Discrete.DiscreteStage()
        self._discrete_stage.dictionary(dm.dictionary('DISCRETE_DICTIONARY'))
        self._side_mode_balancer = SideModeBalancer.SideModeBalancer()
        self._side_mode_balancer.dictionary(
            dm.dictionary('SIDE_MODE_BALANCER_DICTIONARY'))
        self._ambient_compensator = AmbientCompensator.AmbientCompensator()
        self._ambient_compensator.dictionary(
            dm.dictionary('AMBIENT_COMPENSATOR_DICTIONARY'))
        self._modem = MODEM.MODEM()
        self._modem.dictionary(dm.dictionary('MODEM_DICTIONARY'))
        self._health = Health.Health()
        self._health.dictionary(dm.dictionary('HEALTH_DICTIONARY'))
        self.shortcut_definition()
        #pb self._dictionary_manager.restore()
        self._need_restore = 1
        return (code, '%s %s' % (Utility.ERROR_CODES[code], firmware_version))
Ejemplo n.º 11
0
rules_inph = rulesh[['Medicine', 'Physical Exercise', 'Ext Temperature']]
# rules_inps = ruless[['Location','Mobility','Environment']]
rules_outw = rulesw[['Colors']]
# rules_outh = rulesh[['Colors']]
# rules_outs = ruless[['Colors']]

# Remove comments depending on which aspect wants to be evaluated
## Wellbeing
in_valueswb = Wellbeing(in_values_wellbeing["visits"],
                        in_values_wellbeing["mind_exercise"],
                        in_values_wellbeing["familyint"])

print(in_valueswb.mv_wellbeing())

## Health
in_valuesh = Health(in_values_health["med"], in_values_health["p_exercise"],
                    in_values_health["temp"])
print(in_valuesh.mv_health())

## Security
# in_valuess = Security(in_values_security["loc"],
#               in_values_security["mob"],
#             in_values_security["env"])
# print(in_valuess.mv_security())

## For each aspect the MCGDM and FCS classes are called below

### Wellbeing ####
# wellbeing= MCGDM(inputs_wellbeing, rules_inpw, in_valueswb.mv_wellbeing(), rules_outw)
# print(wellbeing.weight()[0])
# print(wellbeing.weight()[1])
Ejemplo n.º 12
0
# generate an event 30 times a second, and perform simulation update. this
# keeps the game running at the same speed in framerate-independent fashion.
# map stuff
UPDATE = pygame.USEREVENT
pygame.time.set_timer(UPDATE, int(1000.0 / 30))
obstacles, obstacleRects, aiRects = load_map()
# declaring variables
clock = pygame.time.Clock()
dancer = Dancer(0, 20)
player = Player(200, 200)
enemy_list = [Enemy(800,350), Enemy(1500,450), Enemy(2400,350), Enemy(3350,350), \
              Enemy(4000, 450), Enemy(4600, 350),Enemy(5300, 450), Enemy(5600, 350), \
              Enemy(6000, 350), Enemy(6600, 450), Enemy(7800, 350), Enemy(8700,450), \
              Enemy(9600,450), Enemy(11400,450), Enemy(11800,450), Enemy(12450,350)]
tigerwoods = TigerWoods(15500, 300)
healthBar = Health(20, 20)
health = 12
playing = True
# player shots/damage
shots = []
fired = False
cooldown = 1000
firetime = 0
i_timer = 0
# enemy shots
shots_e = []
fired_e = False
cooldown_e = 1000
firetime_e = 0
dt = 16
# tiger shots
Ejemplo n.º 13
0
            # i+=1
grid_wellbeing.to_csv('grid_finalwb.csv')



###### Grid Health #####
n=0
grid_health= pd.DataFrame(columns=['Medicine','Physical Exercise','Ext Temperature','Color MCGDM','Weight MCGDM','Color FCS','MV FCS'])
for meds in range(0,100,5):
    print(meds)
    for pressure in range(0,120,6):
        print(pressure)
        for btemp in range(0,40,2):                
            in_values_health = {"med": meds/100,"press": pressure/120,"b_temp": btemp/50}  
            in_valuesh = Health(in_values_health["med"],
                                    in_values_health["press"],
                                    in_values_health["b_temp"])
            healthm= MCGDM(inputs_health, rules_inph, in_valuesh.mv_health(), rules_outh)
            healthf= FCS(inputs_health, rules_inph, in_valuesh.mv_health(), rules_outh)
            grid_health.loc[len(grid_health)] = [meds,pressure, btemp, healthm.weight()[0],healthm.weight()[1],healthf.color(),healthf.defuzzification()]
            n+=1
            print(n)
            # i+=1
grid_health.to_csv('grid_finalhealth.csv')






Ejemplo n.º 14
0
# generate an event 30 times a second, and perform simulation update. this
# keeps the game running at the same speed in framerate-independent fashion.
# map stuff
UPDATE = pygame.USEREVENT
pygame.time.set_timer(UPDATE, int(1000.0/30))
obstacles, obstacleRects, aiRects = load_map() 
# declaring variables
clock = pygame.time.Clock()
dancer = Dancer(0, 20)
player = Player(200,200)
enemy_list = [Enemy(800,350), Enemy(1500,450), Enemy(2400,350), Enemy(3350,350), \
              Enemy(4000, 450), Enemy(4600, 350),Enemy(5300, 450), Enemy(5600, 350), \
              Enemy(6000, 350), Enemy(6600, 450), Enemy(7800, 350), Enemy(8700,450), \
              Enemy(9600,450), Enemy(11400,450), Enemy(11800,450), Enemy(12450,350)]
tigerwoods = TigerWoods(15500,300)
healthBar = Health(20, 20)
health = 12
playing = True
# player shots/damage
shots = []
fired = False
cooldown = 1000
firetime = 0
i_timer = 0
# enemy shots
shots_e = []
fired_e = False
cooldown_e = 1000
firetime_e = 0
dt = 16
# tiger shots
Ejemplo n.º 15
0
 def create(**kwargs):
     return Health(**kwargs)