Refactor game API and introduce Forest Fortune game
- Updated API types to replace `GameStub` with `GameInfo` and added `SessionSpinResult` and `SpinOutcome` types. - Modified API requests in `api.ts` to use the new game types. - Implemented the `ForestFortuneGame` component with game logic, including spinning mechanics and win animations. - Created supporting components: `CoinFlight`, `ReelColumn`, `WinCounter`, and `WinLinesOverlay` for game UI. - Added CSS styles for the Forest Fortune game layout and animations. - Updated `GamePage` and `HomePage` to integrate the new game and reflect its status correctly.
This commit is contained in:
41
src/types.ts
41
src/types.ts
@@ -20,14 +20,53 @@ export type Wallet = {
|
||||
deposits: Deposit[]
|
||||
}
|
||||
|
||||
export type GameStub = {
|
||||
export type GameInfo = {
|
||||
slug: string
|
||||
title: string
|
||||
description: string
|
||||
status: string
|
||||
min_bet: string
|
||||
max_bet: string
|
||||
min_spin_count: number
|
||||
max_spin_count: number
|
||||
}
|
||||
|
||||
/** @deprecated use GameInfo */
|
||||
export type GameStub = GameInfo
|
||||
|
||||
export type TokenResponse = {
|
||||
access_token: string
|
||||
token_type: string
|
||||
}
|
||||
|
||||
export type PaylineWin = {
|
||||
line_index: number
|
||||
symbol: string
|
||||
count: number
|
||||
amount: string
|
||||
path: number[]
|
||||
}
|
||||
|
||||
export type SpinOutcome = {
|
||||
index: number
|
||||
grid: string[][]
|
||||
line_wins: PaylineWin[]
|
||||
scatter_count: number
|
||||
scatter_win: string
|
||||
total_win: string
|
||||
level: number
|
||||
multiplier: number
|
||||
meta_triggered: boolean
|
||||
}
|
||||
|
||||
export type SessionSpinResult = {
|
||||
slug: string
|
||||
bet: string
|
||||
spin_count: number
|
||||
total_bet: string
|
||||
total_win: string
|
||||
max_level: number
|
||||
trigger_count: number
|
||||
balance: string
|
||||
spins: SpinOutcome[]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user