SnakeGame

This commit is contained in:
e2hang
2025-12-30 19:59:45 +08:00
parent fd77d3aca9
commit 3734ffcc35
1319 changed files with 888365 additions and 0 deletions

21
blockade/Apple.h Normal file
View File

@@ -0,0 +1,21 @@
#ifndef APPLE_H_
#define APPLE_H_
#include <SDL3/SDL.h>
#include <random>
#include <ctime>
class Apple {
public:
Apple(int screenWidth, int screenHeight, int segmentSize);
void Spawn();
void Render(SDL_Renderer* renderer);
SDL_Point GetPos() const { return pos; }
private:
SDL_Point pos;
int segmentSize;
int screenW, screenH;
};
#endif