sound when pieces connect
This commit is contained in:
parent
472113ad74
commit
21d7db5677
14 changed files with 75 additions and 8 deletions
|
|
@ -530,7 +530,8 @@ function handleInput(
|
|||
gameId: string,
|
||||
playerId: string,
|
||||
input: Input,
|
||||
ts: Timestamp
|
||||
ts: Timestamp,
|
||||
onSnap?: (playerId: string) => void
|
||||
): Array<Change> {
|
||||
const puzzle = GAMES[gameId].puzzle
|
||||
const evtInfo = getEvtInfo(gameId, playerId)
|
||||
|
|
@ -734,6 +735,9 @@ function handleInput(
|
|||
changeData(gameId, { finished: ts })
|
||||
_dataChange()
|
||||
}
|
||||
if (onSnap) {
|
||||
onSnap(playerId)
|
||||
}
|
||||
} else {
|
||||
// Snap to other tiles
|
||||
const check = (
|
||||
|
|
@ -789,6 +793,9 @@ function handleInput(
|
|||
changePlayer(gameId, playerId, { d, ts })
|
||||
_playerChange()
|
||||
}
|
||||
if (snapped && onSnap) {
|
||||
onSnap(playerId)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
changePlayer(gameId, playerId, { d, ts })
|
||||
|
|
|
|||
|
|
@ -58,6 +58,7 @@ const INPUT_EV_PLAYER_COLOR = 7
|
|||
const INPUT_EV_PLAYER_NAME = 8
|
||||
const INPUT_EV_MOVE = 9
|
||||
const INPUT_EV_TOGGLE_PREVIEW = 10
|
||||
const INPUT_EV_TOGGLE_SOUNDS = 11
|
||||
|
||||
const CHANGE_DATA = 1
|
||||
const CHANGE_TILE = 2
|
||||
|
|
@ -87,6 +88,7 @@ export default {
|
|||
INPUT_EV_PLAYER_NAME,
|
||||
|
||||
INPUT_EV_TOGGLE_PREVIEW,
|
||||
INPUT_EV_TOGGLE_SOUNDS,
|
||||
|
||||
CHANGE_DATA,
|
||||
CHANGE_TILE,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue