Commit c8bcf543 authored by 邱旭's avatar 邱旭

feat:merge

parent d0b09dd1
......@@ -36,6 +36,7 @@
"form-data": "^4.0.0",
"fs": "0.0.2",
"glslify": "^7.1.1",
"javascript-obfuscator": "^4.1.0",
"md5": "^2.3.0",
"path": "^0.12.7",
"progress": "^2.0.0",
......@@ -48,10 +49,9 @@
"rollup-plugin-progress": "^1.1.2",
"rollup-plugin-serve": "^1.1.0",
"rollup-plugin-terser": "^7.0.2",
"texture-packer-hycv": "^1.1.1",
"tslint": "^5.9.1",
"typescript": "^4.5.4",
"javascript-obfuscator": "^4.1.0",
"texture-packer-hycv": "^1.1.1"
"typescript": "^4.5.4"
},
"author": "haiyoucuv",
"license": "ISC"
......
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<title>new_game_template</title>
<meta name="viewport"
content="width=device-width,initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no"/>
<meta name="apple-mobile-web-app-capable" content="yes"/>
<meta name="full-screen" content="true"/>
<meta name="screen-orientation" content="portrait"/>
<meta name="x5-fullscreen" content="true"/>
<meta name="360-fullscreen" content="true"/>
<!-- 渲染引擎 -->
<script src="//yun.duiba.com.cn/db_games/libs0924/fyge_2.0.44_fixed_HMS.js" crossorigin="anonymous"></script>
<!--<script src="libs/fyge.min.js" crossorigin="anonymous"></script>-->
<!-- svga解析库 -->
<script src="//yun.duiba.com.cn/db_games/libs0924/svgaParser.minWeb.js" crossorigin="anonymous"></script>
<!-- 放声音的 -->
<script src="//yun.duiba.com.cn/db_games/libs0924/howler.min.js" crossorigin="anonymous"></script>
<style>
html,
body {
padding: 0;
margin: 0;
border: 0;
width: 100%;
height: 100%;
overflow: hidden;
position: absolute;
background-color: #ffffff;
}
#__loading__ {
position: absolute;
left: 50%;
top: 50%;
margin-left: -45px;
color: #ffffff;
}
#cusEngine {
line-height: 0;
font-size: 0;
position: absolute;
}
#canvas {
width: 100%;
height: 100%;
}
</style>
</head>
<body>
<div id="__loading__">拼命加载中...</div>
<div id="cusEngine">
<canvas id="canvas"></canvas>
</div>
<!-- 帧率检测 -->
<!-- <script src="https://yun.duiba.com.cn/db_games/libs0126/stats.js"></script> -->
<script>
const app = {
checkMember: () => {
return false;
}
};
function getApp() {
return app;
}
// document.oncontextmenu = () => false;
</script>
<script>
var CFG = CFG || {};
CFG.projectId = 'pa525eacc';//线上直接写死
CFG.appID = '76177';//线上直接写死
//TODO我的奖品链接
window["recordUrl"] = "fe071865b.html";
window.addEventListener("load", function () {
//获取canvas
var canvas = document.getElementById("canvas");
canvas.width = document.body.clientWidth * (window.devicePixelRatio || 1)
canvas.height = document.body.clientHeight * (window.devicePixelRatio || 1)
var main = new output.Game(canvas);
main.initWebEvent();
window.stage = main.stage
})
</script>
<!-- 构建的js -->
<script src="//yun.duiba.com.cn/db_games/activity/template/1753352343/output.js" crossorigin="anonymous"></script>
<!--test btn-->
<div style="
background-color:#aaaaaa;
width: 100px;
height: 50px;
position: fixed;
top: 0;
z-index: 99;
display: flex;
align-items: center;
justify-content: center"
onclick="output.GDispatcher.dispatchEvent(output.GAME_EVENT.START_GAME)"
>
开始游戏
</div>
</body>
</html>
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Game/resource/game/fudai.png

30.3 KB | W: | H:

Game/resource/game/fudai.png

15.7 KB | W: | H:

Game/resource/game/fudai.png
Game/resource/game/fudai.png
Game/resource/game/fudai.png
Game/resource/game/fudai.png
  • 2-up
  • Swipe
  • Onion skin
Game/resource/game/红包1.png

20.6 KB | W: | H:

Game/resource/game/红包1.png

81.1 KB | W: | H:

Game/resource/game/红包1.png
Game/resource/game/红包1.png
Game/resource/game/红包1.png
Game/resource/game/红包1.png
  • 2-up
  • Swipe
  • Onion skin
Game/resource/game/红包2.png

25.8 KB | W: | H:

Game/resource/game/红包2.png

38.4 KB | W: | H:

Game/resource/game/红包2.png
Game/resource/game/红包2.png
Game/resource/game/红包2.png
Game/resource/game/红包2.png
  • 2-up
  • Swipe
  • Onion skin
Game/resource/game/红包3.png

64.1 KB | W: | H:

Game/resource/game/红包3.png

28.8 KB | W: | H:

Game/resource/game/红包3.png
Game/resource/game/红包3.png
Game/resource/game/红包3.png
Game/resource/game/红包3.png
  • 2-up
  • Swipe
  • Onion skin
Game/resource/game/金币.png

10.8 KB | W: | H:

Game/resource/game/金币.png

22.9 KB | W: | H:

