This commit is contained in:
team3
2026-09-16 12:09:47 +02:00
parent 9b3cd55ba7
commit 7979d5c336
16 changed files with 974 additions and 342 deletions

View File

@@ -33,6 +33,8 @@ const PIPS := {
# damit ein Würfel nur ein einziges Renderobjekt ist.
static var _mesh: ArrayMesh
static var _mat: StandardMaterial3D
static var _gold: StandardMaterial3D ## fürs Zählen beim Aufdecken
var _body: MeshInstance3D
func _ready() -> void:
@@ -125,10 +127,22 @@ func _build_visuals() -> void:
# liegt der Glanzpunkt genau auf der Fläche und hellt die Augen auf.
_mat.roughness = 0.9
_mat.metallic_specular = 0.0
var body := MeshInstance3D.new()
body.mesh = _mesh
body.material_override = _mat
add_child(body)
if _gold == null:
# Vertexfarben bleiben, werden nur gold getönt - die Augen bleiben dunkel.
_gold = _mat.duplicate()
_gold.albedo_color = Color(1.0, 0.82, 0.35)
_gold.emission_enabled = true
_gold.emission = Color(0.9, 0.65, 0.2)
_gold.emission_energy_multiplier = 0.5
_body = MeshInstance3D.new()
_body.mesh = _mesh
_body.material_override = _mat
add_child(_body)
## Beim Zählen leuchtet jeder passende Würfel kurz auf.
func hervorheben(on: bool) -> void:
_body.material_override = _gold if on else _mat
# ------------------------------------------------------------ Zustand