mirror of
https://github.com/dylanbenzi/terminaltrainers.git
synced 2026-11-27 07:47:01 +00:00
add movement collision detection to Sprite
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
#ifndef SPRITE_H
|
||||
#define SPRITE_H
|
||||
|
||||
#include "TileMap.h"
|
||||
|
||||
enum MOVEMENT_DIR {
|
||||
UP,
|
||||
DOWN,
|
||||
@@ -28,9 +30,9 @@ public:
|
||||
Sprite();
|
||||
|
||||
void render();
|
||||
void move();
|
||||
void move(MOVEMENT_DIR direction, TileMap& map);
|
||||
|
||||
void tryMove(int newX, int newY);
|
||||
bool canMove(MOVEMENT_DIR tryDirection, TileMap&& map);
|
||||
|
||||
int getX() const;
|
||||
int getY() const;
|
||||
|
||||
Reference in New Issue
Block a user