-
Notifications
You must be signed in to change notification settings - Fork 0
Conversation
Lighthouse Report
|
Visualizer ReportYou can view the results here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
jaとLinkの閉じかっこの修正、諸々あざます。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
なんかrebaseミスってるぽい
// TODO: これらは一人用,いつかマルチプレイヤー対応する | ||
const [aim, setAim] = useState<Target | undefined>(undefined); | ||
// TODO: エイム照準の実装 | ||
// const aimTarget = (data: PointerSchema) => { | ||
// const x = window.innerWidth * data.target.x + window.innerWidth / 2; | ||
// const y = window.innerHeight * data.target.y + window.innerHeight / 2; | ||
// setAim({ x, y }); | ||
// }; | ||
const aimTarget = (data: PointerSchema) => { | ||
const x = window.innerWidth / 2 + data.target.x * 1200; | ||
const y = window.innerHeight / 2 + data.target.y * 1200; | ||
setAim({ x, y }); | ||
}; | ||
|
||
// const [target, setTarget] = useState<Target | undefined>(undefined); | ||
const shotTarget = (data: ActionSchema) => { | ||
const x = window.innerWidth / 2 + data.target.x * 1200; | ||
const y = window.innerHeight / 2 + data.target.y * 1200; | ||
// TODO: エイム実装ができたらここのsetAimは削除する | ||
setAim({ x, y }); | ||
// setTarget({ x, y }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
この辺、pointerはaimで、actionはtargetでx,yを保持していようという意図の宣言だったんですけど、よく考えたら別にaimだけで良さそうですね
であれば、aimTargetとshotTargetも統合できるので、不要なコメント群諸々綺麗にして欲しいです
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
あーこの使い分け意味あるのかと思ったけど統合していいやつなのね
統合しときます
src/pages/shooter/index.tsx
Outdated
import style from "./index.module.css"; | ||
|
||
const Shooter = () => { | ||
const [isOpen, setIsOpen] = useState(true); | ||
const [score, setScore] = useState<number>(0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
このscoreは命中した数のカウント用なんだ!!消さないでくれ🥺🥺
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
あ、ミスって消してたわ
戻しとく
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sea10さんのzustandでのscore管理をマージしたので、そのまま消しておきます
src/pages/shooter/index.tsx
Outdated
useEffect(() => { | ||
onMessage((data) => { | ||
if (data.message_type === MessageType.Hit && data.id === uuid) { | ||
setScore((prevScore) => prevScore + 1); | ||
console.log(score); | ||
} | ||
}); | ||
}, [onMessage, uuid, score]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
この辺でtype=hitのwebsocketメッセージを受け取ってスコアをカウントしてる
消さないでくれ🥺🥺
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同じく戻しとく
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
上に同じ
deployし直しのためreopen |
src/components/Gallery/index.tsx
Outdated
); | ||
|
||
const handleClick = () => { | ||
resetTargetStatus(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ここでtargetStatusのリセットをしているが、正常な遷移(/result)ではリセットされていないので、ここではなくて(/yatai)の読み込み時にリセットしたい
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
あ、そうか
そうだね
No description provided.