Wrath of Zeus
Made by Torchlight Games for CSE 125 SP24
Loading...
Searching...
No Matches
slime.hpp
Go to the documentation of this file.
2#include <chrono>
3
4using namespace std::chrono_literals;
5
6class Slime : public Enemy {
7public:
8 inline static const float SIGHT_LIMIT_GRID_CELLS = 8.0f; // can see you within 8 grid cells
9 int size;
10
11 Slime(glm::vec3 corner, glm::vec3 facing, int size);
12
13 bool doBehavior(ServerGameState& state) override;
14
15 bool doDeath(ServerGameState& state) override;
16
17 void doCollision(Object* other, ServerGameState& state) override;
18
19private:
20 std::vector<std::chrono::milliseconds> jump_intervals;
21 std::vector<float> jump_strengths;
22
23 std::chrono::system_clock::time_point last_jump_time;
24
25 void increaseJumpIndex();
26 std::size_t jump_index;
27
28 bool landed;
29};
Definition: enemy.hpp:8
Definition: object.hpp:95
The ServerGameState class contains all abstract game state data and logic for a single game state ins...
Definition: servergamestate.hpp:43
Definition: slime.hpp:6
static const float SIGHT_LIMIT_GRID_CELLS
Definition: slime.hpp:8
int size
Definition: slime.hpp:9
bool doBehavior(ServerGameState &state) override
Definition: slime.cpp:38
bool doDeath(ServerGameState &state) override
Definition: slime.cpp:125
void doCollision(Object *other, ServerGameState &state) override
Code to run when this object collides with another.
Definition: slime.cpp:111
GLsizeiptr size
Definition: glad.h:1803