Module Import alias Import alias Import alias identifier ImportFrom alias ImportFrom alias alias alias alias ClassDef bases AttributeLoad NameLoad attr NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults TupleLoad Num Num Num Num Num Num Num Num body Assert CompareGt NameLoad Num Str Assign NameStore TupleLoad Num Num Assign NameStore TupleLoad Num Num Assign NameStore Dict Num Num Num Dict Str Str NameLoad NameLoad Dict Str Str NameLoad TupleLoad Num Num Num Dict Str Str NameLoad TupleLoad Num Num Num Assign NameStore Dict Str Str Str Str NameLoad NameLoad NameLoad NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad NameLoad keyword NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr ListLoad NameLoad keyword AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr ListLoad NameLoad keyword AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr ListLoad NameLoad keyword AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults Num Num body Expr Str Assign NameStore BinOpAdd BinOpMult Call AttributeLoad NameLoad attr BinOpDiv AttributeLoad NameLoad attr Num Num Num Assign NameStore TupleLoad NameLoad NameLoad Assign NameStore Call NameLoad BinOpMult NameLoad BinOpMult Num BinOpAdd SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num Assign NameStore Call NameLoad BinOpMult NameLoad BinOpFloorDiv BinOpMult BinOpFloorDiv SubscriptLoad NameLoad Index Num Num SubscriptLoad NameLoad Index Num Num Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword NameLoad Assign SubscriptStore NameLoad ExtSlice Index Num Slice SubscriptStore NameLoad ExtSlice Index Num Slice Num Assign SubscriptStore NameLoad ExtSlice Slice Index Num SubscriptStore NameLoad ExtSlice Slice Index Num Num For NameStore Call NameLoad NameLoad body Assign NameStore BinOpMult Call AttributeLoad AttributeLoad NameLoad attr attr Num BinOpFloorDiv SubscriptLoad NameLoad Index Num Num Num Assign NameStore BinOpMult Call AttributeLoad AttributeLoad NameLoad attr attr Num BinOpFloorDiv SubscriptLoad NameLoad Index Num Num Num Assign SubscriptStore NameLoad Index TupleLoad NameLoad NameLoad Num For NameStore Call NameLoad NameLoad body Assign NameStore ListLoad If CompareGt NameLoad Num body Expr Call AttributeLoad NameLoad attr TupleLoad NameLoad BinOpSub NameLoad Num If CompareLt NameLoad BinOpSub SubscriptLoad NameLoad Index Num Num body Expr Call AttributeLoad NameLoad attr TupleLoad NameLoad BinOpAdd NameLoad Num If CompareGt NameLoad Num body Expr Call AttributeLoad NameLoad attr TupleLoad BinOpSub NameLoad Num NameLoad If CompareLt NameLoad BinOpSub SubscriptLoad NameLoad Index Num Num body Expr Call AttributeLoad NameLoad attr TupleLoad BinOpAdd NameLoad Num NameLoad If Call NameLoad NameLoad body Assign TupleStore NameStore NameStore SubscriptLoad NameLoad Index Call AttributeLoad AttributeLoad NameLoad attr attr Num BinOpSub Call NameLoad NameLoad Num If CompareEq SubscriptLoad NameLoad Index TupleLoad NameLoad NameLoad Num body Assign SubscriptStore NameLoad Index TupleLoad NameLoad NameLoad Num Assign SubscriptStore NameLoad Index TupleLoad BinOpAdd NameLoad BinOpFloorDiv BinOpSub NameLoad NameLoad Num BinOpAdd NameLoad BinOpFloorDiv BinOpSub NameLoad NameLoad Num Num Assign TupleStore NameStore NameStore TupleLoad NameLoad NameLoad Return Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore BinOpAdd AttributeLoad NameLoad attr Num Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr BinOpPow BinOpSub AttributeLoad NameLoad attr NameLoad Num If CompareLt NameLoad Num body AugAssignAdd AttributeStore NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Index Str Return NameLoad orelse Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Num keyword BinOpSub AttributeLoad NameLoad attr Num keyword Num Assign SubscriptStore AttributeLoad NameLoad attr Index TupleLoad SubscriptLoad AttributeLoad NameLoad attr Index Num SubscriptLoad AttributeLoad NameLoad attr Index Num Num decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Call AttributeLoad AttributeLoad NameLoad attr attr TupleLoad Num Num Num Expr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr TupleLoad Num Num Num TupleLoad Num BinOpDiv AttributeLoad NameLoad attr Num AttributeLoad NameLoad attr AttributeLoad NameLoad attr AugAssignAdd AttributeStore NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Index Str Expr Call AttributeLoad NameLoad attr NameLoad Assign TupleStore NameStore NameStore NameStore NameStore Call AttributeLoad NameLoad attr For NameStore Call NameLoad Call NameLoad NameLoad body Assign NameStore TupleLoad SubscriptLoad SubscriptLoad NameLoad Index NameLoad Index Num SubscriptLoad SubscriptLoad NameLoad Index NameLoad Index Num SubscriptLoad SubscriptLoad NameLoad Index NameLoad Index Num Assign NameStore TupleLoad SubscriptLoad NameLoad Index NameLoad SubscriptLoad NameLoad Index NameLoad Assign NameStore TupleLoad SubscriptLoad NameLoad Index NameLoad SubscriptLoad NameLoad Index NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr NameLoad NameLoad NameLoad AttributeLoad NameLoad attr decorator_list decorator_list If CompareEq NameLoad Str body Import alias identifier Assign NameStore Num Expr Call AttributeLoad NameLoad attr Assign NameStore Call NameLoad keyword Num keyword Num keyword Num Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad NameLoad attr Num Num Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Num Expr Call AttributeLoad NameLoad attr While NameLoad body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad If Call AttributeLoad NameLoad attr body Print Str Print Str Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr
N/A N/A base N/A pygame N/A numpy np raycast RayCastPlayer pygame.constants K_w K_a K_d K_s RaycastMaze N/A N/A base Game RayCastPlayer N/A N/A 
    Parameters
    ----------
    init_pos : tuple of int (default: (1,1))
        The position the player starts on in the grid. The grid is zero indexed.

    resolution : int (default: 1)
        This instructs the Raycast engine on how many vertical lines to use when drawing the screen. The number is equal to the width / resolution. 

    move_speed : int (default: 20)
        How fast the agent moves forwards or backwards.

    turn_speed : int (default: 13)
        The speed at which the agent turns left or right.

    map_size : int (default: 10)
        The size of the maze that is generated. Must be greater then 5. Can be incremented to increase difficulty by adjusting the attribute between game resets.

    width : int (default: 48)
        Screen width.

    height : int (default: 48)
        Screen height, recommended to be same dimension as width.

     __init__ N/A N/A self init_pos resolution move_speed turn_speed map_size height width N/A N/A 1 1 1 20 13 10 48 48 N/A N/A N/A map_size 5 map_size must be gte 5 N/A init_dir N/A 1.0 0.0 N/A init_plane N/A 0.0 0.66 N/A block_types N/A 0 1 2 N/A pass_through color True None N/A pass_through color False N/A 255 255 255 N/A pass_through color False N/A 255 100 100 N/A actions N/A forward left right backward K_w K_a K_d K_s N/A N/A N/A N/A base Game __init__ self width height actions actions N/A N/A N/A RayCastPlayer __init__ self None init_pos init_dir width height resolution move_speed turn_speed init_plane actions block_types N/A N/A self init_pos N/A N/A np array N/A init_pos dtype N/A np float32 N/A N/A self init_dir N/A N/A np array N/A init_dir dtype N/A np float32 N/A N/A self init_plane N/A N/A np array N/A init_plane dtype N/A np float32 N/A N/A self obj_loc None N/A N/A self map_size map_size N/A _make_maze N/A N/A self complexity density N/A 0.75 0.75 N/A N/A 
            ty wikipedia?
         N/A dim N/A N/A N/A N/A np floor N/A N/A self map_size 2 2 1 N/A shape N/A dim dim N/A complexity N/A int N/A complexity N/A 5 N/A N/A shape N/A 0 N/A shape N/A 1 N/A density N/A int N/A density N/A N/A N/A N/A shape N/A 0 2 N/A shape N/A 1 2 N/A Z N/A N/A np zeros shape dtype bool N/A N/A Z N/A N/A 0 N/A N/A Z N/A N/A -1 N/A 1 N/A N/A Z N/A N/A N/A 0 N/A Z N/A N/A N/A -1 1 N/A i N/A range density N/A N/A x N/A N/A N/A N/A self rng random_integers 0 N/A N/A shape N/A 1 2 2 N/A y N/A N/A N/A N/A self rng random_integers 0 N/A N/A shape N/A 0 2 2 N/A N/A Z N/A N/A y x 1 N/A j N/A range complexity N/A N/A neighbours N/A N/A N/A x 1 N/A N/A N/A N/A neighbours append N/A y N/A x 2 N/A N/A x N/A N/A shape N/A 1 2 N/A N/A N/A N/A neighbours append N/A y N/A x 2 N/A N/A y 1 N/A N/A N/A N/A neighbours append N/A N/A y 2 x N/A N/A y N/A N/A shape N/A 0 2 N/A N/A N/A N/A neighbours append N/A N/A y 2 x N/A N/A len neighbours N/A N/A N/A y_ x_ N/A neighbours N/A N/A N/A N/A self rng random_integers 0 N/A N/A len neighbours 1 N/A N/A N/A Z N/A N/A y_ x_ 0 N/A N/A N/A Z N/A N/A y_ x_ 1 N/A N/A Z N/A N/A N/A y_ N/A N/A y y_ 2 N/A x_ N/A N/A x x_ 2 1 N/A N/A x y N/A x_ y_ N/A N/A N/A Z astype int N/A getGameState N/A N/A self N/A N/A N/A 

        Returns
        -------

        None
            Does not have a non-visual representation of game state.
            Would be possible to return the location of the maze end.

         N/A None N/A getScore N/A N/A self N/A N/A N/A N/A self score N/A game_over N/A N/A self N/A N/A N/A obj_loc N/A N/A self obj_loc 0.5 N/A dist N/A N/A np sqrt N/A N/A np sum N/A N/A N/A self pos obj_loc 2.0 N/A N/A dist 1.0 N/A N/A N/A self score N/A N/A self rewards N/A win N/A True N/A N/A False N/A init N/A N/A self N/A N/A N/A N/A self pos N/A N/A np copy N/A self init_pos N/A N/A self dir N/A N/A np copy N/A self init_dir N/A N/A self plane N/A N/A np copy N/A self init_plane N/A N/A self map_ N/A N/A self _make_maze N/A N/A self obj_loc N/A N/A N/A self rng randint 3 high N/A N/A self map_size 1 size 2 N/A N/A N/A self map_ N/A N/A N/A N/A self obj_loc N/A 0 N/A N/A self obj_loc N/A 1 2 N/A reset N/A N/A self N/A N/A N/A N/A N/A self init N/A step N/A N/A self dt N/A N/A N/A N/A N/A N/A self screen fill N/A 0 0 0 N/A N/A N/A N/A pygame draw rect N/A self screen N/A 92 92 92 N/A 0 N/A N/A self height 2 N/A self width N/A self height N/A N/A self score N/A N/A self rewards N/A tick N/A N/A N/A self _handle_player_events dt N/A N/A c t b col N/A N/A self draw N/A i N/A range N/A len c N/A N/A color N/A N/A N/A col N/A i N/A 0 N/A N/A col N/A i N/A 1 N/A N/A col N/A i N/A 2 N/A p0 N/A N/A c N/A i N/A t N/A i N/A p1 N/A N/A c N/A i N/A b N/A i N/A N/A N/A N/A pygame draw line N/A self screen color p0 p1 N/A self resolution N/A N/A N/A N/A __name__ __main__ N/A N/A numpy np N/A fps 60 N/A N/A N/A pygame init N/A game N/A RaycastMaze height 256 width 256 map_size 10 N/A N/A game screen N/A N/A N/A pygame display set_mode N/A N/A game getScreenDims 0 32 N/A N/A game clock N/A N/A N/A pygame time Clock N/A N/A game rng N/A N/A N/A np random RandomState 24 N/A N/A N/A game init N/A True N/A N/A dt N/A N/A N/A game clock tick_busy_loop fps N/A N/A N/A game game_over N/A N/A Game over! N/A Resetting! N/A N/A N/A game reset N/A N/A N/A game step dt N/A N/A N/A N/A pygame display update