Skip to content

Commit

Permalink
Started Updating
Browse files Browse the repository at this point in the history
Not using bevy_egui, puffin_egui, egui and bevy-inspector-egui because of dep issues, need to readd them later
  • Loading branch information
Zac8668 committed Jan 27, 2025
1 parent 6e94603 commit 3c814ec
Show file tree
Hide file tree
Showing 12 changed files with 1,966 additions and 1,631 deletions.
3,046 changes: 1,692 additions & 1,354 deletions Cargo.lock

Large diffs are not rendered by default.

18 changes: 7 additions & 11 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,33 +7,29 @@ license = "PolyForm NonCommercial v1.0"
default-run = "astratomic"

[dependencies]
bevy = {version = "0.13", features =["file_watcher"]}
bevy-inspector-egui = "0.23"
bevy = {version = "0.15", features =["file_watcher"]}
rand = { version = "0.8", features = ["small_rng"] }
fastrand = "2.0"
async-channel = "2.1"
smallvec = "1.12"
itertools = "0.12"
itertools = "0.14"

serde = "1.0"
serde_derive = "1.0"
bincode = "1.3"
serde-big-array = "0.5"
ron = "0.8"
bevy-async-task = "1.4"
bevy_async_task = "0.4.0"

contour = "0.12"
bevy_rapier2d = { version = "0.25", features = [ "simd-stable", "debug-render-2d", "parallel" ] }
geo = "0.28"
contour = "0.13"
bevy_rapier2d = { version = "0.28", features = [ "simd-stable", "debug-render-2d", "parallel" ] }
geo = "0.29"
rotsprite = "0.1"

egui = "0.25"
bevy_egui = "0.25"
puffin = "0.19"
puffin_egui = "0.26"

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
bevy_dylib = "0.13"
bevy_dylib = "0.15"

# Optimize dependencies even in development
[profile.dev.package."*"]
Expand Down
6 changes: 3 additions & 3 deletions src/actors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pub fn fill_actors(
mut dirty_rects: ResMut<DirtyRects>,
materials: (Res<Assets<Materials>>, Res<MaterialsHandle>),
) {
let materials = materials.0.get(materials.1 .0.clone()).unwrap();
let materials = materials.0.get(&materials.1 .0).unwrap();

for actor in actors.iter() {
for x_off in 0..actor.width as i32 {
Expand All @@ -38,7 +38,7 @@ pub fn unfill_actors(
actors: Query<&Actor>,
materials: (Res<Assets<Materials>>, Res<MaterialsHandle>),
) {
let materials = materials.0.get(materials.1 .0.clone()).unwrap();
let materials = materials.0.get(&materials.1 .0).unwrap();

for actor in actors.iter() {
for x_off in 0..actor.width as i32 {
Expand Down Expand Up @@ -75,7 +75,7 @@ pub fn update_actors(
mut actors: Query<&mut Actor>,
materials: (Res<Assets<Materials>>, Res<MaterialsHandle>),
) {
let materials = materials.0.get(materials.1 .0.clone()).unwrap();
let materials = materials.0.get(&materials.1 .0).unwrap();

for mut actor in actors.iter_mut() {
let mut prev = actor.pos;
Expand Down
22 changes: 12 additions & 10 deletions src/animation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,20 @@ pub struct AnimationTimer(pub Timer);

fn animate_sprite(
time: Res<Time>,
mut query: Query<(&AnimationIndices, &mut AnimationTimer, &mut TextureAtlas)>,
mut query: Query<(&AnimationIndices, &mut AnimationTimer, &mut Sprite)>,
) {
for (indices, mut timer, mut sprite) in &mut query {
timer.tick(time.delta());
if timer.just_finished() {
sprite.index = if !(indices.first..=indices.last).contains(&sprite.index)
|| sprite.index == indices.last
{
indices.first
} else {
sprite.index + 1
};
if let Some(atlas) = &mut sprite.texture_atlas {
timer.tick(time.delta());
if timer.just_finished() {
atlas.index = if !(indices.first..=indices.last).contains(&atlas.index)
|| atlas.index == indices.last
{
indices.first
} else {
atlas.index + 1
};
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/camera.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ pub fn update_camera(
) {
let transform = query.single();
let mut camera_transform = camera_q.single_mut();
let dt = time.delta_seconds_f64();
let dt = time.delta_secs_f64();
tracking.update(transform.translation.xy(), dt);
camera_transform.translation = tracking.position.extend(2.0);
}
Expand Down
6 changes: 3 additions & 3 deletions src/consts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ pub const AUTOMATA_LAYER: f32 = 100.;
pub const RIGIDBODY_LAYER: f32 = 1000.;

//Buttons
pub const NORMAL_BUTTON: Color = Color::rgb(0.15, 0.15, 0.15);
pub const HOVERED_BUTTON: Color = Color::rgb(0.25, 0.25, 0.25);
pub const PRESSED_BUTTON: Color = Color::rgb(0.35, 0.75, 0.35);
pub const NORMAL_BUTTON: Color = Color::srgb(0.15, 0.15, 0.15);
pub const HOVERED_BUTTON: Color = Color::srgb(0.25, 0.25, 0.25);
pub const PRESSED_BUTTON: Color = Color::srgb(0.35, 0.75, 0.35);

//How much the rigidbody needs to be submerged to totally cut of gravity
//pub const STOP_RATE: f32 = 0.05;
Loading

0 comments on commit 3c814ec

Please sign in to comment.