Files
workspace/cpp/blockade/Apple.h
e2hang ebcee63b7c New
2026-01-09 00:05:37 +08:00

22 lines
369 B
C++

#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