moving map path generation into a function, and allowing extra actions. Also handling deaths