Commit 9663a003 authored by wildfirecode's avatar wildfirecode

1

parent 720aaa32
No preview for this file type
This diff is collapsed.
......@@ -47,7 +47,8 @@ function launchWithCustomModule(customModule) {
setTimeout(() => {
engine.globalEvent.dispatchEvent('pictures-start', {
picUrl: "http://yun.duiba.com.cn/aurora/assets/e1593b97c27077b85b92f7eaaeae1ed64a1eb79a.png"
picUrl: "http://yun.duiba.com.cn/aurora/assets/e1593b97c27077b85b92f7eaaeae1ed64a1eb79a.png",
blockUrl: "888",
});
const d = engine.gameStage.sceneContainer.getChildAt(0);
......@@ -57,11 +58,12 @@ function launchWithCustomModule(customModule) {
setTimeout(() => {
engine.globalEvent.dispatchEvent('pictures-start', {
picUrl: "http://yun.duiba.com.cn/aurora/assets/e1593b97c27077b85b92f7eaaeae1ed64a1eb79a.png"
picUrl: "http://yun.duiba.com.cn/aurora/assets/e1593b97c27077b85b92f7eaaeae1ed64a1eb79a.png",
// picUrl: "http://yun.duiba.com.cn/aurora/assets/d23e73d37ec01931e48cbd0a4095367044c5675c.png"
blockUrl: "888"
});
}, 10*1000);
}, 5*1000);
});
engine.globalEvent.addEventListener('pictures-time-update', (e) => {
// console.log(e.type, e.data);
......
......@@ -6,7 +6,7 @@ const assets = [
{
"name": "玩家icon",
"url": "//yun.duiba.com.cn/aurora/assets/5b3e30496b2d9fdafb0cf3835fd6704ce10e45b4.png",
"uuid": "66f23d13-82a5-4cec-9496-301ec240d087",
"uuid": "888",
"ext": ".png"
},
{
......
This diff is collapsed.
This diff is collapsed.
......@@ -48,7 +48,7 @@
{
"name": "遮罩",
"url": "//yun.duiba.com.cn/aurora/assets/5b3e30496b2d9fdafb0cf3835fd6704ce10e45b4.png",
"uuid": "66f23d13-82a5-4cec-9496-301ec240d087",
"uuid": "888",
"ext": ".png"
}
],
......@@ -58,7 +58,8 @@
"pictures-start": {
"alias": "开始",
"data": {
"picUrl":"图片路径"
"picUrl":"图片路径",
"blockUrl":"blockUrl"
}
},
"pictures-stop": {
......
......@@ -4,7 +4,7 @@
import { props } from "../props";
import qietu from "./qietu";
import { getIndexFromRC, getRandomArray, getTextureByName, getTexture } from "./utils";
import { getIndexFromRC, getRandomArray, getTexture } from "./utils";
import ObjectPool = engine.ObjectPool;
// let OFFSET_X;
......@@ -24,8 +24,11 @@ export default class GameView extends engine.Container {
private _timeCounter = 0;
start() {
this.guideHole = new engine.Image(getTexture());
if (!this.guideHole) {
this.guideHole = new engine.Image();
this.guideHole.source = 'asset://' + props.blockUrl;
this.guideHole.mouseChildren = this.guideHole.mouseEnabled = false;
}
if (this.pictures) {
for (const pic of this.pictures) {
......@@ -80,10 +83,10 @@ export default class GameView extends engine.Container {
GAME_TIME -= 0.01
GAME_TIME = this.afterPointTwo(GAME_TIME);
GAME_TIME = GAME_TIME.toFixed(2)
if(GAME_TIME < 10){
if (GAME_TIME < 10) {
GAME_TIME = '0' + GAME_TIME
}
console.log(GAME_TIME);
// console.log(GAME_TIME);
engine.globalEvent.dispatchEvent('pictures-time-update', {
......@@ -151,7 +154,7 @@ export default class GameView extends engine.Container {
private picturesWrapper: engine.Sprite;
private guideHole: engine.Sprite;
private guideHole: engine.Image;
createRects() { }
setup() {
......@@ -238,7 +241,7 @@ export default class GameView extends engine.Container {
}
listenStageOn=1;
listenStageOn = 1;
stageOnUp(e) {
......@@ -330,7 +333,7 @@ export default class GameView extends engine.Container {
onMove(e: engine.MouseEvent) {
// 当前图片的位置
this.dragPic.x = e.stageX - this.localPicX - (750-props.W)/2;
this.dragPic.x = e.stageX - this.localPicX - (750 - props.W) / 2;
this.dragPic.y = e.stageY - this.localPicY - (this.stage.height - props.H) / 2;
console.log('fuck on this.stage.height', this.stage.height)
// console.log(this.dragPic.x, this.dragPic.y)
......
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