кровавые кролики жирнее

This commit is contained in:
azykov@mail.ru
2026-09-04 21:57:43 +03:00
parent dbc0094986
commit 2f57140899
3 changed files with 32 additions and 10 deletions
+2 -3
View File
@@ -1,7 +1,6 @@
import { observer } from 'mobx-react-lite';
import type { GameStore } from '../game/GameStore';
import type { RabbitState } from '../game/types';
import { RABBIT_MAX_HP } from '../game/rabbits';
import { RABBIT_NIGHT_SPRITE, RABBIT_SPRITE } from '../game/sprites';
import HealthBar from './HealthBar';
import PixelSprite from './PixelSprite';
@@ -24,8 +23,8 @@ const RabbitEntity = observer(function RabbitEntity({ rabbit, store }: { rabbit:
>
<PixelSprite pixels={store.isNight ? RABBIT_NIGHT_SPRITE : RABBIT_SPRITE} size={size} />
</div>
{rabbit.hp < RABBIT_MAX_HP && (
<HealthBar x={rabbit.x} y={rabbit.y - rabbit.z - size * 0.5 - 6} ratio={rabbit.hp / RABBIT_MAX_HP} />
{rabbit.hp < store.rabbitMaxHp && (
<HealthBar x={rabbit.x} y={rabbit.y - rabbit.z - size * 0.5 - 6} ratio={rabbit.hp / store.rabbitMaxHp} />
)}
</div>
);