test-client-godot/scenes/Game/Box.gd
2018-07-25 16:12:12 +02:00

13 lines
No EOL
310 B
GDScript

extends RigidBody
var hit_timer = 0
func _process(delta):
if hit_timer >0:
hit_timer -= delta
if hit_timer <= 0:
$MeshInstance.get_surface_material(0).albedo_color = Color(1,1,1,1)
func hit():
$MeshInstance.get_surface_material(0).albedo_color = Color(1,0,0, 1)
hit_timer = 1