diff --git a/Uppgift-3-Spel/ghost.cc b/Uppgift-3-Spel/ghost.cc new file mode 100644 index 0000000000000000000000000000000000000000..703cecd6e17a4e811ea0bc361bc15bac52bc6f16 --- /dev/null +++ b/Uppgift-3-Spel/ghost.cc @@ -0,0 +1,51 @@ +#include "ghost.h" + +Ghost::Ghost(const string &colorName, Point const &start_position) + : color_index(colorName), pos(start_position) + {} + +void Ghost::set_pos( Point &new_pos) { + pos = new_pos; +} + +Point Ghost::get_pos() { + return pos; +} + +bool Blinky::get_angry(){ + return angry; +} + +void Blinky::set_angry(bool state) { + angry = state; +} + +Blinky::Blinky(std::string const &color, Point const &start_pos) + : Ghost("red", start_pos) + {} + +void Blinky::set_pos(Point &new_pos) { + set_pos(new_pos); +} + +Point Blinky::get_scatter(const Point &pos_pacman) { + if (angry == true) + { + return Point{pos_pacman.x, pos_pacman.y}; // stämmer? + } else + { + return Point{6, 6}; + } +} + +Point Blinky::get_chase(const Point &pos_pacman, const Point &dir_pacman) { + return Point{pos_pacman.x, pos_pacman.y}; +} + +Point Blinky::get_pos() { + return pos; +} + +std::string Blinky::get_color() { + return "pink"; +} \ No newline at end of file