This repository has been archived by the owner on Nov 26, 2024. It is now read-only.
-
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.
Merge pull request #48 from claustra01/fix/target-hit-status
的跡地の虚無に命中判定があるバグを修正したよ
- Loading branch information
Showing
6 changed files
with
103 additions
and
12 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
export type TargetProperty = { | ||
index: number; | ||
pos: ThreeDim; | ||
size: ThreeDim; | ||
}; | ||
|
||
export type ThreeDim = { | ||
x: number; | ||
y: number; | ||
z: number; | ||
}; | ||
|
||
export const initialTargets: TargetProperty[] = [ | ||
// 本来posはy=1.8だが0.1だけ埋め込むことで反動を利用したいい感じのアニメーションを出している | ||
{ index: 0, pos: { x: -3, y: 1.7, z: 0 }, size: { x: 0.7, y: 1.8, z: 0.7 } }, | ||
{ index: 1, pos: { x: 0, y: 1.7, z: 0 }, size: { x: 0.7, y: 1.8, z: 0.7 } }, | ||
{ index: 2, pos: { x: 3, y: 1.7, z: 0 }, size: { x: 0.7, y: 1.8, z: 0.7 } }, | ||
]; |
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,3 +1,4 @@ | ||
export { useSocketRefStore } from "./useSocketRefStore"; | ||
export { useUUIDStore } from "./useUUIDStore"; | ||
export { useRoomIdStore } from "./useRoomIdStore"; | ||
export { useTargetStatusStore } from "./useTargetStatusStore"; |
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,21 @@ | ||
import { create } from "zustand"; | ||
import { TargetStatus } from "../type/target"; | ||
|
||
type State = { | ||
targetStatus: TargetStatus[]; | ||
}; | ||
|
||
type Action = { | ||
updateTargetStatus: (index: number, status: TargetStatus) => void; | ||
}; | ||
|
||
export const useTargetStatusStore = create<State & Action>((set) => ({ | ||
// left, center, right | ||
targetStatus: [TargetStatus.Live, TargetStatus.Live, TargetStatus.Live], | ||
updateTargetStatus: (index: number, status: TargetStatus) => | ||
set((state) => { | ||
const targetStatus = [...state.targetStatus]; | ||
targetStatus[index] = status; | ||
return { targetStatus }; | ||
}), | ||
})); |
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,4 @@ | ||
export enum TargetStatus { | ||
Live = "live", | ||
Hit = "hit", | ||
} |