jprof/ludumdare26 — pull request #2 by hlatki (2013-04-27 23:05:28+00:00)
Title: Hannah

@jprof
Adds a rat that patrols on a horizontal line. You give it a starting position and the length of the path. Positive sends the rat to the right, negative to the left.

Sample usage:
@rat = Window.rat = Crafty.e 'Rat'
@rat.attr x: 200, y: 200, w:20, h:20
@rat.setPathLength 100
This will make the rat start patrolling at (200,200) and turn around at (300,200)

I still need to do some refactoring because the waiting mechanism is really hackish (sorry)