players

BasePlayer

class gobigger.players.base_player.BasePlayer(name=None)[source]

Player’s abstract class

eat(ball)[source]

Eat another ball

eject()[source]

Do sporulation

move(direction)[source]
Parameters:

direction <Vector2>: Given any point in a unit circle, the angle represents the direction, and the magnitude represents the acceleration

stop()[source]

stop moving

HumanPlayer

class gobigger.players.human_player.HumanPlayer(cfg, team_id, player_id, border, spore_settings, sequence_generator=None)[source]
add_balls(balls)[source]
Overview:

Add new avatars

Parameters:

balls <List[CloneBall] or CloneBall>: It can be a list or a single doppelganger

adjust()[source]
Overview:

Adjust all the balls controlled by the player, including two parts 1. Possible Rigid Body Collision 2. Possible ball-ball fusion

cal_centroid()[source]
Overview:

Calculate the centroid

eat(ball)[source]

Eat another ball

eject(direction=None)[source]
Overview:

All clones controlled by the player perform the spore-spitting action

Return:

<list>: list of new spores

get_balls()[source]
Overview:

Get all the balls of the current player

get_clone_num()[source]
Overview:

Get how many avatars the current player has

get_keys_sort_by_balls()[source]
Overview:

Sort by ball score from largest to smallest

Return:

<list>: list of names

get_total_score()[source]
Overview:

Get the total score of all balls of the current player

move(direction=None, duration=0.05)[source]
Overview:

Move all balls controlled by the player The main logic is

  1. Processing stopped state

  2. If it is stopping, control all balls to move closer to the center of mass

Parameters:

direction <Vector2>: A point in the unit circle duration <float>: time

Returns:

position <Vector2>: position after moving

score_decay()[source]
Overview:

The player’s balls’ scor will decay over time

split(direction=None)[source]
Overview:

All avatars controlled by the player perform splits, from large to small