game.isometric_map ================== .. py:module:: game.isometric_map .. autoapi-nested-parse:: Isometric map rendering and tile management. Classes ------- .. autoapisummary:: game.isometric_map.IsometricMap Module Contents --------------- .. py:class:: IsometricMap(map_file) Handles isometric map rendering and tile operations. .. py:attribute:: asset_loader .. py:attribute:: tiles .. py:attribute:: map_offset_x :value: 0 .. py:attribute:: map_offset_y :value: 0 .. py:attribute:: camera_offset_x :value: 0 .. py:attribute:: camera_offset_y :value: 0 .. py:attribute:: tile_id_mapping .. py:attribute:: partial_degradation_gid_map .. py:attribute:: full_degradation_gid_map .. py:attribute:: map_data_gids :value: [] .. py:attribute:: width .. py:attribute:: height .. py:attribute:: degradation_levels .. py:method:: randomize_land_tiles(seed=None) Re-distribute grass and forest across land tiles; island shape unchanged. .. py:method:: world_to_array(world_x, world_y) Converts world coordinates to map array indices. .. py:method:: array_to_world(array_x, array_y) Converts map array indices to world coordinates. .. py:method:: world_to_screen(world_x, world_y) Convert world coordinates (tile grid) to screen coordinates (pixels). .. py:method:: screen_to_world(screen_x, screen_y) Convert screen coordinates (pixels) to world coordinates (tile grid). .. py:method:: get_tile_type(x, y) Get the tile type (string) at given WORLD coordinates. .. py:method:: add_degradation(x, y, amount) Add degradation to a tile at WORLD coordinates. .. py:method:: get_degradation(x, y) Get degradation level at WORLD coordinates. .. py:method:: is_valid_position(x, y) Check if WORLD position is valid (within bounds and not water). .. py:method:: render(screen, bg_height=0) Render the isometric map using loaded tile images. .. py:method:: to_isometric(cart_x, cart_y) Convert Cartesian coordinates to isometric coordinates. .. py:method:: get_forest_tile_percentage() Calculates the percentage of tiles that are of the 'forest' type. .. py:method:: get_tile_properties(cart_x, cart_y) Get properties of the tile at given Cartesian coordinates.