Commit de vesprà tirada a la brossa

This commit is contained in:
2024-10-16 22:35:19 +02:00
parent 5585f996cb
commit db884cb422
32 changed files with 450 additions and 463 deletions

View File

@@ -1,12 +1,12 @@
#include "item.h"
#include <stdlib.h> // for rand
#include "animated_sprite.h" // for AnimatedSprite
#include "animated_sprite.h" // for SpriteAnimated
#include "param.h" // for param
class Texture;
// Constructor
Item::Item(ItemType type, float x, float y, SDL_Rect *play_area, std::shared_ptr<Texture> texture, std::vector<std::string> *animation)
: sprite_(std::make_unique<AnimatedSprite>(texture, "", animation)),
: sprite_(std::make_unique<AnimatedSprite>(texture, animation)),
accel_x_(0.0f),
floor_collision_(false),
type_(type),
@@ -144,7 +144,7 @@ void Item::disable()
void Item::update()
{
move();
sprite_->animate();
sprite_->update();
updateTimeToLive();
checkTimeToLive();
}