migrant a SDL3

This commit is contained in:
2025-03-25 20:26:45 +01:00
parent f1b0303474
commit a9c869baf6
49 changed files with 374 additions and 416 deletions

View File

@@ -5,7 +5,7 @@
#include "param.h" // Para Param, ParamGame, param
class Texture; // lines 6-6
Item::Item(ItemType type, float x, float y, SDL_Rect &play_area, std::shared_ptr<Texture> texture, const std::vector<std::string> &animation)
Item::Item(ItemType type, float x, float y, SDL_FRect &play_area, std::shared_ptr<Texture> texture, const std::vector<std::string> &animation)
: sprite_(std::make_unique<AnimatedSprite>(texture, animation)),
type_(type),
play_area_(play_area)
@@ -16,7 +16,7 @@ Item::Item(ItemType type, float x, float y, SDL_Rect &play_area, std::shared_ptr
{
width_ = param.game.coffee_machine_w;
height_ = param.game.coffee_machine_h;
pos_x_ = ((static_cast<int>(x) + (play_area.w / 2)) % (play_area.w - width_ - 5)) + 2;
pos_x_ = (static_cast<int>(x + (play_area.w / 2)) % static_cast<int>(play_area.w - width_ - 5)) + 2;
pos_y_ = y;
vel_x_ = 0.0f;
vel_y_ = -0.1f;