Skip to content

Contributing to CASCADA Framework ​

Thank you for your interest in the project! Here's how you can help.

Development Setup ​

Requirements ​

  • Node.js 18+
  • pnpm 8+
  • Git

Installation ​

bash
git clone <repository-url>
cd games
ppnpm install
pnpm dev

Development Process ​

1. Create Branch ​

bash
git checkout -b feature/my-awesome-feature

2. Make Changes ​

Follow project structure:

  • Platform → src/platform/ (Phaser base only)
  • Core → src/core/ (universal systems)
  • Game → src/game/ (LINX-specific)

Important: Respect layer hierarchy:

Game → uses Core + Platform
Core → uses Platform
Platform → uses Dependencies only

3. Testing ​

bash
# TypeScript check
pnpm lint

# Run in dev mode
pnpm dev

4. Commit ​

Use Conventional Commits:

bash
git commit -m "feat: add new core system"
git commit -m "fix: correct collision detection"
git commit -m "docs: update architecture guide"

Commit types:

  • feat: - new feature
  • fix: - bug fix
  • docs: - documentation changes
  • style: - code formatting
  • refactor: - refactoring
  • test: - adding tests
  • chore: - dependency updates, etc.

5. Push and Pull Request ​

bash
git push origin feature/my-awesome-feature

Create Pull Request with description:

  • What was added/fixed
  • Why it's needed
  • How to test

Code Style ​

TypeScript ​

  • Use strict typing
  • Avoid any, use specific types
  • Prefer interface over type for objects
typescript
// Good
interface PlayerConfig {
  x: number;
  y: number;
  speed: number;
}

// Bad
type PlayerConfig = any;

Naming Conventions ​

  • Classes: PascalCase (PlayerEntity, GameScene)
  • Variables: camelCase (playerSpeed, maxHealth)
  • Constants: UPPER_SNAKE_CASE (MAX_PLAYERS, DEFAULT_SPEED)
  • Files: PascalCase for classes, camelCase for utilities

Comments ​

typescript
/**
 * JSDoc comments for public methods
 */
export function calculateDistance(x1: number, y1: number): number {
  // Regular comments for complex logic
  return Math.sqrt(x1 * x1 + y1 * y1);
}

File Structure ​

Adding New Scene ​

typescript
// src/game/scenes/MyNewScene.ts
import Phaser from "phaser";

export class MyNewScene extends Phaser.Scene {
  constructor() {
    super({ key: "MyNewScene" });
  }

  create(): void {
    // Your code
  }
}

Then add to src/game/config/game.config.ts:

typescript
scene: [
  BootScene,
  PreloaderScene,
  MainMenuSceneVue,
  MyNewScene,  // ← Add here
],

Adding New Core System ​

typescript
// src/core/systems/MySystem.ts
import Phaser from "phaser";

/**
 * Universal system for all games
 */
export class MySystem {
  constructor(scene: Phaser.Scene) {
    // System logic
  }
}

Important: Core systems must be universal, not game-specific!

Testing ​

Manual Testing ​

  1. Run pnpm dev
  2. Check in browser
  3. Open DevTools and check console
  4. Test on different resolutions

TypeScript Check ​

bash
pnpm lint

Documentation ​

When adding new systems:

  1. Update README.md if architecture changes
  2. Add examples in docs/ if you created a new system
  3. Use JSDoc comments for complex code

Questions? ​

  • Create an Issue with question
  • Check existing documentation in /docs
  • Ask in Discord (if available)

License ​

By contributing to the project, you agree to the MIT license.

Thank you for contributing!

MIT Licensed