Simple quick way to do different attacks that play different shaders.
This commit is contained in:
parent
58981fd8ed
commit
bf8a2dc0c5
10 changed files with 25 additions and 18 deletions
|
@ -204,7 +204,7 @@ inline void animate_entity(DinkyECS::World &world, DinkyECS::Entity entity) {
|
|||
}
|
||||
}
|
||||
|
||||
void System::combat(GameLevel &level) {
|
||||
void System::combat(GameLevel &level, int attack_id) {
|
||||
auto &collider = *level.collision;
|
||||
auto &world = *level.world;
|
||||
auto player = world.get_the<Player>();
|
||||
|
@ -238,7 +238,7 @@ void System::combat(GameLevel &level) {
|
|||
};
|
||||
|
||||
if(result.player_did > 0) {
|
||||
auto effect = shaders::get("lightning");
|
||||
auto effect = shaders::get(attack_id == 1 ? "flame" : "lightning");
|
||||
world.set<SpriteEffect>(enemy.entity, {100, effect});
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue