#39 ajout d'un compost plus des ajouts mineurs de qualité de vie

This commit is contained in:
2025-08-20 15:41:27 +02:00
parent 219e8258e7
commit 2f0c5a2be4
15 changed files with 454 additions and 17 deletions

View File

@@ -1,13 +1,13 @@
extends Resource
class_name TerrainData
const TERRAIN_IMAGE_GAME_FACTOR = 50
const TERRAIN_IMAGE_GAME_FACTOR = 40
const DEFAULT_CONTAMINATION_CENTRAL_ZONE_MAX_SIZE = 300
const DEFAULT_CONTAMINATION_CENTRAL_ZONE_MIN_SIZE = 50
signal terrain_updated
@export var terrainSize : Vector2 = Vector2(1500,1500)
@export var terrainSize : Vector2 = Vector2(1000,1000)
@export var contamination : Image = null
@@ -63,7 +63,10 @@ func impact_contamination(position : Vector2, impact_radius : int, to_value : fl
)
func get_contamination(point : Vector2) -> float:
var pixel_point : Vector2 = Vector2(point) / float(TERRAIN_IMAGE_GAME_FACTOR)
var pixel_point : Vector2 = (
Vector2(point) / float(TERRAIN_IMAGE_GAME_FACTOR)
- Vector2.ONE / 2
)
return contamination.get_pixel(
int(round(pixel_point.x)),
int(round(pixel_point.y))

View File

@@ -11,5 +11,8 @@ func is_one_time_use():
func can_use(_player : Player) -> bool:
return false
func use_requirement_text() -> String:
return ""
func use(_player : Player) -> bool:
return false