цикл день-ночь, кролики, кровавая луна

This commit is contained in:
azykov@mail.ru
2026-09-04 20:31:53 +03:00
parent 982bbce813
commit 396a604671
17 changed files with 1061 additions and 171 deletions
+43
View File
@@ -0,0 +1,43 @@
/** Number of rabbits present on the map by a given day. */
export function rabbitsForDay(day: number): number {
return Math.max(0, 1 + Math.floor(day / 3));
}
/** How long a jump or strike action takes to play out. */
export const RABBIT_ACTION_DURATION = 1;
/** How long a rabbit pauses between actions (this is also when it decides its next one). */
export const RABBIT_PAUSE_DURATION = 1;
/** Max distance covered by a single jump. */
export const RABBIT_JUMP_DISTANCE = 80;
/** Peak height (px) of a jump's parabolic arc — same idea as a resource drop's arc when it flies
* off a chopped tree. */
export const RABBIT_JUMP_ARC_HEIGHT = 30;
/** By day, a rabbit won't choose a jump target closer than this to the character. */
export const RABBIT_MIN_DISTANCE_FROM_CHARACTER = 130;
/** How close the character must be, by night, for a rabbit to strike instead of jumping toward them. */
export const RABBIT_STRIKE_RANGE = 28;
/** How close the character must get to hit a rabbit. */
export const RABBIT_HIT_RADIUS = 40;
/** A rabbit's max HP (fixed — unlike the character's, there's no upgrade for it). */
export const RABBIT_MAX_HP = 3;
/** Damage dealt by a single completed strike (fixed — unlike the character's own attack damage,
* there's no upgrade for it). Multiple rabbits striking independently each deal this. */
export const RABBIT_STRIKE_DAMAGE = 1;
/** Random deviation (degrees, either side) from a direct line to the character for a night jump —
* "roughly toward" the character rather than a perfect beeline. */
export const RABBIT_NIGHT_JUMP_SPREAD_DEGREES = 30;
/** Coins a piece of meat is worth (fixed — unlike logs/twigs, there's no upgrade for it). */
export const MEAT_VALUE = 5;
/** Rabbits (and their strike/hit ranges) are this much bigger during a blood moon. */
export const BLOOD_MOON_SIZE_MULTIPLIER = 2;