Clean code challenge


func update(motion):
	if motion.y < 0: # Going up
		play("jump")
	elif motion.x > 0: # Going Right
		play("run")
		flip_h = false
	elif motion.x < 0: # Stage Left Even
		play("run")
		flip_h = true
	else:
		play("idle")

Privacy & Terms