Changed code to fix animation bug in enemies. Still not perfect.