cash and enemy spawnpoints

This commit is contained in:
2025-03-04 00:10:57 +01:00
parent 3c78b35a69
commit ded4c5084c
7 changed files with 148 additions and 59 deletions

View File

@@ -1,8 +1,7 @@
use avian3d::prelude::*;
use bevy::prelude::*;
use std::time::Duration;
const ASSET_PATH: &str = "models/alien_naked.glb";
pub const ALIEN_ASSET_PATH: &str = "models/alien_naked.glb";
#[derive(Resource)]
struct Animations {
@@ -22,8 +21,8 @@ fn setup(
) {
// Build the animation graph
let (graph, node_indices) = AnimationGraph::from_clips([
asset_server.load(GltfAssetLabel::Animation(1).from_asset(ASSET_PATH)),
asset_server.load(GltfAssetLabel::Animation(0).from_asset(ASSET_PATH)),
asset_server.load(GltfAssetLabel::Animation(1).from_asset(ALIEN_ASSET_PATH)),
asset_server.load(GltfAssetLabel::Animation(0).from_asset(ALIEN_ASSET_PATH)),
]);
// Insert a resource with the current scene information
@@ -32,18 +31,6 @@ fn setup(
animations: node_indices,
graph: graph_handle,
});
commands
.spawn((
RigidBody::Dynamic,
Collider::capsule(0.2, 1.),
LockedAxes::new().lock_rotation_z().lock_rotation_x(),
Name::from("Alien"),
))
.with_child((
Transform::from_translation(Vec3::new(0., -0.6, 0.)),
SceneRoot(asset_server.load(GltfAssetLabel::Scene(0).from_asset(ASSET_PATH))),
));
}
fn setup_once_loaded(