10 enemies in demo
This commit is contained in:
@@ -12,12 +12,18 @@
|
||||
|
||||
#include <renderer/3d/mesh/dynamic/dynamic_mesh.hpp>
|
||||
#include <renderer/3d/pipeline/dynamic/dynpip_options.hpp>
|
||||
#include <renderer/3d/mesh/dynamic/animation_sequence_callback.hpp>
|
||||
#include "states/game/renderer/renderer_dynamic_pair.hpp"
|
||||
#include "states/game/terrain/heightmap.hpp"
|
||||
#include <renderer/renderer.hpp>
|
||||
#include <engine.hpp>
|
||||
#include "./enemy_info.hpp"
|
||||
|
||||
using Tyra::AnimationSequenceCallback;
|
||||
using Tyra::Audio;
|
||||
using Tyra::DynamicMesh;
|
||||
using Tyra::DynPipOptions;
|
||||
using Tyra::Engine;
|
||||
using Tyra::Renderer;
|
||||
using Tyra::TextureRepository;
|
||||
using Tyra::Vec4;
|
||||
@@ -26,7 +32,7 @@ namespace Demo {
|
||||
|
||||
class Enemy {
|
||||
public:
|
||||
Enemy(TextureRepository* repo);
|
||||
Enemy(Engine* engine, const EnemyInfo& info);
|
||||
~Enemy();
|
||||
|
||||
DynamicMesh* mesh;
|
||||
@@ -36,7 +42,19 @@ class Enemy {
|
||||
void update(const Heightmap& heightmap, const Vec4& playerPosition);
|
||||
|
||||
private:
|
||||
std::vector<u32> walkSequence;
|
||||
std::vector<u32> fightSequence;
|
||||
|
||||
void allocateOptions();
|
||||
void walk(const Heightmap& heightmap, const Vec4& positionDiff);
|
||||
void animationCallback(const AnimationSequenceCallback& callback);
|
||||
void fight();
|
||||
|
||||
bool isWalking = true;
|
||||
bool isFighting = false;
|
||||
|
||||
Audio* audio;
|
||||
EnemyInfo info;
|
||||
};
|
||||
|
||||
} // namespace Demo
|
||||
|
||||
Reference in New Issue
Block a user