From 878cec8c763f1e57acfaa46af4fbcd29f4c0e72c Mon Sep 17 00:00:00 2001 From: Gouvernathor <44340603+Gouvernathor@users.noreply.github.com> Date: Thu, 4 Apr 2024 22:37:33 +0200 Subject: [PATCH] Simplify some --- game/scripts/doll/chibi.rpy | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/game/scripts/doll/chibi.rpy b/game/scripts/doll/chibi.rpy index 885e0601..b1799010 100644 --- a/game/scripts/doll/chibi.rpy +++ b/game/scripts/doll/chibi.rpy @@ -274,10 +274,9 @@ init 5 python: return # Freezes the animation - path, _, _, _ = self.atl_partial.args - pos = path[-1] - xzoom = -1 if (path[-1] > path[-2]) else 1 - zpos = self.zorder + (1.0 / (pos[1] / config.screen_height)) + (*_, opos, pos), _, _, _ = self.atl_partial.args + xzoom = -1 if (pos > opos) else 1 + zpos = self.zorder + (config.screen_height / pos[1]) self.pos = pos self.xzoom = xzoom @@ -316,14 +315,16 @@ init 5 python: segment_time = (timer - internal_time) / times[current_segment] next_segment = current_segment + 1 + path_current_segment = path[current_segment] + path_next_segment = path[next_segment] # Adjust XY position - trans.pos = renpy.atl.interpolate(warper(segment_time), path[current_segment], path[next_segment], renpy.atl.PROPERTIES["pos"]) + trans.pos = renpy.atl.interpolate(warper(segment_time), path_current_segment, path_next_segment, renpy.atl.PROPERTIES["pos"]) self.pos = trans.pos # Adjust X zoom based on target X position # 1 = Facing Right, -1 = Facing Left - trans.xzoom = 1 if (path[current_segment][0] > path[next_segment][0]) else -1 + trans.xzoom = 1 if (path_current_segment[0] > path_next_segment[0]) else -1 self.xzoom = trans.xzoom # Adjust zoom @@ -332,13 +333,13 @@ init 5 python: # Adjust Z position based on Y axis # TODO: Add room support with bottom, middle, and top vanishing points. # room_scale = 0.5 - # zpos1 = ((path[current_segment][1] / 600.0) * 1000.0) * room_scale - # zpos2 = ((path[next_segment][1] / 600.0) * 1000.0) * room_scale + # zpos1 = ((path_current_segment[1] / 600.0) * 1000.0) * room_scale + # zpos2 = ((path_next_segment[1] / 600.0) * 1000.0) * room_scale # trans.zpos = renpy.atl.interpolate(warper(segment_time), zpos1, zpos2, renpy.atl.PROPERTIES["zpos"]) # self.zpos = trans.zpos # TODO: Using zorders is suboptimal and expensive, using 3D staging would be preferable. - zpos = self.zorder + (1.0 / (self.pos[1] / config.screen_height)) + zpos = self.zorder + (config.screen_height / self.pos[1]) renpy.change_zorder(self.layer, self.tag, zpos) return 0