#39 ajout d'un compost plus des ajouts mineurs de qualité de vie
This commit is contained in:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user