Retocados nombres de variables antiguos
This commit is contained in:
@@ -24,8 +24,8 @@ Player::Player(SDL_Renderer *renderer, Asset *asset, Input *input, Map *map)
|
||||
vx = 0;
|
||||
vy = 0;
|
||||
lastPosition = {(int)x, (int)y};
|
||||
const SDL_Rect rect = {(int)x, (int)y, 16, 24};
|
||||
sprite->setPos(rect);
|
||||
const SDL_Rect rect = {(int)x, (int)y, w, h};
|
||||
sprite->setRect(rect);
|
||||
sprite->setCurrentAnimation("stand");
|
||||
sprite->setFlip(SDL_FLIP_NONE);
|
||||
|
||||
@@ -65,9 +65,9 @@ Player::~Player()
|
||||
void Player::update()
|
||||
{
|
||||
checkInput();
|
||||
// addGravity();
|
||||
move();
|
||||
animate();
|
||||
checkActors();
|
||||
}
|
||||
|
||||
// Dibuja el objeto
|
||||
@@ -372,4 +372,11 @@ void Player::switchBorders()
|
||||
void Player::setMap(Map *map)
|
||||
{
|
||||
this->map = map;
|
||||
}
|
||||
|
||||
// Comprueba las interacciones con los actores
|
||||
int Player::checkActors()
|
||||
{
|
||||
SDL_Rect rect = sprite->getRect();
|
||||
return map->actorCollision(rect);
|
||||
}
|
||||
Reference in New Issue
Block a user