Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions include/constants/anim_sizes.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,18 @@

// TODO: Auto-generate this file
#define MAX_TILES(_animName) ((_animName##_WIDTH / 8) * (_animName##_HEIGHT / 8))
#define MAX_TILES_VARIANT(_animName, _variant) ((_animName##_VAR##_variant##_WIDTH / 8) * (_animName##_VAR##_variant##_HEIGHT / 8))
#define MAX_TILES_VARIANT(_animName, _variant) ((_animName##_VAR##_variant##_WIDTH / 8) * (_animName##_VAR##_##_variant##_HEIGHT / 8))
#define ALLOC_TILES(_animName) VramMalloc(((_animName##_WIDTH / 8) * (_animName##_HEIGHT / 8)))
#define ALLOC_TILES_VARIANT(_animName, _variant) \
VramMalloc(((_animName##_VAR##_variant##_WIDTH / 8) * (_animName##_VAR##_variant##_HEIGHT / 8)))
VramMalloc(((_animName##_VAR##_##_variant##_WIDTH / 8) * (_animName##_VAR##_##_variant##_HEIGHT / 8)))

// 849
#define SA2_ANIM_GAME_OVER_WIDTH 64
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I should make more use of these :(

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this list be generated by the animation exporter?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this list be generated by the animation exporter?

Nope, but I definitely want to automate it.
As I think I said in the past, the biggest hurdle with it, is that all the different kinds of sprite graphics data are so closely intertwined with eachother that it's tough to use the source data to get everything back, esp. matching.

#define SA2_ANIM_GAME_OVER_HEIGHT 64
#define SA2_ANIM_GAME_OVER_VAR_GAME_WIDTH 64
#define SA2_ANIM_GAME_OVER_VAR_GAME_HEIGHT 64
#define SA2_ANIM_GAME_OVER_VAR_OVER_WIDTH 64
#define SA2_ANIM_GAME_OVER_VAR_OVER_HEIGHT 64

// 849
#define SA2_ANIM_GRIND_EFFECT_WIDTH 32
Expand Down
1 change: 1 addition & 0 deletions include/constants/animations.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
/* Collection of animation indices for Sonic Advance 2.
* - By JaceCear
*/
#include "constants/anim_sizes.h"

// "x_PROJ" means "projectile belonging to x"

Expand Down
4 changes: 2 additions & 2 deletions include/constants/zones.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@
#define IS_EXTRA_STAGE(lvl) ((lvl) == LEVEL_INDEX(ZONE_FINAL, ACT_TRUE_AREA_53))
#define IS_FINAL_OR_EXTRA_STAGE(lvl) ((IS_FINAL_STAGE(lvl)) || (IS_EXTRA_STAGE(lvl)))

#define ZONE_TIME_TO_INT(minutes, seconds) (int)(((minutes * 60.) + seconds) * GBA_FRAMES_PER_SECOND)
#define MAX_COURSE_TIME (ZONE_TIME_TO_INT(10, 0))
#define TIME(minutes, seconds) (int)(((minutes * 60.) + seconds) * GBA_FRAMES_PER_SECOND)
#define MAX_COURSE_TIME (TIME(10, 0))

#define SPECIAL_STAGE_REQUIRED_SP_RING_COUNT 7

Expand Down
6 changes: 3 additions & 3 deletions include/game/parameters/characters.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,21 @@
#define PLAYER_MAX_NOT_HELD_JUMP_FORCE 3.0
#define PLAYER_MAX_NOT_HELD_JUMP_FORCE_UNDER_WATER 1.5

#define PLAYER_INVULNERABLE_DURATION ZONE_TIME_TO_INT(0, 2)
#define PLAYER_INVULNERABLE_DURATION TIME(0, 2)

#define PLAYER_AIR_SPEED_MAX 15.0

/*** Tricks ***/
#define TRICK__STOP_N_SLAM__DROP_SPEED Q(0.21875)

/*** Cream ***/
#define CREAM_FLYING_DURATION ZONE_TIME_TO_INT(0, 4)
#define CREAM_FLYING_DURATION TIME(0, 4)

/*** Tails ***/
// NOTE: Unlike Cream, Tails does fly for 8 seconds, but his initial value gets set to 4.
// For some reason they lower his timer only every 2nd frame (in PlayerCB_8012C2C),
// instead of using a bigger value from the get-go, even though they gave him a
// 4-byte timer.
#define TAILS_FLYING_DURATION (ZONE_TIME_TO_INT(0, 8) / 2)
#define TAILS_FLYING_DURATION (TIME(0, 8) / 2)

#endif // GUARD_PARAMETERS_CHARACTERS_H
2 changes: 2 additions & 0 deletions include/gba/defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@ extern uint8_t OAM[OAM_SIZE];
#define OBJ_VRAM_TOTAL_SIZE (VRAM_SIZE - BG_VRAM_SIZE)
#endif

#define DISPLAY_CENTER_X (DISPLAY_WIDTH / 2)
#define DISPLAY_CENTER_Y (DISPLAY_HEIGHT / 2)

#if WIDESCREEN_HACK
#define WIN_REG_SIZE 4
Expand Down
10 changes: 5 additions & 5 deletions src/game/bosses/boss_2.c
Original file line number Diff line number Diff line change
Expand Up @@ -849,7 +849,7 @@ static u8 CheckBossDestruction(EggBomberTank *boss, Player *player)
if (Coll_Player_Boss_Attack(s, I(boss->qWorldX), I(boss->qWorldY), 0, player) == 1) {
if (boss->cannonHealth != 0) {
Sprite *s = &boss->pilot;
boss->unk73 = ZONE_TIME_TO_INT(0, 0.5);
boss->unk73 = TIME(0, 0.5);
if (boss->bossHitTimer == 0) {

s->graphics.anim = SA2_ANIM_EGG_BOMBER_TANK_PILOT;
Expand All @@ -863,7 +863,7 @@ static u8 CheckBossDestruction(EggBomberTank *boss, Player *player)
} else {
if (Coll_Player_Enemy(s, I(boss->qWorldX), I(boss->qWorldY), 0, player) == 1) {
Sprite *s = &boss->pilot;
boss->unk73 = ZONE_TIME_TO_INT(0, 0.5);
boss->unk73 = TIME(0, 0.5);
if (boss->bossHitTimer == 0) {

s->graphics.anim = SA2_ANIM_EGG_BOMBER_TANK_PILOT;
Expand Down Expand Up @@ -1087,7 +1087,7 @@ static void TaskDestructor_EggBomberTankMain(struct Task *t)
UNUSED static void sub_803E798(EggBomberTank *boss)
{
Sprite *s = &boss->pilot;
boss->unk73 = ZONE_TIME_TO_INT(0, 0.5);
boss->unk73 = TIME(0, 0.5);
if (boss->bossHitTimer == 0) {
s->graphics.anim = SA2_ANIM_EGG_BOMBER_TANK_PILOT;
s->variant = 1;
Expand Down Expand Up @@ -1155,7 +1155,7 @@ static void Task_EggBomberTankBombExplosion(void)
if (Coll_Player_Enemy(s, I(bomb->x) + gCamera.x, I(bomb->y) + gCamera.y, 0, &gPlayer) == 1) {
if (bomb->boss->bossHitTimer == 0) {
Sprite *s = &bomb->boss->pilot;
bomb->boss->unk73 = ZONE_TIME_TO_INT(0, 0.5);
bomb->boss->unk73 = TIME(0, 0.5);

s->graphics.anim = SA2_ANIM_HAMMERTANK_PILOT;
s->variant = 1;
Expand Down Expand Up @@ -1233,7 +1233,7 @@ static void Task_BombExplosionMain(void)
if (Coll_Player_Enemy(s, explosion->x + gCamera.x, explosion->y + gCamera.y, 0, &gPlayer) == 1) {
if (explosion->boss->bossHitTimer == 0) {
Sprite *s = &explosion->boss->pilot;
explosion->boss->unk73 = ZONE_TIME_TO_INT(0, 0.5);
explosion->boss->unk73 = TIME(0, 0.5);
s->graphics.anim = SA2_ANIM_HAMMERTANK_PILOT;
s->variant = 1;
s->prevVariant = -1;
Expand Down
12 changes: 6 additions & 6 deletions src/game/bosses/boss_4.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
#define AEROEGG_TAILTIP_OFFSET_X (0)
#define AEROEGG_TAILTIP_OFFSET_Y (20)

#define AEROEGG_COOLDOWN_NORMAL ZONE_TIME_TO_INT(0, 2. + (1. / 3.))
#define AEROEGG_COOLDOWN_PINCH ZONE_TIME_TO_INT(0, 1. + (1. / 3.))
#define AEROEGG_COOLDOWN_NORMAL TIME(0, 2. + (1. / 3.))
#define AEROEGG_COOLDOWN_PINCH TIME(0, 1. + (1. / 3.))

#define RESERVED_EXPLOSION_TILES_VRAM (void *)(OBJ_VRAM0 + 0x2980)

Expand Down Expand Up @@ -209,7 +209,7 @@ void CreateAeroEgg(void)
boss->main.unk15 = 0;
boss->main.unk16 = 0;
boss->main.timerBombDrop = 0;
boss->main.unk0 = ZONE_TIME_TO_INT(0, 2);
boss->main.unk0 = TIME(0, 2);
boss->main.timerUnk = 0;
boss->main.unk17 = 0;

Expand Down Expand Up @@ -362,15 +362,15 @@ static void sub_8041A08(AeroEgg *boss)
}
}

if (++boss->main.timerUnk > ZONE_TIME_TO_INT(0, 5)) {
if (++boss->main.timerUnk > TIME(0, 5)) {
r7 = TRUE;
}

if (r7) {
s->graphics.anim = SA2_ANIM_AERO_EGG_PLATFORM;
s->variant = 2;
s->prevVariant = -1;
boss->main.timerUnk = ZONE_TIME_TO_INT(0, 5);
boss->main.timerUnk = TIME(0, 5);
boss->main.unk17 = TRUE;
}
} else {
Expand Down Expand Up @@ -806,7 +806,7 @@ static void Task_AeroEggMain(void)

boss->main.unk0--;
if (boss->main.unk0 == 0) {
boss->main.timerBombDrop = ZONE_TIME_TO_INT(0, 3);
boss->main.timerBombDrop = TIME(0, 3);

gCurTask->main = Task_80426C4;
}
Expand Down
8 changes: 4 additions & 4 deletions src/game/countdown.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
#define ALIGN_DIGITS_VERTICALLY !TRUE

#if !PLATFORM_GBA && ALIGN_DIGITS_HORIZONTALLY
#define DIGITS_X (DISPLAY_WIDTH / 2)
#define DIGITS_X DISPLAY_CENTER_X
#else
#define DIGITS_X ((I(gPlayer.qWorldX) - gCamera.x) + 24)
#endif

#if !PLATFORM_GBA && ALIGN_DIGITS_VERTICALLY
#define DIGITS_Y (DISPLAY_HEIGHT / 2)
#define DIGITS_Y DISPLAY_CENTER_Y
#else
#define DIGITS_Y ((I(gPlayer.qWorldY) - gCamera.y) - 24)
#endif
Expand Down Expand Up @@ -249,7 +249,7 @@ void Task_RaceStartMessageMain(void)
s = &startMessage->sLeft;
transform = &startMessage->transformLeft;

s->x = (DISPLAY_WIDTH / 2);
s->x = DISPLAY_CENTER_X;
s->y = (DISPLAY_HEIGHT / 4);
s->frameFlags = gOamMatrixIndex++ | SPRITE_FLAG(ROT_SCALE_ENABLE, 1) | SPRITE_FLAG(ROT_SCALE_DOUBLE_SIZE, 1);
transform->rotation = 0;
Expand All @@ -271,7 +271,7 @@ void Task_RaceStartMessageMain(void)
s = &startMessage->sRight;
transform = &startMessage->transformRight;

s->x = (DISPLAY_WIDTH / 2);
s->x = DISPLAY_CENTER_X;
s->y = (DISPLAY_HEIGHT / 4);
s->frameFlags = gOamMatrixIndex++ | SPRITE_FLAG(ROT_SCALE_ENABLE, 1) | SPRITE_FLAG(ROT_SCALE_DOUBLE_SIZE, 1);
transform->rotation = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/game/course_select.c
Original file line number Diff line number Diff line change
Expand Up @@ -978,7 +978,7 @@ static void RenderUI(struct CourseSelectionScreen *coursesScreen)
} else {
s = &coursesScreen->chaosEmeralds[0];
}
s->x = (((i * 3)) * 8) + ((DISPLAY_WIDTH / 2) - 84);
s->x = (((i * 3)) * 8) + (DISPLAY_CENTER_X - 84);
UpdateSpriteAnimation(s);
DisplaySprite(s);
}
Expand Down
6 changes: 3 additions & 3 deletions src/game/cutscenes/credits_end.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ void CreateCreditsEndCutScene(u8 creditsVariant)
s->graphics.anim = gUnknown_080E12D0[0].anim;
s->variant = gUnknown_080E12D0[0].variant;
s->prevVariant = -1;
s->x = (DISPLAY_WIDTH / 2);
s->x = DISPLAY_CENTER_X;
s->y = -20;
s->oamFlags = SPRITE_OAM_ORDER(0);
s->graphics.size = 0;
Expand All @@ -190,7 +190,7 @@ void CreateCreditsEndCutScene(u8 creditsVariant)
s->graphics.anim = gUnknown_080E12D0[1].anim;
s->variant = gUnknown_080E12D0[1].variant;
s->prevVariant = -1;
s->x = (DISPLAY_WIDTH / 2);
s->x = DISPLAY_CENTER_X;
s->y = DISPLAY_HEIGHT + 96; // Note: 96 is the width of metatiles
s->oamFlags = SPRITE_OAM_ORDER(0);
s->graphics.size = 0;
Expand All @@ -211,7 +211,7 @@ void CreateCreditsEndCutScene(u8 creditsVariant)
s->graphics.anim = gUnknown_080E12D0[2].anim;
s->variant = gUnknown_080E12D0[2].variant;
s->prevVariant = -1;
s->x = (DISPLAY_WIDTH / 2);
s->x = DISPLAY_CENTER_X;
s->y = DISPLAY_HEIGHT + 96;
s->oamFlags = SPRITE_OAM_ORDER(0);
s->graphics.size = 0;
Expand Down
4 changes: 2 additions & 2 deletions src/game/cutscenes/final_ending_fall.c
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,8 @@ void CreateFinalEndingFallCutScene(void)
s->graphics.dest = (void *)scene->unk494;
scene->unk494 += 0x1A00;
s->prevVariant = -1;
s->x = (DISPLAY_WIDTH / 2);
s->y = (DISPLAY_HEIGHT / 2);
s->x = DISPLAY_CENTER_X;
s->y = DISPLAY_CENTER_Y;
s->oamFlags = SPRITE_OAM_ORDER(0);
s->graphics.size = 0;
s->animCursor = 0;
Expand Down
12 changes: 6 additions & 6 deletions src/game/cutscenes/final_ending_land.c
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ void CreateFinalEndingLandingCutScene(void)
s->graphics.dest = (void *)scene->unk618;
scene->unk618 += 0x120;
s->prevVariant = -1;
s->x = (DISPLAY_WIDTH / 2) - 10;
s->x = DISPLAY_CENTER_X - 10;
s->y = -20;
s->oamFlags = SPRITE_OAM_ORDER(1);
s->graphics.size = 0;
Expand Down Expand Up @@ -268,7 +268,7 @@ void CreateFinalEndingLandingCutScene(void)
s->graphics.anim = gUnknown_080E17A4[gSelectedCharacter].anim;
s->variant = gUnknown_080E17A4[gSelectedCharacter].variant;
s->prevVariant = -1;
s->x = (DISPLAY_WIDTH / 2);
s->x = DISPLAY_CENTER_X;
s->y = -20;
s->oamFlags = SPRITE_OAM_ORDER(1);
s->graphics.size = 0;
Expand Down Expand Up @@ -382,7 +382,7 @@ void CreateFinalEndingLandingCutScene(void)
s->graphics.anim = gUnknown_080E17A4[40].anim;
s->variant = gUnknown_080E17A4[40].variant;
s->prevVariant = -1;
s->x = (DISPLAY_WIDTH / 2);
s->x = DISPLAY_CENTER_X;
s->y = -20;
s->oamFlags = SPRITE_OAM_ORDER(0);
s->graphics.size = 0;
Expand All @@ -403,7 +403,7 @@ void CreateFinalEndingLandingCutScene(void)
s->graphics.anim = gUnknown_080E17A4[41].anim;
s->variant = gUnknown_080E17A4[41].variant;
s->prevVariant = -1;
s->x = (DISPLAY_WIDTH / 2);
s->x = DISPLAY_CENTER_X;
s->y = DISPLAY_HEIGHT + 96;
s->oamFlags = SPRITE_OAM_ORDER(0);
s->graphics.size = 0;
Expand All @@ -424,7 +424,7 @@ void CreateFinalEndingLandingCutScene(void)
s->graphics.anim = gUnknown_080E17A4[42].anim;
s->variant = gUnknown_080E17A4[42].variant;
s->prevVariant = -1;
s->x = (DISPLAY_WIDTH / 2);
s->x = DISPLAY_CENTER_X;
s->y = DISPLAY_HEIGHT + 96;
s->oamFlags = SPRITE_OAM_ORDER(0);
s->graphics.size = 0;
Expand All @@ -445,7 +445,7 @@ void CreateFinalEndingLandingCutScene(void)
s->graphics.anim = gUnknown_080E17A4[gSelectedCharacter + 0x19].anim;
s->variant = gUnknown_080E17A4[gSelectedCharacter + 0x19].variant;
s->prevVariant = -1;
s->x = (DISPLAY_WIDTH / 2);
s->x = DISPLAY_CENTER_X;
s->y = 0;
s->oamFlags = SPRITE_OAM_ORDER(1);
s->graphics.size = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/game/cutscenes/missing_emeralds.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ void CreateMissingChaosEmaraldsCutScene(void)
s->y = 90;
}
s->prevVariant = -1;
s->x = (DISPLAY_WIDTH / 2);
s->x = DISPLAY_CENTER_X;
s->oamFlags = SPRITE_OAM_ORDER(0);
s->graphics.size = 0;
s->animCursor = 0;
Expand Down
14 changes: 7 additions & 7 deletions src/game/decomp_credits.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ void CreateDecompCreditsScreen(bool32 hasProfile)

s = &cred->sprSonic;
s->x = -508;
s->y = (DISPLAY_HEIGHT / 2) - 16;
s->y = DISPLAY_CENTER_Y - 16;
SPRITE_INIT_FLAGS(s, 64, SA2_ANIM_CHAR(SA2_CHAR_ANIM_WALK, CHARACTER_SONIC), 4, 18, 2, SPRITE_FLAG_MASK_X_FLIP);
s->animSpeed = SPRITE_ANIM_SPEED(4);
cred->qSonicScreenX = Q(s->x);
Expand All @@ -91,8 +91,8 @@ void CreateDecompCreditsScreen(bool32 hasProfile)
cred->qTailsScreenX = Q(s->x);

s = &cred->sprLogoOllie;
s->x = (DISPLAY_WIDTH / 2) + 24;
s->y = (DISPLAY_HEIGHT / 2) - (LOGO_WIDTH / 2);
s->x = DISPLAY_CENTER_X + 24;
s->y = DISPLAY_CENTER_Y - (LOGO_WIDTH / 2);
SPRITE_INIT_FLAGS(s, 64, 1133, 1, 18, 2, SPRITE_FLAG_MASK_X_FLIP);
s->palId = 2;
cred->qLogoOllieScreenX = Q(s->x);
Expand Down Expand Up @@ -164,7 +164,7 @@ void Task_DecompCreditsFirst()
UpdateSprites(cred);

// Check Tails' position
if (cred->sprLogoJace.x <= ((DISPLAY_WIDTH / 2) + 24)) {
if (cred->sprLogoJace.x <= (DISPLAY_CENTER_X + 24)) {
cred->sprTails.graphics.anim = SA2_ANIM_CHAR(33, CHARACTER_TAILS);
cred->sprTails.variant = 0;
cred->qSpeedTails = 0;
Expand Down Expand Up @@ -199,7 +199,7 @@ void Task_DecompCreditsFirst()
}
}

if ((cred->qSpeedSonic <= 0) && cred->sprSonic.x < (DISPLAY_WIDTH / 2) + 16) {
if ((cred->qSpeedSonic <= 0) && cred->sprSonic.x < DISPLAY_CENTER_X + 16) {
cred->qSpeedSonic = Q(0);

cred->sprSonic.graphics.anim = SA2_ANIM_CHAR(SA2_CHAR_ANIM_34, CHARACTER_SONIC);
Expand All @@ -224,7 +224,7 @@ void Task_SonicArrived(void)
UpdateSprites(cred);

// Check Tails' position
if (cred->sprLogoJace.x <= ((DISPLAY_WIDTH / 2) + 24)) {
if (cred->sprLogoJace.x <= (DISPLAY_CENTER_X + 24)) {
cred->sprTails.graphics.anim = SA2_ANIM_CHAR(33, CHARACTER_TAILS);
cred->sprTails.variant = 0;
cred->qSpeedTails = 0;
Expand Down Expand Up @@ -300,7 +300,7 @@ void customHBlank(void)
if ((vcount >= DISPLAY_HEIGHT - 16 - 1) && (vcount < DISPLAY_HEIGHT - 1)) {
// "PRESS START to continue"
((u16 *)BG_PLTT)[0] = RGB_WHITE;
} else if ((vcount >= (DISPLAY_HEIGHT / 2) - 1) && (vcount < DISPLAY_HEIGHT - 1)) {
} else if ((vcount >= DISPLAY_CENTER_Y - 1) && (vcount < DISPLAY_HEIGHT - 1)) {
// Logo background (JaceCear)
((u16 *)BG_PLTT)[0] = ((u16 *)OBJ_PLTT)[3 * PALETTE_LEN_4BPP];
} else {
Expand Down
4 changes: 2 additions & 2 deletions src/game/enemies/mon.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ static void Task_MonMain(void)
TaskDestroy(gCurTask);
return;
} else {
if ((gPlayer.qWorldX > mon->x - Q(DISPLAY_WIDTH / 2)) && (gPlayer.qWorldX < mon->x + Q(DISPLAY_WIDTH / 2))
if ((gPlayer.qWorldX > mon->x - Q(DISPLAY_CENTER_X)) && (gPlayer.qWorldX < mon->x + Q(DISPLAY_CENTER_X))
&& (gPlayer.qWorldY > mon->y - Q(50)) && (gPlayer.qWorldY < mon->y + Q(50))) {
gCurTask->main = Task_Mon_2;
s->graphics.anim = SA2_ANIM_MON;
Expand Down Expand Up @@ -183,7 +183,7 @@ static void Task_Mon_4(void)
Player_UpdateHomingPosition(mon->x, mon->y);

if (UpdateSpriteAnimation(s) == 0) {
if ((gPlayer.qWorldX > mon->x - Q(DISPLAY_WIDTH / 2)) && (gPlayer.qWorldX < mon->x + Q(DISPLAY_WIDTH / 2))
if ((gPlayer.qWorldX > mon->x - Q(DISPLAY_CENTER_X)) && (gPlayer.qWorldX < mon->x + Q(DISPLAY_CENTER_X))
&& (gPlayer.qWorldY > mon->y - Q(50)) && (gPlayer.qWorldY < mon->y + Q(50))) {

ENEMY_TURN_TO_PLAYER(mon->x, s);
Expand Down
Loading
Loading