feat: Initialize Mia's Clean Run project

Sets up the basic project structure, dependencies, and configuration for the game. Includes initial HTML, TypeScript, and Vite configurations. Adds initial types and constants for game mechanics and assets.
This commit is contained in:
Anthony
2025-11-23 19:32:47 +08:00
parent 995cff776a
commit 77f803f26e
12 changed files with 2342 additions and 8 deletions

123
types.ts Normal file
View File

@@ -0,0 +1,123 @@
export interface Player {
x: number;
y: number;
vx: number; // Horizontal velocity
vy: number; // Vertical velocity
width: number;
height: number;
isGrounded: boolean;
jumpCount: number; // For double jump
runFrame: number;
facingRight: boolean; // For sprite flipping
isBarking: boolean;
barkTimer: number; // How long the bark visual lasts
barkCooldown: number; // Time until next bark
isZoomies: boolean; // Invincibility mode
zoomiesTimer: number;
lives: number;
maxLives: number;
invincibilityTimer: number;
}
export interface MiaCustomization {
furColor: string;
collarColor: string;
hat: 'none' | 'party' | 'tophat' | 'bow' | 'cowboy' | 'crown';
glasses: 'none' | 'sunglasses' | 'nerd' | '3d';
shirt: 'none' | 'bandana' | 'vest' | 'superhero';
}
export type ObstacleType = 'wee' | 'poo' | 'cat_walking' | 'cat_sleeping' | 'cat_pouncing' | 'bird' | 'leaf' | 'roomba' | 'fly';
export interface Obstacle {
id: number;
x: number;
y: number;
width: number;
height: number;
type: ObstacleType;
vx?: number; // Velocity for moving obstacles
vy?: number; // Vertical velocity for falling items
initialY?: number; // Reference for flying patterns
initialX?: number; // Reference for patrolling
patrolRange?: number; // How far to move back and forth
swayOffset?: number; // Random offset for leaf sway/animations
hasSpawnedFly?: boolean; // Track if a fly has emerged from this poo
pounceTriggered?: boolean; // For pouncing cats
isAsleep?: boolean; // For sleeping cats
}
export type PlatformType = 'ottoman' | 'books' | 'shelf' | 'counter' | 'sofa' | 'fridge' | 'bed' | 'bathtub' | 'toilet' | 'vanity';
export interface Platform {
id: number;
x: number;
y: number;
width: number;
height: number;
color: string;
type: PlatformType;
}
export type CollectibleType = 'chicken' | 'bone' | 'steak' | 'biscuit';
export interface Collectible {
id: number;
x: number;
y: number;
width: number;
height: number;
type: CollectibleType;
collected: boolean;
rotation: number; // For animation
}
export interface Particle {
id: number;
x: number;
y: number;
vx: number;
vy: number;
life: number;
color: string;
size: number;
}
export interface FloatingText {
id: number;
x: number;
y: number;
text: string;
life: number;
color: string;
}
export interface ParallaxObject {
id: number;
x: number;
y: number;
type: 'tree_bg' | 'cloud' | 'hill' | 'cityscape';
width: number;
height: number;
depth: number; // 0.1 (far) to 0.9 (near), affects scroll speed
}
export interface BackgroundObject {
id: number;
x: number;
y: number;
type: 'tree' | 'bush' | 'plant_pot' | 'window' | 'painting' | 'cabinet' | 'lamp' | 'towel_rack';
variant: number;
width?: number; // Added for windows
height?: number; // Added for windows
}
export enum GameStatus {
START_SCREEN = 'START_SCREEN',
CUSTOMIZE = 'CUSTOMIZE',
PLAYING = 'PLAYING',
PAUSED = 'PAUSED',
LEVEL_COMPLETE = 'LEVEL_COMPLETE',
GAME_OVER = 'GAME_OVER'
}