wip
This commit is contained in:
parent
c203be7b2a
commit
7e2bdd5203
5 changed files with 1404 additions and 970 deletions
|
|
@ -35,7 +35,6 @@ impl PassThroughFilter {
|
|||
|
||||
#[derive(Bundle)]
|
||||
pub struct AbsorbingFilter {
|
||||
#[bundle]
|
||||
pub mesh: ColorMesh2dBundle,
|
||||
pub collider: Collider,
|
||||
pub sensor: Sensor,
|
||||
|
|
@ -70,7 +69,6 @@ pub fn spawn_absorbing_filter(
|
|||
|
||||
#[derive(Bundle)]
|
||||
pub struct RotatingFilter {
|
||||
#[bundle]
|
||||
pub sprite: SpriteBundle,
|
||||
pub collider: Collider,
|
||||
pub sensor: Sensor,
|
||||
|
|
|
|||
|
|
@ -64,9 +64,10 @@ impl Plugin for GamePlugin {
|
|||
}
|
||||
|
||||
// Events
|
||||
|
||||
#[derive(Event)]
|
||||
pub struct LevelStartupEvent;
|
||||
|
||||
#[derive(Event)]
|
||||
pub struct ChangeCharacterEvent;
|
||||
|
||||
// Resources
|
||||
|
|
|
|||
12
src/main.rs
12
src/main.rs
|
|
@ -18,8 +18,9 @@ use bevy::{
|
|||
use bevy_common_assets::json::JsonAssetPlugin;
|
||||
use bevy_rapier2d::prelude::*;
|
||||
|
||||
#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
|
||||
#[derive(Clone, Copy, Debug, Default, Eq, Hash, PartialEq, States)]
|
||||
enum AppState {
|
||||
#[default]
|
||||
Loading,
|
||||
Menu,
|
||||
Game,
|
||||
|
|
@ -51,10 +52,9 @@ fn main() {
|
|||
let (first_level, use_editor) = (game::LevelId(0), false);
|
||||
|
||||
let mut app = App::new();
|
||||
app.insert_resource(Msaa { samples: 4 })
|
||||
.insert_resource(WindowDescriptor {
|
||||
width: 640.0,
|
||||
height: 480.0,
|
||||
app.insert_resource(Default::default())
|
||||
.insert_resource(Window {
|
||||
resolution: (640., 480.).into(),
|
||||
resize_constraints: WindowResizeConstraints {
|
||||
min_width: 256.,
|
||||
min_height: 256.,
|
||||
|
|
@ -66,7 +66,7 @@ fn main() {
|
|||
..Default::default()
|
||||
})
|
||||
.insert_resource(UseEditor(use_editor))
|
||||
.add_state(AppState::Loading)
|
||||
.add_state::<AppState>()
|
||||
.insert_resource(game::FirstLevel(first_level))
|
||||
.insert_resource(ClearColor(Color::BLACK))
|
||||
.add_plugins(DefaultPlugins)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue