Skip to content

Commit

Permalink
v0.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
BenjaTK committed Aug 26, 2023
1 parent ac721d1 commit 7ba9931
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions addons/gaea/generators/chunk_aware_generator.gd
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ var generated_chunks: Array[Vector2i] = []
func _ready() -> void:
if chunk_size == 0:
push_error("Chunk Size can not be 0!")

super._ready()


Expand All @@ -25,9 +25,9 @@ func erase_chunk(chunk_position: Vector2i, clear_tilemap := true) -> void:
for x in get_chunk_range(chunk_position.x):
for y in get_chunk_range(chunk_position.y):
grid.erase(Vector2(x, y))

if not clear_tilemap: continue
for l in range(tile_map.get_layers_count()):
for l in range(tile_map.get_layers_count()):
tile_map.erase_cell(l, Vector2(x, y))


Expand All @@ -36,7 +36,7 @@ func _apply_modifiers_chunk(modifiers: Array[Modifier], chunk_position: Vector2i
if not (modifier is ChunkAwareModifier):
push_error("%s is not a Chunk compatible modifier!" % modifier.resource_name)
continue

grid = modifier.apply_chunk(grid, self, chunk_position)


Expand All @@ -57,7 +57,7 @@ func has_chunk(chunk_position: Vector2i) -> bool:

func get_chunk_range(position: int) -> Array:
return range(
position * chunk_size,
position * chunk_size,
(position + 1) * chunk_size,
1
)
2 changes: 1 addition & 1 deletion addons/gaea/plugin.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
name="Gaea"
description="A procedural generation add-on for Godot 4.1"
author="BenjaTK"
version="0.2.0"
version="0.3.0"
script="plugin.gd"
2 changes: 1 addition & 1 deletion scenes/demos/heightmap/chunks_heightmap_demo.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ sources/0 = SubResource("TileSetAtlasSource_68jc8")
script = ExtResource("1_lqewx")
settings = SubResource("Resource_6hs11")
tile_map = NodePath("../TileMap")
regenerate_on_ready = false
generate_on_ready = null

[node name="TileMap" type="TileMap" parent="."]
tile_set = SubResource("TileSet_3y7im")
Expand Down

0 comments on commit 7ba9931

Please sign in to comment.