Skip to content

Commit

Permalink
change block score
Browse files Browse the repository at this point in the history
  • Loading branch information
da-in committed Jan 21, 2024
1 parent b5b9538 commit c6d1a3f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
3 changes: 2 additions & 1 deletion src/pages/play/PlayPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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<ComponentPublicInstance>()
const scoreRef = ref(0)
Expand Down Expand Up @@ -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) {
Expand Down
21 changes: 11 additions & 10 deletions src/pages/play/setting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down

0 comments on commit c6d1a3f

Please sign in to comment.