cash and enemy spawnpoints
This commit is contained in:
19
src/alien.rs
19
src/alien.rs
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user