[Change] SetCamera() is called once again.
This commit is contained in:
parent
73210e0451
commit
3533f5c607
BIN
Unuk-QT/Unuk-QT
BIN
Unuk-QT/Unuk-QT
Binary file not shown.
@ -8,7 +8,7 @@ Player::Player(Map *mapArg) : Character(mapArg) {
|
||||
}
|
||||
|
||||
Player::~Player(void) {
|
||||
\
|
||||
|
||||
}
|
||||
|
||||
void Player::HandleInput(void) {
|
||||
@ -60,7 +60,7 @@ void Player::Update(void) {
|
||||
AddSpeachBubble("Woot, My name is Allanis, welcome to my home");
|
||||
|
||||
// For now The camera will be static.
|
||||
//SetCamera();
|
||||
SetCamera();
|
||||
}
|
||||
|
||||
void Player::SetName(string nameArg) {
|
||||
|
@ -137,9 +137,8 @@ void Character::Move(void) {
|
||||
tileX = ((x + (w / 2)) / TILE_WIDTH);
|
||||
tileY = ((y + (h / 2)) / TILE_HEIGHT);
|
||||
|
||||
// While we have a static camera, ensure that we do not go out
|
||||
// of the camera boundaries.
|
||||
if((x < 0) || (x + w) > levelWidth || (x + w) > SCREEN_WIDTH) x -= xVel;
|
||||
// Check collisions.
|
||||
if((x < 0) || (x + w) > levelWidth) x -= xVel;
|
||||
if(CheckTileCollisions()) x -= xVel;
|
||||
if(CheckEntityCollisions()) x -= xVel;
|
||||
//if(CheckCharacterCollisions()) x -= xVel;
|
||||
@ -148,9 +147,7 @@ void Character::Move(void) {
|
||||
tileX = ((x + (w / 2)) / TILE_WIDTH);
|
||||
tileY = ((y + (h / 2)) / TILE_HEIGHT);
|
||||
|
||||
// While we have a static camera, ensure that we do not go out
|
||||
// of the camera boundaries.
|
||||
if((y < 0) || (y + h) > levelHeight || (y + h) > SCREEN_HEIGHT) y -= yVel;
|
||||
if((y < 0) || (y + h) > levelHeight) y -= yVel;
|
||||
if(CheckTileCollisions()) y -= yVel;
|
||||
if(CheckEntityCollisions()) y -= yVel;
|
||||
if(CheckCharacterCollisions()) y -= yVel;
|
||||
|
Loading…
Reference in New Issue
Block a user