22 lines
369 B
C++
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
|