Added animation constructor.

nit: Use instanceof.