diff --git a/asciiquarium_ng.py b/asciiquarium_ng.py index b74e7b0..aa3edfe 100755 --- a/asciiquarium_ng.py +++ b/asciiquarium_ng.py @@ -594,15 +594,23 @@ class Aquarium: if going_right: shape = sr mask = _rand_color(mr) - x = 1 - max(len(l) for l in shape) + x_offscreen = 1 - max(len(l) for l in shape) else: shape = sl mask = _rand_color(ml) - x = self.cols - 2 + x_offscreen = self.cols - 2 height = len(shape) + width = max(len(l) for l in shape) y = random.randint(9, max(10, self.rows - height)) + # Initial population (dead=None): start already on-screen so the + # aquarium is immediately populated. Respawned fish enter from edges. + if dead is None: + x = random.randint(0, max(0, self.cols - width)) + else: + x = x_offscreen + def on_death(fish, aq): if random.random() < 0.03: aq.add_bubble(fish) @@ -806,9 +814,9 @@ BBBB BBBBB going_right = random.random() < 0.5 speed = 1.0 * (1 if going_right else -1) - spout_align = 11 if not going_right else 1 - body_str = body_r if not going_right else body_l - mask_str = mask_r_str if not going_right else mask_l_str + spout_align = 11 if going_right else 1 + body_str = body_r if going_right else body_l + mask_str = mask_r_str if going_right else mask_l_str x = -18 if going_right else self.cols - 2 frames, masks = [], []