From 4f232d73616cf6b4d74fce61d85627a95eaee36f Mon Sep 17 00:00:00 2001 From: Kyren223 Date: Sat, 26 Jul 2025 12:51:53 +0300 Subject: [PATCH] Fixed battle camera --- src/main.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.zig b/src/main.zig index b71b5f8..fff3c4d 100644 --- a/src/main.zig +++ b/src/main.zig @@ -557,7 +557,7 @@ const ScreenBattle = struct { .y = @as(f32, @floatFromInt(screenHeight)) / 2, }, .rotation = 0, - .zoom = 0, + .zoom = @as(f32, @floatFromInt(screenHeight)) / world_height, }, .ram = max_ram, }; @@ -590,7 +590,7 @@ const ScreenBattle = struct { // in order to see more terrain in a certain axis const width_ratio = @as(f32, @floatFromInt(screenWidth)) / world_width; const height_ratio = @as(f32, @floatFromInt(screenHeight)) / world_height; - self.camera.zoom = -(width_ratio + height_ratio); + self.camera.zoom = (width_ratio + height_ratio) / 2; } fn render(self: *ScreenBattle, game: *Game) void {