MCPcopy Create free account

hub / github.com/LanKuDot/MLGame / functions

Functions255 in github.com/LanKuDot/MLGame

↓ 1 callersFunctioncompile_script
Compile the script to an executable according to its file extension This function will load the corresponding language module according to
mlgame/crosslang/main.py:6
↓ 1 callersMethoddraw_gameobjects
Draw gameobjects to the given surface
games/snake/game/gamecore.py:68
↓ 1 callersMethoddraw_gameobjects
(self, surface)
games/arkanoid/game/gamecore.py:116
↓ 1 callersMethoddraw_gameobjects
(self, surface)
games/pingpong/game/gamecore.py:112
↓ 1 callersFunctionexecute
Parse the execution command and execute the game
mlgame/execution.py:18
↓ 1 callersFunctionget_command_parser
Generate an ArgumentParser for parse the arguments in the command line
mlgame/execution_command.py:9
↓ 1 callersFunctionget_init_args
* Get the initial arguments */
mlgame/crosslang/compile/cpp/include/mlgame_client.hpp:22
↓ 1 callersMethodget_keyboard_command
Get the command according to the pressed key
games/snake/game/snake.py:74
↓ 1 callersFunctionget_parser_from_dict
Generate `argparse.ArgumentParser` from `parser_config` @param parser_config A dictionary carries parameters for creating `ArgumentParser`.
mlgame/utils/argparser_generator.py:3
↓ 1 callersMethodget_recv_end_names
Get the name of all registered communication objects used for receiving @return A dictionary view objects containing the key of `_re
mlgame/communication.py:57
↓ 1 callersFunctionget_scene_info
* Receive the scene info sent from the game */
mlgame/crosslang/compile/cpp/include/mlgame_client.hpp:52
↓ 1 callersMethodgrow
Add a new snake body at the tail
games/snake/game/gameobject.py:87
↓ 1 callersMethodhit
Decrease 1 HP and change the color of image and return the remaining HP @return The remaining HP
games/arkanoid/game/gameobject.py:41
↓ 1 callersFunctionrect_collideline
Check if line segment intersects with a rect @param rect The Rect of the target rectangle @param line A tuple (Vector2, Vector2) represe
mlgame/gamedev/physics.py:99
↓ 1 callersMethodrecv_from_all_ml
Receive objects from all the ml processes
mlgame/communication.py:213
↓ 1 callersMethodrecv_from_game
Receive an object from the game process @return The received object
mlgame/communication.py:267
↓ 1 callersMethodreset
(self)
games/arkanoid/game/gameobject.py:36
↓ 1 callersMethodsend_all
Send object via all communication objects registered for sending @param obj The object to be sent
mlgame/communication.py:121
↓ 1 callersFunctionsend_command
* Send the game command to the game */
mlgame/crosslang/compile/cpp/include/mlgame_client.hpp:66
↓ 1 callersMethodserve
(self, platform_action: PlatformAction)
games/arkanoid/game/gameobject.py:131
↓ 1 callersMethodserve
Set the ball speed according to the action of ball serving
games/pingpong/game/gameobject.py:151
↓ 1 callersMethodset_comm_to_game
Set communication objects for communicating with game process @param recv_end The communication object for receiving objects from ga
mlgame/communication.py:230
↓ 1 callersMethodset_recv_end
Set the communication object for receiving @param comm_obj The communication object which has `recv` and `poll` function
mlgame/communication.py:139
↓ 1 callersMethodset_send_end
Set the communication object for sending @param comm_obj The communication object which has `send` function
mlgame/communication.py:150
↓ 1 callersMethodspeed_up
(self)
games/pingpong/game/gameobject.py:166
↓ 1 callersMethodstart
Start the loop for running the game
mlgame/loops.py:25
↓ 1 callersMethodstart
Start the loop for the game process
mlgame/loops.py:97
↓ 1 callersMethodstart_recv_obj_thread
Start a thread to keep receiving objects from the game
mlgame/communication.py:240
↓ 1 callersMethodstick_on_platform
(self, platform_centerx)
games/arkanoid/game/gameobject.py:128
↓ 1 callersMethodstop_client
Stop the client
mlgame/crosslang/ml_play.py:46
Method__call__
Invoke the registered target function This function is invoked by using the instance of FunctionDelegate as a function.
mlgame/utils/delegate.py:31
Method__hash__
(self)
mlgame/utils/enum.py:21
Method__init__
(self, init_pos, color)
games/snake/game/gameobject.py:31
Method__init__
(self)
games/snake/game/gameobject.py:60
Method__init__
(self)
games/snake/game/snake.py:10
Method__init__
(self)
games/snake/game/gamecore.py:25
Method__init__
Constructor
games/snake/ml/ml_play_template.py:6
Method__init__
(self, init_pos, *groups)
games/arkanoid/game/gameobject.py:11
Method__init__
(self, init_pos, *groups)
games/arkanoid/game/gameobject.py:31
Method__init__
(self, init_pos, play_area_rect: Rect, *groups)
games/arkanoid/game/gameobject.py:62
Method__init__
(self, difficulty, level: int)
games/arkanoid/game/arkanoid.py:6
Method__init__
(self, difficulty, level)
games/arkanoid/game/gamecore.py:22
Method__init__
Constructor
games/arkanoid/ml/ml_play_template.py:6
Method__init__
(self, init_pos: tuple, play_area_rect: pygame.Rect, side, color, *groups)
games/pingpong/game/gameobject.py:18
Method__init__
(self, init_pos_y, play_area_rect: pygame.Rect, *groups)
games/pingpong/game/gameobject.py:69
Method__init__
(self, difficulty, game_over_score: int)
games/pingpong/game/pingpong.py:6
Method__init__
(self, difficulty: Difficulty)
games/pingpong/game/gamecore.py:26
Method__init__
(self, side)
games/pingpong/ml/ml_play_manual.py:8
Method__init__
Constructor @param side A string "1P" or "2P" indicates that the `MLPlay` is used by which side.
games/pingpong/ml/ml_play_template.py:6
Method__init__
Generate the game configuration from the parsed command line arguments
mlgame/execution_command.py:86
Method__init__
Constructor @param ml_names A list containing the name of all ml clients @param saving_directory Specify the directory for s
mlgame/recorder.py:32
Method__init__
(self)
mlgame/recorder.py:101
Method__init__
(self, execution_cmd, game_cls, ml_names)
mlgame/loops.py:18
Method__init__
Constructor @param proc_name The name of the process @param execution_cmd A `ExecutionCommand` object that contains executio
mlgame/loops.py:62
Method__init__
(self, propty: GameMLModeExecutorProperty)
mlgame/loops.py:81
Method__init__
Constructor @param target_module The full name of the module to be executed in the process. The module must have `ml_
mlgame/loops.py:194
Method__init__
(self, propty: MLExecutorProperty)
mlgame/loops.py:215
Method__init__
Parse the game defined config and generate a `GameConfig` instance
mlgame/gameconfig.py:17
Method__init__
Constructor @param process_name The name of the process in which the error occurred @param message The error message
mlgame/exceptions.py:6
Method__init__
Constructor
mlgame/exceptions.py:48
Method__init__
Constructor
mlgame/exceptions.py:61
Method__init__
(self)
mlgame/communication.py:21
Method__init__
(self)
mlgame/communication.py:135
Method__init__
(self)
mlgame/communication.py:174
Method__init__
(self, ml_name)
mlgame/communication.py:226
Method__init__
Constructor @param game_executor_propty The property for the game executor @param ml_executor_proties A list of `MLExecutorP
mlgame/process.py:17
Method__init__
(self)
mlgame/utils/delegate.py:14
Method__init__
Constructor @param command_map A dict which maps the keys to the commands. The key of the dict is the key-code de
mlgame/gamedev/generic.py:19
Method__init__
Constructor @param update_interval The time interval in seconds for updating the FPS value
mlgame/gamedev/generic.py:57
Method__init__
Constructor
mlgame/crosslang/client.py:17
Method__init__
(self, script_execution_cmd, init_args, init_kwargs)
mlgame/crosslang/ml_play.py:9
Method__init__
(self, file, reason)
mlgame/crosslang/exceptions.py:9
Method__init__
Constructor
mlgame/crosslang/exceptions.py:20
Method__ne__
(self, other)
mlgame/utils/enum.py:15
Method__str__
(self)
mlgame/exceptions.py:54
Method__str__
(self)
mlgame/exceptions.py:67
Method__str__
(self)
mlgame/crosslang/exceptions.py:13
Method__str__
(self)
mlgame/crosslang/exceptions.py:26
Method_generate_next_value_
(name, start, count, last_values)
mlgame/utils/enum.py:4
Method_keep_recv_obj_from_game
Keep receiving object from the game and put it in the queue If the queue is full, the received object will be dropped.
mlgame/communication.py:249
Function_ml_process_entry_point
The real entry point of the ml process
mlgame/process.py:112
Method_read_stdout
Read the message from stdout of the client. If the message contains "__command__" header, it will be pushed to the command ob
mlgame/crosslang/client.py:53
Functionbounce_in_box
The alternative version of `bounce_in_box_ip`. The function returns the result instead of updating the value of `bounce_obj_rect` and `bounce
mlgame/gamedev/physics.py:235
Functionbounce_off
The alternative version of `bounce_off_ip`. The function returns the result instead of updating the value of `bounce_obj_rect` and `bounce_ob
mlgame/gamedev/physics.py:196
Methodcatch_ball_times
(self)
games/arkanoid/game/gamecore.py:142
Functioncollide_or_contact
Check if two sprites are colliding or contacting
mlgame/gamedev/physics.py:9
Functioncompile_script
Compile the script to an executable The exception will be raised when failed to compile the script. @param script_full_path The full pa
mlgame/crosslang/compile/cpp/main.py:13
Methodflush_to_file
(self)
mlgame/recorder.py:107
Methodget_FPS
Update and get the calculated FPS
mlgame/gamedev/generic.py:68
Methodget_coordinate_and_type
(string)
games/arkanoid/game/gamecore.py:42
Methodget_game_info
(self)
games/snake/game/snake.py:88
Methodget_game_info
Get the scene and object information for drawing on the web
games/arkanoid/game/arkanoid.py:77
Methodget_game_info
(self)
games/pingpong/game/pingpong.py:124
Methodget_game_progress
(self)
games/snake/game/snake.py:100
Methodget_game_progress
Get the position of game objects for drawing on the web
games/arkanoid/game/arkanoid.py:93
Methodget_game_progress
(self)
games/pingpong/game/pingpong.py:137
Methodget_game_result
(self)
games/snake/game/snake.py:111
Methodget_game_result
Get the game result for the web
games/arkanoid/game/arkanoid.py:108
Methodget_game_result
(self)
games/pingpong/game/pingpong.py:151
Methodget_keyboard_command
Get the command according to the pressed key command
games/arkanoid/game/arkanoid.py:63
← previousnext →101–200 of 255, ranked by callers