Example #1
0
                 state_of_game.switch(Close)
         for event in pygame.event.get():
                 if (event.type == pygame.QUIT) or (event.type == pygame.KEYUP and event.key == pygame.K_ESCAPE):
                         logger.log_to_excel()
                         drawing.graphics(logger.df)
                         exit()
         clock.tick(60)
         time_game = (pygame.time.get_ticks() - start_time) // 1000
         player.movement()
         [ball.movement() for ball in balls]
         walls = ray_casting(player, drawing.textures)
         drawing.fill(BLACK)
         drawing.background(player.angle)
         drawing.world(walls + [ball.locate(player, walls) for ball in balls])
         drawing.fps(clock)
         drawing.print_text('time:{}'.format(time_game), TIME_POS, BLACK, 32)
         drawing.mini_map(player, balls)
         pygame.display.flip()
         check_rules(balls, player, state_of_game)
         check_create_ball(img_ball, balls, time_game, sec)
         if (pygame.time.get_ticks() - temp_time)//1000 >= 1.0:
                 for ball in balls:
                         logger.log_to_data_frame(time_game, player, ball)
                 temp_time = pygame.time.get_ticks()
         sec += 1
 elif state_of_game.name == 'close':
         keys = pygame.key.get_pressed()
         if keys[pygame.K_RETURN]:
                 start_time = pygame.time.get_ticks()
                 balls = list()
                 player = Player()