Game/resource/game/金币.png
Game/resource/game/金币.png
Game/resource/game/金币.png
Game/resource/game/金币.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -5,7 +5,7 @@
"name": "common"
},
{
"keys": "coin.svga,fudai.png,点中红包飘爱心.svga,点中飘金币.svga,红包1.png,红包2.png,红包3.png,金币.png",
"keys": "4点击反馈.svga,coin.svga,fudai.png,点中红包飘爱心.svga,点中飘金币.svga,红包1.png,红包2.png,红包3.png,金币.png",
"name": "game"
}
],
......
......@@ -14,7 +14,7 @@ interface IConfig {
const gameConfig: IConfig = {
dropSpeed: 650, // 掉落速度(px/s)
interval: 0.15, // 掉落间隔事件(s)
interval: 0.3, // 掉落间隔事件(s)
player: "人物.png", // 任务图片
rainObj: ["金币.png", "红包1.png", "红包2.png", "红包3.png", "fudai.png"], // 掉落物图片
};
......
......@@ -15,6 +15,17 @@ export const ResJson = {
"sh": 180,
"ro": true
},
"comCloseBtn.png": {
"x": 184,
"y": 134,
"w": 58,
"h": 58,
"ox": 0,
"oy": 0,
"sw": 58,
"sh": 58,
"ro": false
},
"toastBg.png": {
"x": 2,
"y": 2,
......@@ -36,81 +47,70 @@ export const ResJson = {
"sw": 56,
"sh": 56,
"ro": false
},
"comCloseBtn.png": {
"x": 184,
"y": 134,
"w": 58,
"h": 58,
"ox": 0,
"oy": 0,
"sw": 58,
"sh": 58,
"ro": false
}
}
},
{
"keys": "coin.svga,fudai.png,点中红包飘爱心.svga,点中飘金币.svga,红包1.png,红包2.png,红包3.png,金币.png",
"keys": "4点击反馈.svga,coin.svga,fudai.png,点中红包飘爱心.svga,点中飘金币.svga,红包1.png,红包2.png,红包3.png,金币.png",
"name": "game",
"atlas": {
"红包1.png": {
"x": 311,
"y": 152,
"w": 105,
"h": 134,
"红包2.png": {
"x": 261,
"y": 2,
"w": 167,
"h": 190,
"ox": 0,
"oy": 0,
"sw": 105,
"sh": 134,
"ro": true
"sw": 167,
"sh": 190,
"ro": false
},
"fudai.png": {
"x": 311,
"y": 2,
"w": 148,
"h": 148,
"金币.png": {
"x": 162,
"y": 297,
"w": 119,
"h": 137,
"ox": 0,
"oy": 0,
"sw": 148,
"sh": 148,
"sw": 119,
"sh": 137,
"ro": false
},
"红包2.png": {
"红包3.png": {
"x": 2,
"y": 234,
"w": 177,
"h": 150,
"y": 297,
"w": 139,
"h": 158,
"ox": 0,
"oy": 0,
"sw": 177,
"sh": 150,
"ro": false
"sw": 139,
"sh": 158,
"ro": true
},
"金币.png": {
"x": 181,
"y": 259,
"w": 99,
"h": 75,
"fudai.png": {
"x": 261,
"y": 194,
"w": 97,
"h": 111,
"ox": 0,
"oy": 0,
"sw": 99,
"sh": 75,
"sw": 97,
"sh": 111,
"ro": true
},
"红包3.png": {
"红包1.png": {
"x": 2,
"y": 2,
"w": 307,
"h": 230,
"w": 257,
"h": 293,
"ox": 0,
"oy": 0,
"sw": 307,
"sh": 230,
"sw": 257,
"sh": 293,
"ro": false
}
}
}
],
"path": "https://yun.duiba.com.cn/db_games/activity/template/1706532299/resource/"
"path": "https://yun.duiba.com.cn/db_games/activity/template/1753352146/resource/"
}
\ No newline at end of file
......@@ -55,12 +55,12 @@ export class GameScene extends Scene {
*/
addEffect(x, y, name) {
const svga = {
"红包1.png": "点中红包飘爱心.svga",
"红包2.png": "点中飘金币.svga",
"红包3.png": "点中红包飘爱心.svga",
"金币.png": "点中飘金币.svga",
"fudai.png": "点中红包飘爱心.svga",
}[name] || "点中红包飘爱心.svga";
"红包1.png": "4点击反馈.svga",
"红包2.png": "4点击反馈.svga",
"红包3.png": "4点击反馈.svga",
"金币.png": "4点击反馈.svga",
"fudai.png": "4点击反馈.svga",
}[name] || "4点击反馈.svga";
const boomEffect = this.effectCtn.addChild(new SvgaAni(RES.getRes(svga)));
const { videoWidth, videoHeight, totalFrames } = boomEffect;
boomEffect.position.set(x - videoWidth / 2, y - videoHeight / 2);
......
......@@ -32,11 +32,16 @@ export default class RainObj extends Container {
this.init();
}
getRandomNumber(min: number, max: number): number {
return Math.random() * (max - min) + min;
}
reset() {
const { width, height } = this.image;
const x = width / 2 + Math.random() * (750 - width);
this.position.set(x, -Math.random() * 200 - height);
this.rotation = Math.random() * 50 + 10;
const y = this.getRandomNumber(-Math.random() * 400 - height, -height)
this.position.set(x, y);
// this.rotation = Math.random() * 50 + 10;
}
init() {
......
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment