[Change] Collision is now only done with the lower quarter of the player's height.
This commit is contained in:
parent
0cbaf72395
commit
9650fda582
@ -12,7 +12,7 @@ LevelGen::~LevelGen(void) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void LevelGen::Load(const string filename) {
|
void LevelGen::Load(const string& filename) {
|
||||||
Unload();
|
Unload();
|
||||||
_currentMap = filename;
|
_currentMap = filename;
|
||||||
string fullMapPath = "../Data/Media/Maps/" + filename;
|
string fullMapPath = "../Data/Media/Maps/" + filename;
|
||||||
@ -310,9 +310,9 @@ void LevelGen::MoveIfPossible(Character* character, float xVel, float yVel, bool
|
|||||||
|
|
||||||
SDL_Rect charRect;
|
SDL_Rect charRect;
|
||||||
charRect.x = targetX;
|
charRect.x = targetX;
|
||||||
charRect.y = targetY + (character->GetHeight() / 2);
|
charRect.y = targetY + (character->GetHeight() / 4) * 3;
|
||||||
charRect.w = character->GetWidth();
|
charRect.w = character->GetWidth();
|
||||||
charRect.h = character->GetHeight() / 2;
|
charRect.h = character->GetHeight() / 4;
|
||||||
|
|
||||||
for(int x = 0; x < BOUNDARIES_X; x++) {
|
for(int x = 0; x < BOUNDARIES_X; x++) {
|
||||||
for(int y = 0; y < BOUNDARIES_Y; y++) {
|
for(int y = 0; y < BOUNDARIES_Y; y++) {
|
||||||
|
@ -24,7 +24,7 @@ public:
|
|||||||
LevelGen(void);
|
LevelGen(void);
|
||||||
~LevelGen(void);
|
~LevelGen(void);
|
||||||
|
|
||||||
void Load(const string filename);
|
void Load(const string& filename);
|
||||||
void Update(void);
|
void Update(void);
|
||||||
void Render(void);
|
void Render(void);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user