An open API service indexing awesome lists of open source software.

https://github.com/cherninlab/qwik-card-engine


https://github.com/cherninlab/qwik-card-engine

Last synced: about 1 month ago
JSON representation

Awesome Lists containing this project

README

          

# QwikCE - Qwik Card Engine

Simple card game engine built for Qwik.

## Quick Start

```bash
# Or add to existing project
npm install @cherninlab/qwik-card-engine
```

## Basic Usage

```typescript
// 1. Define your game
const gameConfig = {
id: 'my-game',
name: 'My Card Game',
resources: {
coin: {
startAmount: 1,
gainPerTurn: 1
}
},
cardTypes: {
unit: {
type: "unit"
}
}
};

// 2. Add game to your app
import { GameProvider } from '@cherninlab/qwik-card-engine';

export default component$(() => {
return (



);
});

// 3. Use game state and actions
import { useGameState, useGameAction } from '@cherninlab/qwik-card-engine';

export const YourGame = component$(() => {
const state = useGameState();
const { playCard$ } = useGameAction();

return (


{/* Your game UI */}

);
});
```

## Examples

- [Number Battle](https://github.com/cherninlab/number-battle) - Simple number-based card game

## Documentation

- [API Documentation](./docs/api.md) - Server implementation guide

## Development

```bash
pnpm install
pnpm dev
pnpm build
```