I’m writing about this soon. https://github.com/mardie/samuraiGame