From a8f429eca35ad73ba4028606ac5055b063668de0 Mon Sep 17 00:00:00 2001 From: MeirGavish Date: Sun, 3 Aug 2025 16:08:41 +0300 Subject: [PATCH] Moved the price of shop items below the item so it is not obstructed when the card is raised on highlight --- include/sprite.h | 2 ++ source/game.c | 2 +- source/sprite.c | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/include/sprite.h b/include/sprite.h index 0cd9840..d76f2b5 100644 --- a/include/sprite.h +++ b/include/sprite.h @@ -4,6 +4,8 @@ #include #include +#define CARD_SPRITE_SIZE 32 + typedef struct { OBJ_ATTR *obj; diff --git a/source/game.c b/source/game.c index 6f3d8de..db684b0 100644 --- a/source/game.c +++ b/source/game.c @@ -1821,7 +1821,7 @@ static void game_shop_create_items(JokerObject *shop_jokers[], bool first_time) shop_jokers[i]->sprite_object->ty = int2fx(71); int x = fx2int(shop_jokers[i]->sprite_object->tx) + TILE_SIZE - (get_digits_even(shop_jokers[i]->joker->value) - 1) * TILE_SIZE; - int y = fx2int(shop_jokers[i]->sprite_object->ty); + int y = fx2int(shop_jokers[i]->sprite_object->ty) + CARD_SPRITE_SIZE + TILE_SIZE; tte_printf("#{P:%d,%d; cx:0xC000}$%d", x, y, shop_jokers[i]->joker->value); if (first_time == false) diff --git a/source/sprite.c b/source/sprite.c index 5e3edf6..ebb2e37 100644 --- a/source/sprite.c +++ b/source/sprite.c @@ -1,5 +1,6 @@ #include "sprite.h" #include "util.h" +#include "audio_utils.h" #include #include @@ -206,8 +207,7 @@ void sprite_object_shake(SpriteObject* sprite_object, mm_word sound_id) if (sound_id == UNDEFINED) return; // If no sound ID is provided, do nothing - mm_sound_effect sfx_select = { {sound_id}, 1024, 0, 255, 128, }; - mmEffectEx(&sfx_select); + play_sfx(sound_id, MM_BASE_PITCH_RATE); } void sprite_object_set_selected(SpriteObject* sprite_object, bool selected)