This commit is contained in:
CoCo_Sol 2024-02-26 23:05:26 +01:00
parent 92d3484d03
commit 9c2c374bcf
4 changed files with 32 additions and 1 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 367 KiB

View file

@ -0,0 +1,21 @@
//! TODO
use bevy::prelude::*;
/// TODO
pub struct CameraPlugin;
impl Plugin for CameraPlugin {
fn build(&self, app: &mut App) {
app.add_systems(Startup, init_camera);
}
}
/// TODO
fn init_camera(mut commands: Commands) {
commands.spawn(Camera2dBundle::default());
}
fn movement_system(){}
fn zoom_system(){}

View file

@ -4,6 +4,7 @@ use bevy::prelude::*;
pub mod map; pub mod map;
pub mod scenes; pub mod scenes;
pub mod camera;
/// The current scene of the game. /// The current scene of the game.
#[derive(Debug, Clone, Copy, Default, Eq, PartialEq, Hash, States)] #[derive(Debug, Clone, Copy, Default, Eq, PartialEq, Hash, States)]

View file

@ -1,11 +1,20 @@
//! The main entry point of the game. //! The main entry point of the game.
use bevy::prelude::*; use bevy::prelude::*;
use border_wars::scenes::ScenesPlugin; use border_wars::{camera::CameraPlugin, scenes::ScenesPlugin};
fn main() { fn main() {
App::new() App::new()
.add_plugins(DefaultPlugins) .add_plugins(DefaultPlugins)
.add_plugins(ScenesPlugin) .add_plugins(ScenesPlugin)
.add_plugins(CameraPlugin)
.add_systems(OnEnter(border_wars::CurrentScene::Game), init_shap)
.run(); .run();
} }
fn init_shap(mut commands: Commands, assets_server: Res<AssetServer>) {
commands.spawn(SpriteBundle{
texture: assets_server.load("caca.png").into(),
..Default::default()
});
}