SnakeGame
This commit is contained in:
21
blockade/Apple.h
Normal file
21
blockade/Apple.h
Normal 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
|
||||
Reference in New Issue
Block a user