[Change] Collision is now only done with the lower quarter of the player's height.

This commit is contained in:
Tamir Atias 2012-02-08 22:02:56 +02:00
parent 0cbaf72395
commit 9650fda582
2 changed files with 4 additions and 4 deletions

View File

@ -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++) {

View File

@ -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);