add basic shoot on enemy
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
#include <tyra>
|
||||
#include "states/game/renderer/renderer_dynamic_pair.hpp"
|
||||
#include "states/game/terrain/heightmap.hpp"
|
||||
#include "states/game/player/player_shoot_action.hpp"
|
||||
#include "./enemy_info.hpp"
|
||||
|
||||
using Tyra::AnimationSequenceCallback;
|
||||
@@ -35,7 +36,8 @@ class Enemy {
|
||||
DynPipOptions* options;
|
||||
RendererDynamicPair* pair;
|
||||
|
||||
void update(const Heightmap& heightmap, const Vec4& playerPosition);
|
||||
void update(const Heightmap& heightmap, const Vec4& playerPosition,
|
||||
const PlayerShootAction& shootAction);
|
||||
|
||||
private:
|
||||
std::vector<u32> walkSequence;
|
||||
@@ -45,9 +47,11 @@ class Enemy {
|
||||
void walk(const Heightmap& heightmap, const Vec4& positionDiff);
|
||||
void animationCallback(const AnimationSequenceCallback& callback);
|
||||
void fight();
|
||||
void handlePlayerShoot(const PlayerShootAction& shootAction);
|
||||
|
||||
bool isWalking = true;
|
||||
bool isFighting = false;
|
||||
Vec4 spawnPoint;
|
||||
|
||||
Audio* audio;
|
||||
EnemyInfo info;
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#include <tyra>
|
||||
#include <vector>
|
||||
#include "states/game/terrain/heightmap.hpp"
|
||||
#include "states/game/player/player_shoot_action.hpp"
|
||||
#include "./enemy.hpp"
|
||||
|
||||
using Tyra::DynamicMesh;
|
||||
@@ -28,7 +29,8 @@ class EnemyManager {
|
||||
EnemyManager(Engine* engine, const Heightmap& heightmap);
|
||||
~EnemyManager();
|
||||
|
||||
void update(const Heightmap& heightmap, const Vec4& playerPosition);
|
||||
void update(const Heightmap& heightmap, const Vec4& playerPosition,
|
||||
const PlayerShootAction& shootAction);
|
||||
|
||||
std::vector<RendererDynamicPair*> getPairs() const;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user