-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor landscape rendering; update star rendering to include viewpo…
…rt for parallax effect and simplify mountain rendering logic
- Loading branch information
Showing
6 changed files
with
40 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 7 additions & 7 deletions
14
games/xmas/src/screens/play/game-render/landscape/tree/tree-types.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,28 @@ | ||
import { GAME_WORLD_HEIGHT, GAME_WORLD_WIDTH } from '../../../game-world/game-world-consts'; | ||
|
||
// Tree silhouette color | ||
export const TREE_COLOR = '#000022'; // Dark blue color for tree silhouettes | ||
export const TREE_COLOR = '#002211'; // Dark blue color for tree silhouettes | ||
|
||
// Tree configuration | ||
export const TREES = { | ||
// Tree dimensions | ||
MAX_HEIGHT: GAME_WORLD_HEIGHT * 0.15, // Maximum tree height (15% of world height) | ||
MIN_HEIGHT: GAME_WORLD_HEIGHT * 0.1, // Minimum tree height (10% of world height) | ||
WIDTH_RATIO: 0.6, // Tree width as ratio of height | ||
MIN_HEIGHT: GAME_WORLD_HEIGHT * 0.1, // Minimum tree height (10% of world height) | ||
WIDTH_RATIO: 0.6, // Tree width as ratio of height | ||
|
||
// Tree distribution | ||
DENSITY: Math.floor(GAME_WORLD_WIDTH / 75), // Number of trees across the world | ||
SPACING_VARIATION: 0.3, // Random variation in tree spacing (30%) | ||
SPACING_VARIATION: 0.3, // Random variation in tree spacing (30%) | ||
} as const; | ||
|
||
// Tree type definition | ||
export type Tree = { | ||
x: number; // Base x position | ||
x: number; // Base x position | ||
height: number; // Height of the tree | ||
width: number; // Width of the tree | ||
width: number; // Width of the tree | ||
}; | ||
|
||
// Tree state type | ||
export type TreeState = { | ||
trees: Tree[]; | ||
}; | ||
}; |