From bc9c7cd7f7f30dcd19acc77953d156b3fbff0fc2 Mon Sep 17 00:00:00 2001 From: Charles Peyrat Date: Fri, 4 Dec 2020 18:03:41 +0100 Subject: [PATCH] Finalised implementation of the walker class with method split --- dungeonbattle/mapgeneration/randomwalk.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dungeonbattle/mapgeneration/randomwalk.py b/dungeonbattle/mapgeneration/randomwalk.py index 3c42559..f0527b5 100644 --- a/dungeonbattle/mapgeneration/randomwalk.py +++ b/dungeonbattle/mapgeneration/randomwalk.py @@ -37,6 +37,11 @@ class Walker: if 0 < nx < width and 0 < ny < height: self.x, self.y = nx, ny + def split(): + child = Walker(self.x, self.y) + child.dir = self.dir + return child + class Generator: