test-client-godot/scenes/Game/Box.gd

13 lines
310 B
GDScript3
Raw Normal View History

2018-07-25 14:12:12 +00:00
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