From c6d1a3fab99d91c9c8f671f384d365eca34f7f6f Mon Sep 17 00:00:00 2001 From: da-in Date: Sun, 21 Jan 2024 12:15:21 +0900 Subject: [PATCH] change block score --- src/pages/play/PlayPage.vue | 3 ++- src/pages/play/setting.ts | 21 +++++++++++---------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/src/pages/play/PlayPage.vue b/src/pages/play/PlayPage.vue index c302cb5..be1e5c8 100644 --- a/src/pages/play/PlayPage.vue +++ b/src/pages/play/PlayPage.vue @@ -22,6 +22,7 @@ import {useTimer} from '../../hooks/use-timer.ts' import Layout from '../../components/Layout.vue' import Score from './_components/Score.vue' + import {blocks} from "@/pages/play/setting.ts"; const layoutRef = ref() const scoreRef = ref(0) @@ -111,7 +112,7 @@ } const index = Number(collision.bodyA.label) - scoreRef.value = scoreRef.value + (index * 2) + scoreRef.value = scoreRef.value + (blocks[index].score) // todo 최고 단계일 경우 처리 if (index === 10) { diff --git a/src/pages/play/setting.ts b/src/pages/play/setting.ts index 677f96f..9d20d96 100644 --- a/src/pages/play/setting.ts +++ b/src/pages/play/setting.ts @@ -12,21 +12,22 @@ import b10 from '../../assets/block/10.png' type Block = { size: number; color: string; + score: number; }; const lineColor = '#1E1E1E' const blocks: { [key: number]: Block } = { - 1: { size: 26, color: '#FFB7E7' }, - 2: { size: 40, color: '#FFC8B7' }, - 3: { size: 54, color: '#FFDB98' }, - 4: { size: 90, color: '#97FFC6' }, - 5: { size: 100, color: '#94E9F6' }, - 6: { size: 120, color: '#FF8FDA' }, - 7: { size: 140, color: '#FF9A7A' }, - 8: { size: 160, color: '#FFC964' }, - 9: { size: 160, color: '#43F091' }, - 10: { size: 200, color: '#60C7FF' }, + 1: { size: 26, color: '#FFB7E7', score: 2}, + 2: { size: 40, color: '#FFC8B7', score: 4}, + 3: { size: 54, color: '#FFDB98', score: 6}, + 4: { size: 90, color: '#97FFC6', score: 8}, + 5: { size: 100, color: '#94E9F6', score: 16}, + 6: { size: 120, color: '#FF8FDA', score: 32}, + 7: { size: 140, color: '#FF9A7A', score: 64}, + 8: { size: 160, color: '#FFC964', score: 128}, + 9: { size: 160, color: '#43F091', score: 256}, + 10: { size: 200, color: '#60C7FF', score: 512}, }; export {lineColor, blocks}