extends Area2D

export (Color) var water_color_1
export (Color) var water_color_2

var name = "water"


func _ready():
	get_node("sprite").set_modulate(water_color_1)
	get_node("splash").get_color_ramp().set_colors([water_color_1, water_color_1, water_color_1])

func _on_water_area_enter( pos ):
	get_node("splash").set_global_pos(Vector2(pos.x, get_pos().y))
	get_node("splash").set_emitting(true)
	audio.play_sound("water_splash")

func _on_water_area_exit( pos ):
	get_node("splash").set_global_pos(Vector2(pos.x, get_pos().y))
	get_node("splash").set_emitting(true)
	audio.play_sound("water_splash")