game.isometric_map

Isometric map rendering and tile management.

Classes

IsometricMap

Handles isometric map rendering and tile operations.

Module Contents

class game.isometric_map.IsometricMap(map_file)[source]

Handles isometric map rendering and tile operations.

asset_loader[source]
tiles[source]
map_offset_x = 0[source]
map_offset_y = 0[source]
camera_offset_x = 0[source]
camera_offset_y = 0[source]
tile_id_mapping[source]
partial_degradation_gid_map[source]
full_degradation_gid_map[source]
map_data_gids = [][source]
width[source]
height[source]
degradation_levels[source]
randomize_land_tiles(seed=None)[source]

Re-distribute grass and forest across land tiles; island shape unchanged.

world_to_array(world_x, world_y)[source]

Converts world coordinates to map array indices.

array_to_world(array_x, array_y)[source]

Converts map array indices to world coordinates.

world_to_screen(world_x, world_y)[source]

Convert world coordinates (tile grid) to screen coordinates (pixels).

screen_to_world(screen_x, screen_y)[source]

Convert screen coordinates (pixels) to world coordinates (tile grid).

get_tile_type(x, y)[source]

Get the tile type (string) at given WORLD coordinates.

add_degradation(x, y, amount)[source]

Add degradation to a tile at WORLD coordinates.

get_degradation(x, y)[source]

Get degradation level at WORLD coordinates.

is_valid_position(x, y)[source]

Check if WORLD position is valid (within bounds and not water).

render(screen, bg_height=0)[source]

Render the isometric map using loaded tile images.

to_isometric(cart_x, cart_y)[source]

Convert Cartesian coordinates to isometric coordinates.

get_forest_tile_percentage()[source]

Calculates the percentage of tiles that are of the ‘forest’ type.

get_tile_properties(cart_x, cart_y)[source]

Get properties of the tile at given Cartesian coordinates.