From 7f53d68e8dd1ba9fddb838380d21bba61b083676 Mon Sep 17 00:00:00 2001 From: pw6mfljci <2537107798@qq.com> Date: Mon, 17 Jun 2024 19:11:33 +0800 Subject: [PATCH] ADD file via upload --- food.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 food.h diff --git a/food.h b/food.h new file mode 100644 index 0000000..90e3119 --- /dev/null +++ b/food.h @@ -0,0 +1,22 @@ +#pragma once + +#include "common.h" +#include "Snake.h" + +class Food +{ +private: + Point m_pos; + bool m_state; + +public: + Food(); + + bool getState(); + void setState(bool state); + Point getPos(); //获取食物坐标 + + void Generate(Snake* snake);//产生新的食物 + + void DrawFood(); +}; \ No newline at end of file