-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
93 additions
and
10 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
pub mod basic; | ||
pub mod buer; | ||
pub mod eyeball; | ||
pub mod slime; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
use crate::constant::*; | ||
use crate::controller::enemy::Enemy; | ||
use crate::entity::actor::{Actor, ActorFireState, ActorState}; | ||
use crate::entity::breakable::{Breakable, BreakableSprite}; | ||
use crate::entity::EntityDepth; | ||
use crate::hud::life_bar::{spawn_life_bar, LifeBarResource}; | ||
use crate::spell::SpellType; | ||
use crate::states::GameState; | ||
use crate::wand::{Wand, WandType}; | ||
use bevy::prelude::*; | ||
use bevy_aseprite_ultra::prelude::*; | ||
use bevy_rapier2d::prelude::*; | ||
use uuid::*; | ||
|
||
#[derive(Component)] | ||
pub struct Buer; | ||
|
||
pub fn spawn_buer(commands: &mut Commands, aseprite: Handle<Aseprite>, position: Vec2) { | ||
let mut slots = [None; MAX_SPELLS_IN_WAND]; | ||
// slots[0] = Some(spell); | ||
|
||
commands.spawn(( | ||
Name::new("buer"), | ||
StateScoped(GameState::InGame), | ||
Enemy, | ||
Buer, | ||
Actor { | ||
uuid: Uuid::new_v4(), | ||
spell_delay: 0, | ||
mana: 1000, | ||
max_mana: 1000, | ||
life: 15, | ||
max_life: 20, | ||
pointer: Vec2::ZERO, | ||
intensity: 0.0, | ||
move_direction: Vec2::ZERO, | ||
move_force: 0.0, | ||
fire_state: ActorFireState::Idle, | ||
group: ENEMY_GROUP, | ||
filter: ENTITY_GROUP | WALL_GROUP | WITCH_GROUP, | ||
current_wand: 0, | ||
effects: default(), | ||
wands: [ | ||
Some(Wand { | ||
wand_type: WandType::CypressWand, | ||
slots, | ||
index: 0, | ||
}), | ||
None, | ||
None, | ||
None, | ||
], | ||
}, | ||
ActorState::default(), | ||
EntityDepth, | ||
AsepriteAnimationBundle { | ||
aseprite: aseprite, | ||
animation: Animation::default().with_tag("idle"), | ||
transform: Transform::from_translation(position.extend(0.0)), | ||
..default() | ||
}, | ||
( | ||
RigidBody::Dynamic, | ||
Collider::ball(48.0), | ||
GravityScale(0.0), | ||
LockedAxes::ROTATION_LOCKED, | ||
Damping { | ||
linear_damping: 10.0, | ||
angular_damping: 1.0, | ||
}, | ||
ExternalForce::default(), | ||
ExternalImpulse::default(), | ||
ActiveEvents::COLLISION_EVENTS, | ||
CollisionGroups::new( | ||
ENEMY_GROUP, | ||
ENTITY_GROUP | WALL_GROUP | WITCH_GROUP | WITCH_BULLET_GROUP | ENEMY_GROUP, | ||
), | ||
), | ||
)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,8 +31,8 @@ pub enum GameEntity { | |
Routes, | ||
StoneLantern, | ||
Spell, | ||
Wand, | ||
Crate, | ||
Buer, | ||
} | ||
|
||
#[derive(Component)] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters