Skip to content
This repository has been archived by the owner on Nov 26, 2024. It is now read-only.

ぬるぬる動くようになった #49

Merged
merged 12 commits into from
Aug 19, 2024
Merged

ぬるぬる動くようになった #49

merged 12 commits into from
Aug 19, 2024

Conversation

K-Kizuku
Copy link
Collaborator

No description provided.

Copy link

github-actions bot commented Aug 17, 2024

Lighthouse Report

URL Performance Accessibility Best Practices SEO PWA Details
https://virtual-natsumatsuri.web.app/ 🟡72 🟢100 🟢100 🟡85 🟡56 📝 result

Copy link

Visualizer Report

You can view the results here.

Sea10wood
Sea10wood previously approved these changes Aug 17, 2024
Copy link
Collaborator

@Sea10wood Sea10wood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jaとLinkの閉じかっこの修正、諸々あざます。

Copy link
Owner

@claustra01 claustra01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

なんかrebaseミスってるぽい

Comment on lines 21 to 37
// 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 });
Copy link
Owner

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も統合できるので、不要なコメント群諸々綺麗にして欲しいです

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

あーこの使い分け意味あるのかと思ったけど統合していいやつなのね
統合しときます

index.html Show resolved Hide resolved
import style from "./index.module.css";

const Shooter = () => {
const [isOpen, setIsOpen] = useState(true);
const [score, setScore] = useState<number>(0);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

このscoreは命中した数のカウント用なんだ!!消さないでくれ🥺🥺

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

あ、ミスって消してたわ
戻しとく

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sea10さんのzustandでのscore管理をマージしたので、そのまま消しておきます

Comment on lines 43 to 50
useEffect(() => {
onMessage((data) => {
if (data.message_type === MessageType.Hit && data.id === uuid) {
setScore((prevScore) => prevScore + 1);
console.log(score);
}
});
}, [onMessage, uuid, score]);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

この辺でtype=hitのwebsocketメッセージを受け取ってスコアをカウントしてる
消さないでくれ🥺🥺

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

同じく戻しとく

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

上に同じ

src/components/Yatai/TargetOverlay.module.css Show resolved Hide resolved
src/pages/shooter/index.tsx Outdated Show resolved Hide resolved
src/pages/shooter/index.tsx Show resolved Hide resolved
@K-Kizuku K-Kizuku requested a review from claustra01 August 18, 2024 20:47
@claustra01 claustra01 closed this Aug 18, 2024
@claustra01 claustra01 reopened this Aug 18, 2024
@claustra01
Copy link
Owner

deployし直しのためreopen

);

const handleClick = () => {
resetTargetStatus();
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ここでtargetStatusのリセットをしているが、正常な遷移(/result)ではリセットされていないので、ここではなくて(/yatai)の読み込み時にリセットしたい

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

あ、そうか
そうだね

@claustra01 claustra01 closed this Aug 19, 2024
@claustra01 claustra01 reopened this Aug 19, 2024
@K-Kizuku K-Kizuku merged commit f167e96 into main Aug 19, 2024
3 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants