minor adjusts + screen match map size
This commit is contained in:
parent
329cd173b9
commit
6adc38c35c
2 changed files with 14 additions and 3 deletions
|
|
@ -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;
|
||||
|
|
|
|||
15
src/main.rs
15
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::<Fixed>::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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue