MCPcopy Create free account

hub / github.com/LanKuDot/MLGame / functions

Functions255 in github.com/LanKuDot/MLGame

↓ 4 callersMethodget_player_scene_info
Get the scene information to be sent to the player
games/snake/game/snake.py:68
↓ 4 callersFunctionline_intersect
Check if two line segments intersect @param line_a A tuple (Vector2, Vector2) representing both end points of line segment @p
mlgame/gamedev/physics.py:53
↓ 4 callersMethodmove
(self)
games/pingpong/game/gameobject.py:162
↓ 4 callersMethodrecord
Record the scene information and the command The received scene information will be stored in a list. @param scene_info_dic
mlgame/recorder.py:63
↓ 4 callersMethodrecv
Receive object from the specified communication object @param name The name of the communication object @param to_wait Wheth
mlgame/communication.py:81
↓ 4 callersMethodreset
(self)
mlgame/crosslang/ml_play.py:24
↓ 4 callersMethodsend
Send object via the specified communication object @param obj The object to be sent @param name The name of the communicatio
mlgame/communication.py:112
↓ 4 callersMethodsend_to_game
Send an object to the game process @param obj An object to be sent
mlgame/communication.py:275
↓ 4 callersMethodupdate
(self, scene_info)
mlgame/crosslang/ml_play.py:20
↓ 3 callersMethod__init__
(self, init_pos, play_area_rect: Rect, enable_slide_ball: bool, *groups)
games/arkanoid/game/gameobject.py:98
↓ 3 callersMethod_create_surface
(self)
games/arkanoid/game/gameobject.py:114
↓ 3 callersMethod_random_food_pos
Randomly set the position of the food
games/snake/game/gamecore.py:43
↓ 3 callersMethodget_scene_info
Get the current scene information
games/snake/game/gamecore.py:95
↓ 3 callersMethodget_scene_info
Get the scene information
games/arkanoid/game/gamecore.py:120
↓ 3 callersMethodget_scene_info
Get the scene information
games/pingpong/game/gamecore.py:115
↓ 3 callersMethodsend_to_ml
Send the object to the specified ml process
mlgame/communication.py:190
↓ 3 callersMethodstart
Start the loop for the machine learning process
mlgame/loops.py:223
↓ 3 callersMethodstick_on_platform
Stick on the either platform according to the status of `_serve_from_1P`
games/pingpong/game/gameobject.py:140
↓ 2 callersMethod__init__
(self, play_area_rect: pygame.Rect, enable_slide_ball: bool, *groups)
games/pingpong/game/gameobject.py:103
↓ 2 callersMethod_get_possible_head_pos
Get the possible head position according to the given action
games/snake/game/gameobject.py:122
↓ 2 callersMethod_ml_ready
Send a "READY" command to the game process
mlgame/loops.py:273
↓ 2 callersMethod_recv_from_client
Receive the command sent from the client
mlgame/crosslang/ml_play.py:35
↓ 2 callersMethod_wait_all_ml_ready
Wait until receiving "READY" commands from all ml processes
mlgame/loops.py:143
↓ 2 callersMethod_wait_ready
Wait for the ready command from the client
mlgame/crosslang/ml_play.py:27
↓ 2 callersFunctionclient_ready
* Inform the game that the client is ready for receiving the data */
mlgame/crosslang/compile/cpp/include/mlgame_client.hpp:36
↓ 2 callersMethodflush_to_file
Flush the stored objects to the file
mlgame/recorder.py:79
↓ 2 callersMethodget_ml_names
Get the name of all registered ml process
mlgame/communication.py:184
↓ 2 callersFunctionget_recorder
The helper function for generating a recorder object
mlgame/recorder.py:9
↓ 2 callersMethodis_body_pos
Check if there has a snake body at the given position
games/snake/game/gameobject.py:77
↓ 2 callersMethodmove
Move the snake according to the given action
games/snake/game/gameobject.py:96
↓ 2 callersMethodmove
(self)
games/arkanoid/game/gameobject.py:137
↓ 2 callersMethodpoll
Check whether the specified communication object has data to read @param name The name of the communication object
mlgame/communication.py:73
↓ 2 callersFunctionquit_or_esc
Check if the quit event is triggered or the ESC key is pressed.
mlgame/gamedev/generic.py:4
↓ 2 callersMethodrecv_from_client
Receive the command from the subprocess It will wait until there has command arrived.
mlgame/crosslang/client.py:46
↓ 2 callersMethodrecv_from_ml
Receive the object from the specified ml process If the received object is `MLProcessError`, raise the exception.
mlgame/communication.py:202
↓ 2 callersMethodsend_to_client
Send the dictionary object to the client The object will be converted into a string: "<header> <JSON_representation_of_dict_o
mlgame/crosslang/client.py:33
↓ 2 callersMethodstart
Start the processes The ml processes are spawned and started first, and then the main process executes the game process. Aft
mlgame/process.py:30
↓ 1 callersMethod__eq__
(self, other)
mlgame/utils/enum.py:7
↓ 1 callersMethod__init__
(self)
games/snake/game/gameobject.py:12
↓ 1 callersMethod__str__
(self)
mlgame/execution_command.py:140
↓ 1 callersMethod__str__
(self)
mlgame/utils/enum.py:18
↓ 1 callersMethod_ball_moving
(self)
games/arkanoid/game/gamecore.py:110
↓ 1 callersMethod_ball_moving
(self)
games/pingpong/game/gamecore.py:104
↓ 1 callersMethod_check_ball_hit_sprites
Get the first sprite in the `sprites` that the ball hits @param sprites An iterable object that storing the target sprites @
games/pingpong/game/gameobject.py:201
↓ 1 callersMethod_check_delay
Check if the timestamp of the received command is delayed
mlgame/loops.py:181
↓ 1 callersFunction_compile_non_py_script
Compile the non-python script and return the execution command for the script @return A list of command segments for executing the compiled
mlgame/execution.py:203
↓ 1 callersMethod_create_bricks
(self, level: int)
games/arkanoid/game/gamecore.py:41
↓ 1 callersMethod_create_moves
(self)
games/arkanoid/game/gamecore.py:35
↓ 1 callersMethod_create_pipes
Create communication pipes for processes
mlgame/process.py:61
↓ 1 callersMethod_create_scene
Import gameobjects to the scene and add them to the draw group
games/snake/game/gamecore.py:32
↓ 1 callersMethod_create_scene
(self)
games/arkanoid/game/gamecore.py:31
↓ 1 callersMethod_create_scene
(self)
games/pingpong/game/gamecore.py:35
↓ 1 callersMethod_create_surface
(self, color)
games/arkanoid/game/gameobject.py:17
↓ 1 callersMethod_create_surface
(self)
games/arkanoid/game/gameobject.py:73
↓ 1 callersMethod_create_surface
(self, side, color)
games/pingpong/game/gameobject.py:30
↓ 1 callersMethod_create_surface
(self)
games/pingpong/game/gameobject.py:79
↓ 1 callersMethod_create_surface
(self)
games/pingpong/game/gameobject.py:119
↓ 1 callersMethod_draw_screen
Draw the scene to the display
games/snake/game/snake.py:45
↓ 1 callersMethod_draw_screen
Draw the scene to the display
games/arkanoid/game/arkanoid.py:37
↓ 1 callersMethod_draw_screen
Draw the scene to the display
games/pingpong/game/pingpong.py:42
↓ 1 callersMethod_game_over
Check if the game is over
games/pingpong/game/pingpong.py:61
↓ 1 callersFunction_game_process_entry_point
The real entry point of the game process
mlgame/process.py:103
↓ 1 callersFunction_get_game_executor_propty
Get the property for the game executor in the ml mode
mlgame/execution.py:142
↓ 1 callersFunction_get_ml_executor_propties
Get the property for the ml executors @return A list of generated properties
mlgame/execution.py:156
↓ 1 callersFunction_list_games
List available games which provide "config.py" in the game directory.
mlgame/execution.py:74
↓ 1 callersMethod_load_game_config
Load the game config
mlgame/gameconfig.py:39
↓ 1 callersMethod_loop
The main loop for running the game
mlgame/loops.py:34
↓ 1 callersMethod_loop
The loop for sending scene information to the ml process, recevied the command sent from the ml process, and pass command to the game
mlgame/loops.py:110
↓ 1 callersMethod_loop
The loop for receiving scene information from the game, make ml class execute, and send the command back to the game.
mlgame/loops.py:240
↓ 1 callersMethod_make_ml_execute
Send the scene information to all ml processes and wait for commands @return A dict of the recevied command from the ml clients
mlgame/loops.py:152
↓ 1 callersFunction_parse_command_line
Parse the command line arguments If "-h/--help" or "-l/--list" flag is specfied, it will print the related message and exit the program.
mlgame/execution.py:33
↓ 1 callersMethod_parse_ml_scripts
Check whether the provided input scripts are all existing or not If it passes, the name of scripts is converted to the absolute impo
mlgame/execution_command.py:104
↓ 1 callersMethod_platform_additional_check
The additional checking for the condition that the ball passes the corner of the platform
games/arkanoid/game/gameobject.py:158
↓ 1 callersFunction_preprocess_script
Append the content of user script to "cpp_include/main.cpp" and save to a new file @param user_script_path The path of the user script as on
mlgame/crosslang/compile/cpp/main.py:47
↓ 1 callersMethod_print_result
Print the result
games/pingpong/game/pingpong.py:78
↓ 1 callersMethod_process_game_param_dict
Convert some fields in `GAME_PARAMS`
mlgame/gameconfig.py:57
↓ 1 callersMethod_process_game_setup_dict
Process the value of `GAME_SETUP` The `GAME_SETUP` is a dictionary which has several keys: - "game": Specify the class of th
mlgame/gameconfig.py:77
↓ 1 callersMethod_pygame_init
Initialize the required pygame module
games/snake/game/snake.py:14
↓ 1 callersMethod_pygame_init
Initial the pygame for drawing
games/arkanoid/game/arkanoid.py:10
↓ 1 callersMethod_pygame_init
(self)
games/pingpong/game/pingpong.py:13
↓ 1 callersMethod_pygame_init
(self)
games/pingpong/ml/ml_play_manual.py:13
↓ 1 callersMethod_read_stderr
Read the message from stderr of the client.
mlgame/crosslang/client.py:85
↓ 1 callersFunction_run_manual_mode
Execute the game specified in manual mode @param execution_cmd The `ExecutionCommand` object @param game_setup The `GAME_SETUP` defined
mlgame/execution.py:101
↓ 1 callersFunction_run_ml_mode
Execute the game specified in ml mode @param execution_cmd The `ExecutionCommand` object @param game_setup The `GAME_SETUP` defined in t
mlgame/execution.py:125
↓ 1 callersMethod_slice_ball
Check if the platform slices the ball, and modify the ball speed. @return The new x speed of the ball after slicing
games/arkanoid/game/gameobject.py:171
↓ 1 callersMethod_slice_ball
Check if the platform slices the ball, and modify the ball speed
games/pingpong/game/gameobject.py:215
↓ 1 callersMethod_start_game_process
Start the game process
mlgame/process.py:87
↓ 1 callersMethod_start_ml_processes
Spawn and start all ml processes
mlgame/process.py:76
↓ 1 callersMethod_terminate
Stop all spawned ml processes if it exists
mlgame/process.py:93
↓ 1 callersMethod_wait_for_serving_ball
(self, platform_action: PlatformAction)
games/arkanoid/game/gamecore.py:103
↓ 1 callersMethod_wait_for_serving_ball
(self, action_1P: PlatformAction, action_2P: PlatformAction)
games/pingpong/game/gamecore.py:89
↓ 1 callersMethodadd_comm_to_ml
Set communication objects for communicating with specified ml process
mlgame/communication.py:177
↓ 1 callersMethodadd_recv_end
Add a new communication object for receiving objects @param name The name for distinguishing the added object. It could be used to
mlgame/communication.py:25
↓ 1 callersMethodadd_send_end
Add a new communication object for sending objects @param name The name for distinguishing the added object. It could be used to
mlgame/communication.py:41
↓ 1 callersFunctionbounce_in_box_ip
Bounce the object if it hits the border of the box. The speed and the position of the `bounce_obj` will be updated. @param bounce_obj_re
mlgame/gamedev/physics.py:212
↓ 1 callersFunctionbounce_off_ip
Calculate the speed and position of the `bounce_obj` after it bounces off the `hit_obj`. The position of `bounce_obj_rect` and the value of `
mlgame/gamedev/physics.py:135
↓ 1 callersMethodcheck_bouncing
(self, platform: Platform)
games/arkanoid/game/gameobject.py:141
↓ 1 callersMethodcheck_bouncing
(self, platform_1p: Platform, platform_2p: Platform, blocker: Blocker)
games/pingpong/game/gameobject.py:170
↓ 1 callersMethodcheck_hit_brick
Check if the ball hits bricks in the `group_brick`. The hit bricks will be removed from `group_brick`, but the alive hard brick wil
games/arkanoid/game/gameobject.py:189
↓ 1 callersFunctionclient_reset
* Inform the game that the client is resetting */
mlgame/crosslang/compile/cpp/include/mlgame_client.hpp:44
next →1–100 of 255, ranked by callers