-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7dac13d
commit 436ab4c
Showing
10 changed files
with
104 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
import React from 'react' | ||
import './WaitPanel.scss' | ||
|
||
interface WaitPanelProps { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import WaitPanel from '../../components/WaitPanel' | ||
import { formatOrdinals } from '../../utils/helper' | ||
import { GameState } from '../../hooks/useGameState' | ||
|
||
interface GameMessageProps { | ||
gameState: GameState | ||
position: number | ||
} | ||
|
||
const GameMessage: React.FC<GameMessageProps> = ({ gameState, position }) => { | ||
switch (gameState) { | ||
case GameState.WaitPlayers: | ||
return <WaitPanel msg={'Waiting for Players'} /> | ||
|
||
case GameState.WaitGame: | ||
return <WaitPanel msg={'Game in Progress'} /> | ||
|
||
case GameState.Results: | ||
return <WaitPanel msg={`You finished ${formatOrdinals(position + 1)}`} /> | ||
} | ||
} | ||
|
||
export default GameMessage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import GameMessage from './GameMessage' | ||
export default GameMessage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
export const CHARACTER_OPTIONS: Record<string, string> = { | ||
penguin: 'Penguin', | ||
snowman: 'Snowman', | ||
dalek: 'Dalek', | ||
hippo: 'Hippo', | ||
reindeer: 'Reindeer', | ||
grinch: 'Grinch', | ||
} | ||
|
||
export const TEXTURE_LOOKUP: Record<string, string> = { | ||
'character-1': 'penguin', | ||
'character-2': 'snowman', | ||
'character-3': 'dalek', | ||
'character-4': 'hippo', | ||
'character-5': 'reindeer', | ||
'character-6': 'grinch', | ||
} |