From 6adc38c35c306d73737d69259ad6f9a052e30af0 Mon Sep 17 00:00:00 2001 From: Crizomb Date: Tue, 30 Dec 2025 18:45:50 +0100 Subject: [PATCH] minor adjusts + screen match map size --- src/camera.rs | 2 +- src/main.rs | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/camera.rs b/src/camera.rs index d780b0e..3899600 100644 --- a/src/camera.rs +++ b/src/camera.rs @@ -39,7 +39,7 @@ pub fn camera_shake( child_translation -= child_translation * parent.shaking_reset_speed * time.delta_secs(); child_transform.translation.x = child_translation.x; child_transform.translation.y = child_translation.y; - println!("{:?}", child_transform.translation); + // println!("{:?}", child_transform.translation); } pub struct MyCameraPlugin; diff --git a/src/main.rs b/src/main.rs index e6488b3..08b879e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,5 +1,6 @@ use animation::animate_sprite; use bevy::prelude::*; +use bevy::window::WindowResolution; use bubble::{bubble_move, bubble_spawn}; use camera::spawn_camera; use density_grid::{DensityGrid, density_grid_force, density_grid_update, init_density_object}; @@ -26,16 +27,26 @@ mod map; mod physics_body; mod sphere_collider; +const MAP_SIZE: u32 = 1000; + fn main() { App::new() - .add_plugins(DefaultPlugins.set(ImagePlugin::default_nearest())) + .add_plugins(DefaultPlugins.set(ImagePlugin::default_nearest()).set(WindowPlugin { + primary_window: Some(Window { + resolution: WindowResolution::new(MAP_SIZE, MAP_SIZE), + title: "Kirby Bubble Massacre".into(), + resizable: false, + ..default() + }), + ..default() + })) .add_plugins(CounterPlugin) .add_plugins(KirbyPlugin) .add_plugins(DensityGridPlugin) .add_plugins(BubblePlugin) .add_plugins(MyCameraPlugin) .insert_resource(Time::::from_seconds(1.0 / 60.0)) - .insert_resource(MapBounds { min: Vec2::ONE * -600.0, max: Vec2::ONE * 600.0 }) + .insert_resource(MapBounds { min: -Vec2::ONE * MAP_SIZE as f32 / 2.0, max: Vec2::ONE * MAP_SIZE as f32 / 2.0 }) .add_systems(Update, animate_sprite) .add_systems(FixedUpdate, bubble_receive_damage) .add_systems(FixedUpdate, kirby_receive_damage)