MIGUEL IDLE ANIMATIONN
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
use animations::ShockingAnimationPlugin;
|
||||
use bevy::prelude::*;
|
||||
use bevy_ecs_ldtk::prelude::*;
|
||||
use bevy_rapier2d::plugin::{NoUserData, RapierConfiguration, RapierPhysicsPlugin, TimestepMode};
|
||||
@@ -8,6 +9,7 @@ use level_structure::{WallBundle, WallPlugin};
|
||||
use logging::log_positions;
|
||||
use player::PlayerPlugin;
|
||||
|
||||
mod animations;
|
||||
mod camera;
|
||||
mod colliders;
|
||||
mod goal;
|
||||
@@ -45,8 +47,9 @@ fn main() {
|
||||
.register_ldtk_int_cell::<WallBundle>(1)
|
||||
.add_systems(Startup, setup)
|
||||
.add_plugins(CameraPlugin)
|
||||
.add_plugins(ShockingAnimationPlugin)
|
||||
.add_systems(Update, (translate_grid_coords_entities, check_goal))
|
||||
.add_systems(Update, log_positions)
|
||||
// .add_systems(Update, log_positions)
|
||||
.run();
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,11 @@ use bevy::prelude::*;
|
||||
use bevy_ecs_ldtk::prelude::*;
|
||||
use bevy_rapier2d::dynamics::Velocity;
|
||||
|
||||
use crate::{colliders::ColliderBundle, ground_detection::GroundDetection};
|
||||
use crate::{
|
||||
animations::{AnimationIndices, AnimationTimer},
|
||||
colliders::ColliderBundle,
|
||||
ground_detection::GroundDetection,
|
||||
};
|
||||
|
||||
pub struct PlayerPlugin;
|
||||
|
||||
@@ -35,6 +39,10 @@ struct PlayerBundle {
|
||||
pub ground_detection: GroundDetection,
|
||||
#[from_entity_instance]
|
||||
pub collider_bundle: ColliderBundle,
|
||||
#[from_entity_instance]
|
||||
animation_timer: AnimationTimer,
|
||||
#[from_entity_instance]
|
||||
animation_indices: AnimationIndices,
|
||||
}
|
||||
|
||||
fn player_movement(
|
||||
@@ -72,5 +80,4 @@ fn player_movement(
|
||||
velocity.linvel.y = 500.;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user