[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) {
|
Player::~Player(void) {
|
||||||
\
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Player::HandleInput(void) {
|
void Player::HandleInput(void) {
|
||||||
@ -60,7 +60,7 @@ void Player::Update(void) {
|
|||||||
AddSpeachBubble("Woot, My name is Allanis, welcome to my home");
|
AddSpeachBubble("Woot, My name is Allanis, welcome to my home");
|
||||||
|
|
||||||
// For now The camera will be static.
|
// For now The camera will be static.
|
||||||
//SetCamera();
|
SetCamera();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Player::SetName(string nameArg) {
|
void Player::SetName(string nameArg) {
|
||||||
|
@ -137,9 +137,8 @@ void Character::Move(void) {
|
|||||||
tileX = ((x + (w / 2)) / TILE_WIDTH);
|
tileX = ((x + (w / 2)) / TILE_WIDTH);
|
||||||
tileY = ((y + (h / 2)) / TILE_HEIGHT);
|
tileY = ((y + (h / 2)) / TILE_HEIGHT);
|
||||||
|
|
||||||
// While we have a static camera, ensure that we do not go out
|
// Check collisions.
|
||||||
// of the camera boundaries.
|
if((x < 0) || (x + w) > levelWidth) x -= xVel;
|
||||||
if((x < 0) || (x + w) > levelWidth || (x + w) > SCREEN_WIDTH) x -= xVel;
|
|
||||||
if(CheckTileCollisions()) x -= xVel;
|
if(CheckTileCollisions()) x -= xVel;
|
||||||
if(CheckEntityCollisions()) x -= xVel;
|
if(CheckEntityCollisions()) x -= xVel;
|
||||||
//if(CheckCharacterCollisions()) x -= xVel;
|
//if(CheckCharacterCollisions()) x -= xVel;
|
||||||
@ -148,9 +147,7 @@ void Character::Move(void) {
|
|||||||
tileX = ((x + (w / 2)) / TILE_WIDTH);
|
tileX = ((x + (w / 2)) / TILE_WIDTH);
|
||||||
tileY = ((y + (h / 2)) / TILE_HEIGHT);
|
tileY = ((y + (h / 2)) / TILE_HEIGHT);
|
||||||
|
|
||||||
// While we have a static camera, ensure that we do not go out
|
if((y < 0) || (y + h) > levelHeight) y -= yVel;
|
||||||
// of the camera boundaries.
|
|
||||||
if((y < 0) || (y + h) > levelHeight || (y + h) > SCREEN_HEIGHT) y -= yVel;
|
|
||||||
if(CheckTileCollisions()) y -= yVel;
|
if(CheckTileCollisions()) y -= yVel;
|
||||||
if(CheckEntityCollisions()) y -= yVel;
|
if(CheckEntityCollisions()) y -= yVel;
|
||||||
if(CheckCharacterCollisions()) y -= yVel;
|
if(CheckCharacterCollisions()) y -= yVel;
|
||||||
|
Loading…
Reference in New Issue
Block a user