forked from University/epr24pr42-ojanssen2
feat: finished implementing ghost, started working on infomodus
This commit is contained in:
parent
11ab3ee46d
commit
c856139997
17 changed files with 361 additions and 156 deletions
|
@ -1,5 +1,4 @@
|
|||
#include "../Util/PositionVector.h"
|
||||
|
||||
#include "../Util/Vector2d.h"
|
||||
|
||||
#ifndef ENTITY_H
|
||||
#define ENTITY_H
|
||||
|
@ -7,19 +6,60 @@
|
|||
namespace game
|
||||
{
|
||||
class Maze;
|
||||
/// Eine Entität, z.B. ein Geist
|
||||
class Entity {
|
||||
private:
|
||||
PositionVector pos;
|
||||
/// Die aktuelle Position des Geistes
|
||||
Vector2d pos;
|
||||
/// Wie der Geist dargestellt werden sollte
|
||||
char display_character;
|
||||
/// Ist wahr, wenn der Bowie nach Links läuft, falsch, wenn er nach Rechts läuft.
|
||||
bool move_left;
|
||||
|
||||
void handle_bowie(Maze& maze);
|
||||
void handle_connelly(Maze& maze, const PositionVector& player_position);
|
||||
/// Behandle Bowie Bewegungen
|
||||
/// @param maze Das Labyrinth
|
||||
void handle_bowie(const Maze& maze);
|
||||
|
||||
/// Behandle Connelly Bewegungen
|
||||
/// @param maze Das Labyrinth
|
||||
/// @param player_position Die Position des Spielers
|
||||
void handle_connelly(const Maze& maze, const Vector2d& player_position);
|
||||
|
||||
/// Versuche den Connelly nach oben zu bewegen
|
||||
/// @param maze Das Labyrinth
|
||||
/// @returns Ob die Bewegung geglückt hat
|
||||
bool connelly_move_up(const Maze& maze);
|
||||
|
||||
/// Versuche den Connelly nach unten zu bewegen
|
||||
/// @param maze Das Labyrinth
|
||||
/// @returns Ob die Bewegung geglückt hat
|
||||
bool connelly_move_down(const Maze& maze);
|
||||
|
||||
/// Versuche den Connelly nach links zu bewegen
|
||||
/// @param maze Das Labyrinth
|
||||
/// @returns Ob die Bewegung geglückt hat
|
||||
bool connelly_move_left(const Maze& maze);
|
||||
|
||||
/// Versuche den Connelly nach Rechts zu bewegen
|
||||
/// @param maze Das Labyrinth
|
||||
/// @returns Ob die Bewegung geglückt hat
|
||||
bool connelly_move_right(const Maze& maze);
|
||||
public:
|
||||
Entity(PositionVector starting_position, char display_character);
|
||||
void tick(Maze& maze, const PositionVector& player_position);
|
||||
bool is_at_position(const PositionVector& position) const;
|
||||
char get_display_character();
|
||||
Entity(Vector2d starting_position, char display_character);
|
||||
|
||||
/// Halte den Entität bzw. den Geist up to date, bewege ihn
|
||||
/// @param maze Das Labyrinth
|
||||
/// @param player_position Die Position des Spielers
|
||||
void tick(const Maze& maze, const Vector2d& player_position);
|
||||
|
||||
/// Kontrolliere, ob sich das Entity auf einer Position befindet
|
||||
/// @param position Die Position
|
||||
/// @returns Ob das sich das Entity auf der Position befindet
|
||||
bool is_at_position(const Vector2d& position) const;
|
||||
|
||||
/// Besorge dir das Zeichen, was auf dem Labyrinth angezeigt werden soll
|
||||
/// @returns Das Zeichen
|
||||
char get_display_character() const;
|
||||
};
|
||||
} // game
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue