https://github.com/cherninlab/qwik-card-engine
https://github.com/cherninlab/qwik-card-engine
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/cherninlab/qwik-card-engine
- Owner: cherninlab
- Created: 2024-12-28T20:18:00.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-01T23:46:40.000Z (over 1 year ago)
- Last Synced: 2025-01-02T00:25:28.293Z (over 1 year ago)
- Language: TypeScript
- Size: 0 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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
```