提交 3648c936 authored 作者: lidongxu's avatar lidongxu

1.23 版本完成_准备下一步做快速再来下一把

上级 0d9e4950
--- ---
name: 泡泡龙三端项目搭建 name: 伙伴泡泡三端项目搭建
overview: 在 paopao 目录下新建 server(Node.js 后台)、big-screen(大屏展示页)、admin(后台管理系统)三个项目,与现有 minigame-1 并列,实现小游戏画面实时投屏到大屏、游戏数据持久化存储、后台管理控制等完整功能链路。 overview: 在 paopao 目录下新建 server(Node.js 后台)、big-screen(大屏展示页)、admin(后台管理系统)三个项目,与现有 minigame-1 并列,实现小游戏画面实时投屏到大屏、游戏数据持久化存储、后台管理控制等完整功能链路。
todos: todos:
- id: server-init - id: server-init
...@@ -56,7 +56,7 @@ todos: ...@@ -56,7 +56,7 @@ todos:
isProject: false isProject: false
--- ---
# 泡泡龙三端项目搭建规划 # 伙伴泡泡三端项目搭建规划
## 整体目录结构 ## 整体目录结构
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" /> <link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>泡泡龙 - 管理后台</title> <title>伙伴泡泡 - 管理后台</title>
</head> </head>
<body> <body>
<div id="app"></div> <div id="app"></div>
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
</el-breadcrumb> </el-breadcrumb>
</div> </div>
<div class="header-right"> <div class="header-right">
<span class="header-title">{{ currentTitle || '泡泡龙管理后台' }}</span> <span class="header-title">{{ currentTitle || '伙伴泡泡管理后台' }}</span>
</div> </div>
</el-header> </el-header>
</template> </template>
......
<template> <template>
<el-aside :width="asideWidth" class="sidebar" :class="{ 'sidebar--collapsed': collapsed }"> <el-aside :width="asideWidth" class="sidebar" :class="{ 'sidebar--collapsed': collapsed }">
<div class="logo"> <div class="logo">
<span v-show="!collapsed">泡泡龙管理</span> <span v-show="!collapsed">伙伴泡泡管理</span>
<span v-show="collapsed" class="logo-icon"></span> <span v-show="collapsed" class="logo-icon"></span>
</div> </div>
<el-menu <el-menu
......
...@@ -47,7 +47,7 @@ const router = createRouter({ ...@@ -47,7 +47,7 @@ const router = createRouter({
}) })
router.beforeEach((to, _from, next) => { router.beforeEach((to, _from, next) => {
document.title = to.meta.title ? `${to.meta.title} - 泡泡龙管理后台` : '泡泡龙管理后台' document.title = to.meta.title ? `${to.meta.title} - 伙伴泡泡管理后台` : '伙伴泡泡管理后台'
next() next()
}) })
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>泡泡龙 - 大屏展示</title> <title>伙伴泡泡 - 大屏展示</title>
<style> <style>
* { margin: 0; padding: 0; box-sizing: border-box; } * { margin: 0; padding: 0; box-sizing: border-box; }
html, body { html, body {
......
{ {
"name": "paopao-big-screen", "name": "paopao-big-screen",
"version": "1.0.0", "version": "1.0.0",
"description": "泡泡龙大屏展示页 - Vite + Canvas 2D", "description": "伙伴泡泡大屏展示页 - Vite + Canvas 2D",
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
* 根据 state 中的 grid 二维数组和 pushAnimOffsetY 绘制网格泡泡 * 根据 state 中的 grid 二维数组和 pushAnimOffsetY 绘制网格泡泡
*/ */
import { getBubbleRadius, gridToScreen, drawBubble3D } from './bubble.js' import { getBubbleRadius, gridToScreen, drawBubble3D } from './bubble.js'
import { SCREEN_WIDTH, SCREEN_HEIGHT, SAFE_AREA_BOTTOM } from '../constants.js'
/** /**
* 绘制泡泡网格 * 绘制泡泡网格
...@@ -23,4 +24,18 @@ export function drawBubbleGrid(ctx, grid, pushAnimOffsetY = 0) { ...@@ -23,4 +24,18 @@ export function drawBubbleGrid(ctx, grid, pushAnimOffsetY = 0) {
drawBubble3D(ctx, x, y + offsetY, getBubbleRadius(), color) drawBubble3D(ctx, x, y + offsetY, getBubbleRadius(), color)
} }
} }
// 绘制危险线(与小游戏端判定逻辑一致)
const R = getBubbleRadius()
const dangerY = SCREEN_HEIGHT - SAFE_AREA_BOTTOM - R * 11.2
ctx.save()
ctx.strokeStyle = 'rgba(255, 0, 0, 0.7)'
ctx.lineWidth = 2
ctx.setLineDash([8, 4])
ctx.beginPath()
ctx.moveTo(0, dangerY)
ctx.lineTo(SCREEN_WIDTH, dangerY)
ctx.stroke()
ctx.setLineDash([])
ctx.restore()
} }
...@@ -67,7 +67,7 @@ function drawTitle(ctx, cx, y) { ...@@ -67,7 +67,7 @@ function drawTitle(ctx, cx, y) {
// 主标题阴影 // 主标题阴影
ctx.font = `bold ${SCREEN_WIDTH * 0.145}px Arial` ctx.font = `bold ${SCREEN_WIDTH * 0.145}px Arial`
ctx.fillStyle = 'rgba(0,0,0,0.45)' ctx.fillStyle = 'rgba(0,0,0,0.45)'
ctx.fillText('泡泡龙', cx + 3, y + 3) ctx.fillText('伙伴泡泡', cx + 3, y + 3)
// 主标题渐变 // 主标题渐变
const tg = ctx.createLinearGradient(cx - 90, y - 30, cx + 90, y + 30) const tg = ctx.createLinearGradient(cx - 90, y - 30, cx + 90, y + 30)
...@@ -77,7 +77,7 @@ function drawTitle(ctx, cx, y) { ...@@ -77,7 +77,7 @@ function drawTitle(ctx, cx, y) {
ctx.shadowColor = 'rgba(168,85,247,0.8)' ctx.shadowColor = 'rgba(168,85,247,0.8)'
ctx.shadowBlur = 28 ctx.shadowBlur = 28
ctx.fillStyle = tg ctx.fillStyle = tg
ctx.fillText('泡泡龙', cx, y) ctx.fillText('伙伴泡泡', cx, y)
ctx.shadowBlur = 0 ctx.shadowBlur = 0
// 副标题 // 副标题
......
...@@ -101,10 +101,6 @@ export function drawShooter(ctx, shooterState) { ...@@ -101,10 +101,6 @@ export function drawShooter(ctx, shooterState) {
if (_bobPhase > Math.PI * 2) _bobPhase -= Math.PI * 2 if (_bobPhase > Math.PI * 2) _bobPhase -= Math.PI * 2
const bobOffset = Math.sin(_bobPhase) * R * 0.15 const bobOffset = Math.sin(_bobPhase) * R * 0.15
// 瞄准线
const aimPoints = shooterState.aimPoints ?? (isAiming ? calcAimPoints(x, bubbleBaseY, aimAngle) : [])
drawAimLine(ctx, aimPoints)
// 绘制鸡(以底部中心为旋转轴,跟随瞄准方向倾斜) // 绘制鸡(以底部中心为旋转轴,跟随瞄准方向倾斜)
const bottomY = chickenBottom + bounceOffsetY + bobOffset const bottomY = chickenBottom + bounceOffsetY + bobOffset
...@@ -120,6 +116,12 @@ export function drawShooter(ctx, shooterState) { ...@@ -120,6 +116,12 @@ export function drawShooter(ctx, shooterState) {
const headY = bottomY - Math.cos(_currentLean) * CHICKEN_HEIGHT * bounceScaleY - BUBBLE_TOP_OFFSET const headY = bottomY - Math.cos(_currentLean) * CHICKEN_HEIGHT * bounceScaleY - BUBBLE_TOP_OFFSET
drawBubble3D(ctx, headX, headY, R, currentColor) drawBubble3D(ctx, headX, headY, R, currentColor)
// 瞄准线从泡泡中心(headX/headY)出发
if (isAiming) {
const aimPts = calcAimPoints(headX, headY, aimAngle)
drawAimLine(ctx, aimPts)
}
// 下一颗预览泡泡 // 下一颗预览泡泡
const nextR = R * NEXT_SCALE const nextR = R * NEXT_SCALE
const nextX = x + NEXT_X_OFFSET const nextX = x + NEXT_X_OFFSET
......
-- ============================================================= -- =============================================================
-- 泡泡龙项目数据库初始化脚本 -- 伙伴泡泡项目数据库初始化脚本
-- 数据库:MySQL 5.7+ -- 数据库:MySQL 5.7+
-- 生成时间:2026-03-17 -- 生成时间:2026-03-17
-- ============================================================= -- =============================================================
......
{ {
"name": "paopao-server", "name": "paopao-server",
"version": "1.0.0", "version": "1.0.0",
"description": "泡泡龙游戏后台服务 - Express + Socket.io + Prisma + MySQL", "description": "伙伴泡泡游戏后台服务 - Express + Socket.io + Prisma + MySQL",
"main": "src/app.js", "main": "src/app.js",
"scripts": { "scripts": {
"start": "node src/app.js", "start": "node src/app.js",
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论