Skip to content

Commit

Permalink
✨ feat(business): chaneg games config
Browse files Browse the repository at this point in the history
  • Loading branch information
Ting-Code committed Nov 13, 2024
1 parent 4feb551 commit ee8c7b7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 25 deletions.
14 changes: 0 additions & 14 deletions packages/apps/admin/src/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,10 @@ export {}

declare module 'vue' {
export interface GlobalComponents {
ElAside: typeof import('element-plus/es')['ElAside']
ElBreadcrumb: typeof import('element-plus/es')['ElBreadcrumb']
ElBreadcrumbItem: typeof import('element-plus/es')['ElBreadcrumbItem']
ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider']
ElContainer: typeof import('element-plus/es')['ElContainer']
ElDivider: typeof import('element-plus/es')['ElDivider']
ElDrawer: typeof import('element-plus/es')['ElDrawer']
ElDropdown: typeof import('element-plus/es')['ElDropdown']
ElDropdownItem: typeof import('element-plus/es')['ElDropdownItem']
ElDropdownMenu: typeof import('element-plus/es')['ElDropdownMenu']
ElHeader: typeof import('element-plus/es')['ElHeader']
ElIcon: typeof import('element-plus/es')['ElIcon']
ElMain: typeof import('element-plus/es')['ElMain']
ElMenu: typeof import('element-plus/es')['ElMenu']
ElMenuItem: typeof import('element-plus/es')['ElMenuItem']
ElSubMenu: typeof import('element-plus/es')['ElSubMenu']
ElTabPane: typeof import('element-plus/es')['ElTabPane']
ElTabs: typeof import('element-plus/es')['ElTabs']
RouterLink: typeof import('vue-router')['RouterLink']
RouterView: typeof import('vue-router')['RouterView']
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,15 @@ export function initMatter(element: HTMLElement) {
typescriptSvg
].map((svg) => {
const boxWidthScale = boxWidth / (30 * 200)
const Scale = getRandomNumber(boxWidthScale, boxWidthScale + 0.2, 2)
const Scale = getRandomNumber(boxWidthScale, boxWidthScale + 0.3, 2)
console.log('Scale:', Scale, 'boxWidth:', boxWidth, boxHeight, getRandomNumber(0.8, 1, 2))
return Bodies.circle(
getRandomNumber(20, boxWidth - 20),
getRandomNumber(20, boxHeight - 20),
// getRandomNumber(20, boxHeight - 20),
-100,
200 * Scale,
{
restitution: getRandomNumber(0.6, 1, 2), // 弹力系数
restitution: getRandomNumber(0.6, 0.8, 1), // 弹力系数
render: {
sprite: {
texture: svg,
Expand All @@ -62,18 +63,12 @@ export function initMatter(element: HTMLElement) {
}

// 创建上下左右四面墙
const groundTop = Bodies.rectangle(0, 0, boxWidth * 2, 10, { isStatic: true })
// const groundTop = Bodies.rectangle(0, 0, boxWidth * 2, 10, { isStatic: true })
const groundBottom = Bodies.rectangle(0, boxHeight, boxWidth * 2, 10, { isStatic: true })
const groundLeft = Bodies.rectangle(0, 0, 10, boxHeight * 2, { isStatic: true })
const groundRight = Bodies.rectangle(boxWidth, 0, 10, boxHeight * 2, { isStatic: true })

Composite.add(engine.world, [
groundTop,
groundBottom,
groundLeft,
groundRight,
...getIconBallList()
])
Composite.add(engine.world, [groundBottom, groundLeft, groundRight, ...getIconBallList()])

// 添加鼠标控制
const mouse = Mouse.create(render.canvas)
Expand Down

0 comments on commit ee8c7b7

Please sign in to comment.