extends Node

#The time, in seconds, it should take for the character to grow up
export var SlipperyTime = 7.5

#How much less friction should the player have
export var FrictionFactor = 1.0 / 20.0
export var SpeedFactor = 3

func SlipperyRoutine(player, delta):	
	var elapsed = delta	
	
	while elapsed < SlipperyTime:
		player.get_node("Patins").visible = true	
		player.FRICTION_FACTORS.append(FrictionFactor)
		player.SPEED_FACTORS.append(SpeedFactor)
		elapsed += yield()
	
	player.get_node("Patins").visible = false	
	
func StartEffect(player):
	var rout = SlipperyRoutine(player, 0)
	return rout
	
