Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Z
zeroing-libs
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
劳工
zeroing-libs
Commits
55cac8e5
Commit
55cac8e5
authored
Jun 30, 2020
by
王炽
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
6666666
parent
c7d2c572
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
87 additions
and
50 deletions
+87
-50
.DS_Store
dist/.DS_Store
+0
-0
app.js
src/custom/rockji/debug/app.js
+65
-34
main.js
src/custom/rockji/debug/main.js
+8
-8
main.js.map
src/custom/rockji/debug/main.js.map
+1
-1
GameView.ts
src/custom/rockji/src/game/GameView.ts
+13
-7
No files found.
dist/.DS_Store
View file @
55cac8e5
No preview for this file type
src/custom/rockji/debug/app.js
View file @
55cac8e5
...
@@ -17,7 +17,7 @@ function launchWithCustomModule(customModule) {
...
@@ -17,7 +17,7 @@ function launchWithCustomModule(customModule) {
//engine.registerCustomCodeModule(customModule);
//engine.registerCustomCodeModule(customModule);
engine
.
registerCustomModule
(
customId
,
window
[
customId
]);
engine
.
registerCustomModule
(
customId
,
window
[
customId
]);
const
{
props
:
propsOption
,
assets
}
=
customModule
;
const
{
props
:
propsOption
,
assets
}
=
customModule
;
let
props
=
engine
.
computeProps
(
customModuleProps
,
propsOption
);
let
props
=
engine
.
computeProps
(
customModuleProps
,
propsOption
);
const
customModuleIns
=
{
const
customModuleIns
=
{
id
:
customId
,
id
:
customId
,
...
@@ -45,43 +45,74 @@ function launchWithCustomModule(customModule) {
...
@@ -45,43 +45,74 @@ function launchWithCustomModule(customModule) {
engine
.
addCustomModule
(
customId
,
engine
.
gameStage
.
sceneContainer
.
getChildAt
(
0
));
engine
.
addCustomModule
(
customId
,
engine
.
gameStage
.
sceneContainer
.
getChildAt
(
0
));
engine
.
globalEvent
.
dispatchEvent
(
'rock-info'
,
{
prizes
:[
engine
.
globalEvent
.
dispatchEvent
(
'rock-info'
,
{
{
prizes
:
[
"icon"
:
"//yun.duiba.com.cn/aurora/assets/88d89ba9c3ddac732f2e017023a216be915655e4.png"
,
{
"id"
:
"o58df634f"
,
"icon"
:
"//yun.duiba.com.cn/polaris/odzr8wuh7y.3417f09f476bd948682b54ec13018796a63aa15f.jpeg"
,
"index"
:
1
,
"id"
:
"o58df634f"
,
"name"
:
"一等奖"
,
"index"
:
1
,
"prizeId"
:
"sss_3"
,
"name"
:
"一等奖"
,
"prizeType"
:
2
,
"prizeId"
:
"sss_3"
,
"refId"
:
"49781"
,
"prizeType"
:
2
,
"refType"
:
"virtual"
"refId"
:
"49781"
,
},
"refType"
:
"virtual"
{
},
"icon"
:
"//yun.duiba.com.cn/aurora/assets/1c0e0fcb192b2e0772bd555c3aae1c86621ccb09.png"
,
{
"id"
:
"o4a578392"
,
"icon"
:
"//yun.duiba.com.cn/polaris/o0shhpxtoy.22951ab8ac8975c1c08ba7933caa21fe2d629806.jpg"
,
"index"
:
2
,
"id"
:
"o4a578392"
,
"name"
:
"二等奖"
,
"index"
:
2
,
"prizeId"
:
"sss_2"
,
"name"
:
"二等奖"
,
"prizeType"
:
2
,
"prizeId"
:
"sss_2"
,
"refId"
:
"49780"
,
"prizeType"
:
2
,
"refType"
:
"virtual"
"refId"
:
"49780"
,
},
"refType"
:
"virtual"
{
},
"icon"
:
"//yun.duiba.com.cn/aurora/assets/bc23cd948cdd20467af9abc1f65e08e4f1e9bf30.png"
,
{
"id"
:
"o26efbbeb"
,
"icon"
:
"//yun.duiba.com.cn/polaris/xnjwcjf5ip.b7e68855228ddc5ef86bed1fefe63e7b1a65ebdf.jpeg"
,
"index"
:
3
,
"id"
:
"o26efbbeb"
,
"name"
:
"三等奖"
,
"index"
:
3
,
"prizeId"
:
"sss_1"
,
"name"
:
"三等奖"
,
"prizeType"
:
2
,
"prizeId"
:
"sss_1"
,
"refId"
:
"49779"
,
"prizeType"
:
2
,
"refType"
:
"virtual"
"refId"
:
"49779"
,
}]
"refType"
:
"virtual"
},
{
"icon"
:
"//yun.duiba.com.cn/polaris/u9vmvsvdeb.ebd3ca0774faddbf7220feca9eba30dfda1a343a.jpg"
,
"id"
:
"o26efbbeb"
,
"index"
:
3
,
"name"
:
"三等奖"
,
"prizeId"
:
"sss_4"
,
"prizeType"
:
2
,
"refId"
:
"49779"
,
"refType"
:
"virtual"
},
{
"icon"
:
"//yun.duiba.com.cn/polaris/v6uikiq60u.cbf7c5a21b83079aa3ea2a4fd41e7234fb8578a4.jpg"
,
"id"
:
"o26efbbeb"
,
"index"
:
3
,
"name"
:
"三等奖"
,
"prizeId"
:
"sss_5"
,
"prizeType"
:
2
,
"refId"
:
"49779"
,
"refType"
:
"virtual"
},
{
"icon"
:
"//yun.duiba.com.cn/polaris/10元话费.a34ae4a9411cfd82065fa366f8c3e3ec7a897fed.png"
,
"id"
:
"o26efbbeb"
,
"index"
:
3
,
"name"
:
"三等奖"
,
"prizeId"
:
"sss_6"
,
"prizeType"
:
2
,
"refId"
:
"49779"
,
"refType"
:
"virtual"
}]
});
});
},
100
);
},
100
);
setTimeout
(()
=>
{
setTimeout
(()
=>
{
engine
.
globalEvent
.
dispatchEvent
(
'rock-start'
,{
engine
.
globalEvent
.
dispatchEvent
(
'rock-start'
,
{
prizeId
:
"sss_3
"
prizeId
:
"sss_2
"
});
});
},
5000
);
},
5000
);
});
});
...
...
src/custom/rockji/debug/main.js
View file @
55cac8e5
...
@@ -23,6 +23,7 @@
...
@@ -23,6 +23,7 @@
_this
.
prizes
=
props
.
prizes
;
_this
.
prizes
=
props
.
prizes
;
_this
.
countdown
=
150
;
_this
.
countdown
=
150
;
_this
.
timeSpace
=
500
;
_this
.
timeSpace
=
500
;
console
.
log
(
"props.prizes="
,
props
.
prizes
);
return
_this
;
return
_this
;
}
}
GameView
.
prototype
.
setup
=
function
()
{
GameView
.
prototype
.
setup
=
function
()
{
...
@@ -37,7 +38,7 @@
...
@@ -37,7 +38,7 @@
this
.
viewContainer
.
width
=
props
.
viewWidth
;
this
.
viewContainer
.
width
=
props
.
viewWidth
;
this
.
viewContainer
.
height
=
props
.
viewHeight
;
this
.
viewContainer
.
height
=
props
.
viewHeight
;
this
.
bgImg
=
new
engine
.
Image
();
this
.
bgImg
=
new
engine
.
Image
();
this
.
bgImg
.
source
=
getAssetByName
(
"rock-背景"
).
url
;
this
.
bgImg
.
source
=
engine
.
getAssetByName
(
"rock-背景"
).
url
;
this
.
viewContainer
.
addChild
(
this
.
bgImg
);
this
.
viewContainer
.
addChild
(
this
.
bgImg
);
this
.
container0
=
new
engine
.
Container
();
this
.
container0
=
new
engine
.
Container
();
this
.
container1
=
new
engine
.
Container
();
this
.
container1
=
new
engine
.
Container
();
...
@@ -82,15 +83,14 @@
...
@@ -82,15 +83,14 @@
this
.
itemInfo
[
"items"
+
j
]
=
[];
this
.
itemInfo
[
"items"
+
j
]
=
[];
for
(
var
i
=
0
;
i
<
len
;
i
++
)
{
for
(
var
i
=
0
;
i
<
len
;
i
++
)
{
var
url
=
this
.
prizes
[
i
%
this
.
prizes
.
length
].
icon
;
var
url
=
this
.
prizes
[
i
%
this
.
prizes
.
length
].
icon
;
var
item
=
new
engine
.
Imag
e
();
var
item
=
new
engine
.
Sprit
e
();
item
.
source
=
url
;
item
.
texture
=
engine
.
Texture
.
fromImage
(
url
)
;
this
.
itemInfo
[
"items"
+
j
][
i
]
=
item
;
this
.
itemInfo
[
"items"
+
j
][
i
]
=
item
;
this
[
"container"
+
j
].
addChild
(
item
);
this
[
"container"
+
j
].
addChild
(
item
);
item
.
width
=
props
.
imgSizeW
;
item
.
width
=
props
.
imgSizeW
;
item
.
height
=
props
.
imgSizeH
;
item
.
height
=
props
.
imgSizeH
;
item
.
x
=
props
.
spaceSizeX
;
item
.
x
=
props
.
spaceSizeX
;
item
.
y
=
props
.
spaceSizeY
+
i
*
(
props
.
imgSizeH
+
props
.
spaceSizeY
);
item
.
y
=
props
.
spaceSizeY
+
i
*
(
props
.
imgSizeH
+
props
.
spaceSizeY
);
console
.
log
(
'i='
,
i
);
}
}
}
}
};
};
...
@@ -102,6 +102,7 @@
...
@@ -102,6 +102,7 @@
GameView
.
prototype
.
start
=
function
()
{
GameView
.
prototype
.
start
=
function
()
{
var
_this
=
this
;
var
_this
=
this
;
this
.
prizeId
=
props
.
prizeId
;
this
.
prizeId
=
props
.
prizeId
;
console
.
log
(
"this.prizeId="
,
this
.
prizeId
);
var
_loop_1
=
function
(
i
)
{
var
_loop_1
=
function
(
i
)
{
engine
.
Tween
.
removeTweens
(
this_1
[
"container"
+
i
]);
engine
.
Tween
.
removeTweens
(
this_1
[
"container"
+
i
]);
setTimeout
(
function
()
{
setTimeout
(
function
()
{
...
@@ -139,15 +140,15 @@
...
@@ -139,15 +140,15 @@
for
(
var
i
=
0
;
i
<
len
;
i
++
)
{
for
(
var
i
=
0
;
i
<
len
;
i
++
)
{
var
plen
=
this
.
prizes
.
length
;
var
plen
=
this
.
prizes
.
length
;
if
(
direct
>
0
)
{
if
(
direct
>
0
)
{
this
.
itemInfo
[
"items"
+
j
][
i
].
source
=
this
.
prizes
[(
plen
-
1
)
-
(
i
%
plen
)].
icon
;
this
.
itemInfo
[
"items"
+
j
][
i
].
texture
=
engine
.
Texture
.
fromImage
(
this
.
prizes
[(
plen
-
1
)
-
(
i
%
plen
)].
icon
)
;
}
}
else
{
else
{
this
.
itemInfo
[
"items"
+
j
][
i
].
source
=
this
.
prizes
[(
i
%
plen
)].
icon
;
this
.
itemInfo
[
"items"
+
j
][
i
].
texture
=
engine
.
Texture
.
fromImage
(
this
.
prizes
[(
i
%
plen
)].
icon
)
;
}
}
}
}
}
}
for
(
var
i
=
0
;
i
<
3
;
i
++
)
{
for
(
var
i
=
0
;
i
<
3
;
i
++
)
{
this
.
itemInfo
[
"items"
+
i
][
1
].
source
=
this
.
getPrizeUrl
(
this
.
prizeId
);
this
.
itemInfo
[
"items"
+
i
][
1
].
texture
=
engine
.
Texture
.
fromImage
(
this
.
getPrizeUrl
(
this
.
prizeId
)
);
}
}
};
};
GameView
.
prototype
.
getPrizeUrl
=
function
(
pid
)
{
GameView
.
prototype
.
getPrizeUrl
=
function
(
pid
)
{
...
@@ -170,7 +171,6 @@
...
@@ -170,7 +171,6 @@
};
};
return
GameView
;
return
GameView
;
}(
engine
.
Container
));
}(
engine
.
Container
));
//# sourceMappingURL=GameView.js.map
var
GameWrapper
=
(
function
(
_super
)
{
var
GameWrapper
=
(
function
(
_super
)
{
tslib
.
__extends
(
GameWrapper
,
_super
);
tslib
.
__extends
(
GameWrapper
,
_super
);
...
...
src/custom/rockji/debug/main.js.map
View file @
55cac8e5
{"version":3,"file":"index.js","sources":["src/custom/rockji/src/props.ts","src/custom/rockji/src/game/GameView.ts","src/custom/rockji/src/game/GameWrapper.ts","src/custom/rockji/src/index.ts"],"sourcesContent":["/**\n * Created by rockyl on 2020-01-21.\n */\n\nexport let props: any = {};\n\nexport function prepareProps() {\n\tlet metaProps = getProps();\n\n\tengine.injectProp(props, metaProps);\n}\n\nexport function injectProps(p) {\n\tengine.injectProp(props, p);\n}\n","/**\n * Created by rockyl on 2018/8/16.\n */\n\nimport { props } from \"../props\";\nimport { playSound, createSvga } from \"./utils\";\nimport ObjectPool = engine.ObjectPool;\nimport { getTextureByName } from \"./utils\";\nimport { Goods } from \"./Goods\";\nimport { PoolName } from \"./object-pool-init\";\n\n\n\nexport default class GameView extends engine.Container {\n\n\tprivate _hasSetup;\n\n\t//玩家\n\tprivate player: engine.Container;\n\t//触摸层\n\t// private rectBg: engine.Rect;\n\tprivate rectBg: engine.Container;\n\t//npc层\n\tprivate NpcBg: engine.Container;\n\t//倒计时\n\tprivate countdown: number;\n\t//每列滚动时间间隔\n\tprivate timeSpace: number;\n\n\tprivate prizes;\n\tprivate bgImg:engine.Image;\n\tprivate bgImgUrl:string;\n\tprivate itemInfo:any;\n\tprivate prizeMaxH:number;\n\tprivate orgY:number;\n\n\tprivate prizeId:string;\n\n\tprivate container0:engine.Container;\n\tprivate container1:engine.Container;\n\tprivate container2:engine.Container;\n\n\tprivate mainContainer:engine.Container;\n\tprivate viewContainer:engine.Container;\n\n\tprivate configInfo:any;\n\n\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis.once(engine.Event.ADDED_TO_STAGE, this.setup, this);\n\t\t// this.configInfo = {\n\t\t// \tprizes:[\n\t\t// \t\t{type:0, url:'//yun.duiba.com.cn/aurora/assets/88d89ba9c3ddac732f2e017023a216be915655e4.png'},\n\t\t// \t\t{type:1, url:'//yun.duiba.com.cn/aurora/assets/1c0e0fcb192b2e0772bd555c3aae1c86621ccb09.png'},\n\t\t// \t\t{type:2, url:'//yun.duiba.com.cn/aurora/assets/bc23cd948cdd20467af9abc1f65e08e4f1e9bf30.png'}\n\t\t// \t],//奖品链接列表\n\t\t// \tbgImgUrl:'//yun.duiba.com.cn/aurora/assets/877058dcced99e42ddd2ccf19c2bce189fa45d5c.png',\n\t\t// \timgSize:{w:99,h:103},//奖品尺寸\n\t\t// \tspaceSize:{x:20, y:20},//奖品横向和纵向间隙\n\t\t// \tcOriginSize:{x:22, y:19},//遮罩左边定点位置\n\t\t// \tcSpaceSize:{x:23, y:0},//每列奖品的间隙\n\t\t// }\n\t\t\n\n\t\t// this.bgImgUrl = '//yun.duiba.com.cn/aurora/assets/877058dcced99e42ddd2ccf19c2bce189fa45d5c.png';\n\n\t\t// this.maskSize = {w:428, h:221};\n\t\t// this.imgSize = {w:99,h:103};\n\t\t// this.spaceSize = {x:20, y:20};\n\t\t// // this.originSize = {x:0, y:0}\n\t\t// this.cOriginSize = {x:22, y:19};//遮罩的初始坐标\n\t\t// this.cSpaceSize = {x:23, y:0};//奖品容器横向纵向的边距\n\n\t\t// this.prizes = [\n\t\t// \t{\n\t\t// \t\t\"icon\":\"//yun.duiba.com.cn/aurora/assets/88d89ba9c3ddac732f2e017023a216be915655e4.png\",\n\t\t// \t\t\"id\":\"o58df634f\",\n\t\t// \t\t\"index\":1,\n\t\t// \t\t\"name\":\"一等奖\",\n\t\t// \t\t\"prizeId\":\"sss_3\",\n\t\t// \t\t\"prizeType\":2,\n\t\t// \t\t\"refId\":\"49781\",\n\t\t// \t\t\"refType\":\"virtual\"\n\t\t// \t},\n\t\t// \t{\n\t\t// \t\t\"icon\":\"//yun.duiba.com.cn/aurora/assets/1c0e0fcb192b2e0772bd555c3aae1c86621ccb09.png\",\n\t\t// \t\t\"id\":\"o4a578392\",\n\t\t// \t\t\"index\":2,\n\t\t// \t\t\"name\":\"二等奖\",\n\t\t// \t\t\"prizeId\":\"sss_2\",\n\t\t// \t\t\"prizeType\":2,\n\t\t// \t\t\"refId\":\"49780\",\n\t\t// \t\t\"refType\":\"virtual\"\n\t\t// \t},\n\t\t// \t{\n\t\t// \t\t\"icon\":\"//yun.duiba.com.cn/aurora/assets/bc23cd948cdd20467af9abc1f65e08e4f1e9bf30.png\",\n\t\t// \t\t\"id\":\"o26efbbeb\",\n\t\t// \t\t\"index\":3,\n\t\t// \t\t\"name\":\"三等奖\",\n\t\t// \t\t\"prizeId\":\"sss_1\",\n\t\t// \t\t\"prizeType\":2,\n\t\t// \t\t\"refId\":\"49779\",\n\t\t// \t\t\"refType\":\"virtual\"\n\t\t// }];\n\t\tthis.prizeId = props.prizeId;\n\t\tthis.prizes = props.prizes;\n\t\tthis.countdown = 150;\n\t\tthis.timeSpace = 500;\n\t}\n\n\tprivate waterSvga\n\tprivate stoneSvga\n\tprivate boomSvga\n\tprivate playerSvga\n\n\tsetup() {\n\t\tif (this._hasSetup) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tthis._hasSetup = true;\n\n\t\tthis.itemInfo = {};\n\n\t\t// this.bgImg = new engine.Image();\n\t\t// this.bgImg.source = this.bgImgUrl;\n\n\t\tthis.mainContainer = new engine.Container();\n\t\tthis.viewContainer = new engine.Container();\n\t\tthis.addChild(this.viewContainer);\n\n\t\tthis.viewContainer.width = props.viewWidth;\n\t\tthis.viewContainer.height = props.viewHeight;\n\n\t\t// this.bgImg = new engine.Sprite(getTextureByName('rock-背景'));\n\t\tthis.bgImg = new engine.Image();\n\t\tthis.bgImg.source = getAssetByName(\"rock-背景\").url;\n\t\tthis.viewContainer.addChild(this.bgImg);\n\n\t\tthis.container0 = new engine.Container();\n\t\tthis.container1 = new engine.Container();\n\t\tthis.container2 = new engine.Container();\n\n\t\tthis.mainContainer.addChild(this.container0);\n\t\tthis.mainContainer.addChild(this.container1);\n\t\tthis.mainContainer.addChild(this.container2);\n\n\t\tthis.viewContainer.addChild(this.mainContainer);\n\t\tthis.mainContainer.x = props.cOriginSizeX;\n\t\tthis.mainContainer.y = props.cOriginSizeY;\n\n\t\tlet mask = new engine.Rect();\n\t\tmask.x = props.cOriginSizeX;\n\t\tmask.y = props.cOriginSizeY;\n\t\tmask.fillColor = 0xffff00;\n\t\tmask.width = props.maskSizeW;\n\t\tmask.height = props.maskSizeH;\n\t\tthis.addChild(mask);\n\n\t\tthis.mainContainer.mask = mask;\n\n\t\t// this.container0.width = 140;\n\t\t// this.container0.height = 221;\n\n\t\t// this.container1.width = 140()\n\t\t// this.container1.height = 221;\n\n\t\t// this.container2.width = 140;\n\t\t// this.container2.height = 221;\n\n\t\tif(this.prizes.length > 3){\n\t\t\tthis.createItem(2);\n\t\t\tthis.prizeMaxH = this.prizes.length * (props.imgSizeW + props.spaceSizeY) + props.spaceSizeY;\n\t\t}else{\n\t\t\tthis.createItem(1);\n\t\t\tthis.prizeMaxH = 4 * (props.imgSizeW + props.spaceSizeY) + props.spaceSizeY;\n\t\t}\n\n\t\tthis.orgY = -(this.prizeMaxH - props.maskSizeH) + props.imgSizeH * 0.5;\n\t\tfor(let i = 0; i < 3; i++){\n\t\t\tthis['container' + i].x = i * (props.cSpaceSizeX * 2 + props.imgSizeW);\n\t\t\t// this['container' + i].y = this.orgY;\n\t\t\tthis['container' + i].y = this.orgY;\n\n\t\t}\n\n\t\t//mask 438 221\n\n\t}\n\n\t/**\n\t * type 1.小于4个奖品 2.4个及以上奖品\n\t */\n\tprivate createItem(type:number):void{\n\t\tlet len = 4;\n\t\tif(type == 1){\n\t\t\tlen = 4;\n\t\t}else if(type == 2){\n\t\t\tlen = this.prizes.length;\n\t\t}\n\n\t\tfor(let j = 0; j < 3; j++){\n\t\t\tthis.itemInfo[\"items\" + j] = [];\n\t\t\tfor(let i = 0; i < len; i++){\n\t\t\t\tlet url = this.prizes[i % this.prizes.length].icon;\n\t\t\t\tlet item = new engine.Image();\n\t\t\t\titem.source = url;\n\t\t\t\tthis.itemInfo[\"items\" + j][i] = item;\n\t\t\t\tthis[\"container\" + j].addChild(item);\n\n\t\t\t\titem.width = props.imgSizeW;\n\t\t\t\titem.height = props.imgSizeH;\n\t\t\t\titem.x = props.spaceSizeX;\n\t\t\t\titem.y = props.spaceSizeY + i * (props.imgSizeH + props.spaceSizeY);\n\n\t\t\t\tconsole.log('i=', i)\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t}\n\n\n\t/**\n\t * 重置场景\n\t */\n\treset() {\n\t\tfor(let i = 0; i < 3; i++){\n\t\t\tthis[\"container\" + i].y = this.orgY;\n\t\t}\n\t}\n\n\t/**\n\t * 开始\n\t */\n\tstart() {\n\t\tthis.prizeId = props.prizeId;\n\t\tfor(let i = 0; i < 3; i++){\n\t\t\tengine.Tween.removeTweens(this[\"container\" + i]);\n\t\t\tsetTimeout(() => {\n\t\t\t\tengine.Tween.get(this[\"container\" + i],{loop:true}).to({y:0}, this.countdown).call(()=>{\n\t\t\t\t\tthis[\"container\" + i].y = this.orgY;\n\t\t\t\t});\n\t\t\t}, this.timeSpace * i);\n\t\t}\n\n\t\tsetTimeout(() => {\n\t\t\tfor(let i = 0; i < 3; i++){\n\t\t\t\t// this[\"container\" + i].y = 0;//this.orgY;\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\tthis[\"container\" + i].y = this.orgY;\n\t\t\t\t\tengine.Tween.removeTweens(this[\"container\" + i]);\n\t\t\t\t\tengine.Tween.get(this[\"container\" + i]).to({y:-(props.imgSizeH * 0.5 + props.spaceSizeY)}, 1500);\n\t\t\t\t}, this.timeSpace * i);\n\t\t\t}\n\t\t\tthis.setPrizePos();\n\n\t\t\tsetTimeout(() => {\t\n\t\t\t\tengine.globalEvent.dispatchEvent('rock-gameover');\n\t\t\t}, this.timeSpace * 2 + 2000);\n\t\t}, 2500);\n\t\t\n\t}\n\n\tprivate setPrizePos():void{\n\t\tlet direct = Math.random() > 0.5 ? 1 : -1;\n\t\tfor(let j = 0; j < 3; j++){\n\t\t\tlet len = this.itemInfo[\"items\" + j].length;\n\t\t\tdirect *= -1;\n\t\t\tfor(let i = 0; i < len; i++){\n\t\t\t\tlet plen = this.prizes.length;\n\t\t\t\tif(direct > 0){\n\t\t\t\t\tthis.itemInfo[\"items\" + j][i].source = this.prizes[(plen - 1) - (i % plen)].icon;\n\t\t\t\t}else{\n\t\t\t\t\tthis.itemInfo[\"items\" + j][i].source = this.prizes[(i % plen)].icon;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfor(let i = 0; i < 3; i++){\n\t\t\t// this.prizeId = \"sss_3\";\n\t\t\tthis.itemInfo[\"items\" + i][1].source = this.getPrizeUrl(this.prizeId);\n\t\t}\n\n\t}\n\n\tprivate getPrizeUrl(pid:string):string{\n\t\tlet purl = \"\";\n\t\tfor(let i = 0; i < 3; i++){\n\t\t\tif(this.prizes[i].prizeId == pid){\n\t\t\t\treturn this.prizes[i].icon;\n\t\t\t}\n\t\t}\n\t\treturn purl;\n\t}\n\n\n\t/**\n\t * 暂停\n\t */\n\tpause() {\n\t\t\n\t}\n\n\t/**\n\t * 恢复\n\t */\n\trevive() {\n\t}\n\n\t/**\n\t * 重新开始\n\t */\n\tresume() {\n\t\t// this.reset()\n\t\t// this.start()\n\t}\n\n\t/**\n\t * 玩家死亡\n\t */\n\tprivate died() {\n\t\tthis.pause()\n\t}\n\n}\n","/**\n * Created by rockyl on 2020-01-09.\n */\n\nimport GameView from \"./GameView\";\nimport {injectProps} from \"../props\";\n\n\nexport class GameWrapper extends engine.Container {\n\tprivate _status;\n\tprivate _gameView: GameView;\n\n\tconstructor() {\n\t\tsuper();\n\t\tengine.globalEvent.addEventListener('rock-reset', this.reset, this);\n\t\tengine.globalEvent.addEventListener('rock-start', this.start, this);\n\t\tengine.globalEvent.addEventListener('rock-info', this.rinfo, this);\n\n\t\t// this.addEventListener(engine.MouseEvent.CLICK, this.onTap, this);\n\t\t// gameView.reset()\n\t\t// gameView.start()\n\t}\n\n\treset(event: engine.Event) {\t\t\n\t\tinjectProps(event.data);\n\t\tthis._gameView.visible = true;\n\t\tthis._gameView.reset();\n\t}\n\n\tstart(event: engine.Event) {\n\t\tinjectProps(event.data);\n\t\tthis._status = 1;\n\t\tthis._gameView.start();\n\t}\n\n\tprivate rinfo(event: engine.Event):void{\n\t\tinjectProps(event.data);\n\t\tconsole.log(\"event=\",event)\n\t\tconsole.log(\"event.data = \",event.data);\n\n\t\tlet gameView = this._gameView = new GameView();\n\t\tthis.addChild(gameView);\n\n\t}\n\n\tpause() {\n\t\tthis._gameView.pause();\n\t}\n\n\tresume() {\n\t\tthis._gameView.resume();\n\t}\n\n\trevive() {\n\t\tthis._gameView.revive();\n\t}\n\n\tclear() {\n\t\tthis._gameView.visible = false;\n\t}\n\n\tprivate onTap(event) {\n\t//\tthis._gameView.tap(event);\n\t}\n}\n","/**\n * Created by rockyl on 2019-11-20.\n */\n\nimport {GameWrapper} from \"./game/GameWrapper\";\nimport {injectProps, prepareProps} from \"./props\";\n\nexport default function (props) {\n\tprepareProps();\n\tinjectProps(props);\n\n\tlet instance = new GameWrapper();\n\treturn instance;\n}\n"],"names":["__extends"],"mappings":";;;;;;C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AC,KAAK,EAAE,CAAC;MACvB;KAEO,2BAAK,GAAb,UAAc,KAAmB;SAChC,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;SACxB,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAC,KAAK,CAAC,CAAA;SAC3B,OAAO,CAAC,GAAG,CAAC,eAAe,EAAC,KAAK,CAAC,IAAI,CAAC,CAAC;SAExC,IAAI,QAAQ,GAAG,IAAI,CAAC,SAAS,GAAG,IAAI,QAAQ,EAAE,CAAC;SAC/C,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;MAExB;KAED,2BAAK,GAAL;SACC,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC;MACvB;KAED,4BAAM,GAAN;SACC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC;MACxB;KAED,4BAAM,GAAN;SACC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC;MACxB;KAED,2BAAK,GAAL;SACC,IAAI,CAAC,SAAS,CAAC,OAAO,GAAG,KAAK,CAAC;MAC/B;KAEO,2BAAK,GAAb,UAAc,KAAK;MAElB;KACF,kBAAC;CAAD,CAAC,CAxDgC,MAAM,CAAC,SAAS,GAwDhD;;;iBCzDwB,KAAK;KAC7B,YAAY,EAAE,CAAC;KACf,WAAW,CAAC,KAAK,CAAC,CAAC;KAEnB,IAAI,QAAQ,GAAG,IAAI,WAAW,EAAE,CAAC;KACjC,OAAO,QAAQ,CAAC;CACjB,CAAC;;;;;;;;;"}
{"version":3,"file":"index.js","sources":["src/custom/rockji/src/props.ts","src/custom/rockji/src/game/GameView.ts","src/custom/rockji/src/game/GameWrapper.ts","src/custom/rockji/src/index.ts"],"sourcesContent":["/**\n * Created by rockyl on 2020-01-21.\n */\n\nexport let props: any = {};\n\nexport function prepareProps() {\n\tlet metaProps = getProps();\n\n\tengine.injectProp(props, metaProps);\n}\n\nexport function injectProps(p) {\n\tengine.injectProp(props, p);\n}\n","/**\n * Created by rockyl on 2018/8/16.\n */\n\nimport { props } from \"../props\";\nimport { playSound, createSvga } from \"./utils\";\nimport ObjectPool = engine.ObjectPool;\nimport { getTextureByName } from \"./utils\";\nimport { Goods } from \"./Goods\";\nimport { PoolName } from \"./object-pool-init\";\n\n\n\nexport default class GameView extends engine.Container {\n\n\tprivate _hasSetup;\n\n\t//玩家\n\tprivate player: engine.Container;\n\t//触摸层\n\t// private rectBg: engine.Rect;\n\tprivate rectBg: engine.Container;\n\t//npc层\n\tprivate NpcBg: engine.Container;\n\t//倒计时\n\tprivate countdown: number;\n\t//每列滚动时间间隔\n\tprivate timeSpace: number;\n\n\tprivate prizes;\n\tprivate bgImg:engine.Image;\n\tprivate bgImgUrl:string;\n\tprivate itemInfo:any;\n\tprivate prizeMaxH:number;\n\tprivate orgY:number;\n\n\tprivate prizeId:string;\n\n\tprivate container0:engine.Container;\n\tprivate container1:engine.Container;\n\tprivate container2:engine.Container;\n\n\tprivate mainContainer:engine.Container;\n\tprivate viewContainer:engine.Container;\n\n\tprivate configInfo:any;\n\n\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis.once(engine.Event.ADDED_TO_STAGE, this.setup, this);\n\t\t// this.configInfo = {\n\t\t// \tprizes:[\n\t\t// \t\t{type:0, url:'//yun.duiba.com.cn/aurora/assets/88d89ba9c3ddac732f2e017023a216be915655e4.png'},\n\t\t// \t\t{type:1, url:'//yun.duiba.com.cn/aurora/assets/1c0e0fcb192b2e0772bd555c3aae1c86621ccb09.png'},\n\t\t// \t\t{type:2, url:'//yun.duiba.com.cn/aurora/assets/bc23cd948cdd20467af9abc1f65e08e4f1e9bf30.png'}\n\t\t// \t],//奖品链接列表\n\t\t// \tbgImgUrl:'//yun.duiba.com.cn/aurora/assets/877058dcced99e42ddd2ccf19c2bce189fa45d5c.png',\n\t\t// \timgSize:{w:99,h:103},//奖品尺寸\n\t\t// \tspaceSize:{x:20, y:20},//奖品横向和纵向间隙\n\t\t// \tcOriginSize:{x:22, y:19},//遮罩左边定点位置\n\t\t// \tcSpaceSize:{x:23, y:0},//每列奖品的间隙\n\t\t// }\n\t\t\n\n\t\t// this.bgImgUrl = '//yun.duiba.com.cn/aurora/assets/877058dcced99e42ddd2ccf19c2bce189fa45d5c.png';\n\n\t\t// this.maskSize = {w:428, h:221};\n\t\t// this.imgSize = {w:99,h:103};\n\t\t// this.spaceSize = {x:20, y:20};\n\t\t// // this.originSize = {x:0, y:0}\n\t\t// this.cOriginSize = {x:22, y:19};//遮罩的初始坐标\n\t\t// this.cSpaceSize = {x:23, y:0};//奖品容器横向纵向的边距\n\n\t\t// this.prizes = [\n\t\t// \t{\n\t\t// \t\t\"icon\":\"//yun.duiba.com.cn/aurora/assets/88d89ba9c3ddac732f2e017023a216be915655e4.png\",\n\t\t// \t\t\"id\":\"o58df634f\",\n\t\t// \t\t\"index\":1,\n\t\t// \t\t\"name\":\"一等奖\",\n\t\t// \t\t\"prizeId\":\"sss_3\",\n\t\t// \t\t\"prizeType\":2,\n\t\t// \t\t\"refId\":\"49781\",\n\t\t// \t\t\"refType\":\"virtual\"\n\t\t// \t},\n\t\t// \t{\n\t\t// \t\t\"icon\":\"//yun.duiba.com.cn/aurora/assets/1c0e0fcb192b2e0772bd555c3aae1c86621ccb09.png\",\n\t\t// \t\t\"id\":\"o4a578392\",\n\t\t// \t\t\"index\":2,\n\t\t// \t\t\"name\":\"二等奖\",\n\t\t// \t\t\"prizeId\":\"sss_2\",\n\t\t// \t\t\"prizeType\":2,\n\t\t// \t\t\"refId\":\"49780\",\n\t\t// \t\t\"refType\":\"virtual\"\n\t\t// \t},\n\t\t// \t{\n\t\t// \t\t\"icon\":\"//yun.duiba.com.cn/aurora/assets/bc23cd948cdd20467af9abc1f65e08e4f1e9bf30.png\",\n\t\t// \t\t\"id\":\"o26efbbeb\",\n\t\t// \t\t\"index\":3,\n\t\t// \t\t\"name\":\"三等奖\",\n\t\t// \t\t\"prizeId\":\"sss_1\",\n\t\t// \t\t\"prizeType\":2,\n\t\t// \t\t\"refId\":\"49779\",\n\t\t// \t\t\"refType\":\"virtual\"\n\t\t// }];\n\t\tthis.prizeId = props.prizeId;\n\t\tthis.prizes = props.prizes;\n\t\tthis.countdown = 150;\n\t\tthis.timeSpace = 500;\n\n\t\tconsole.log(\"props.prizes=\",props.prizes);\n\t}\n\n\tprivate waterSvga\n\tprivate stoneSvga\n\tprivate boomSvga\n\tprivate playerSvga\n\n\tsetup() {\n\t\tif (this._hasSetup) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tthis._hasSetup = true;\n\n\t\tthis.itemInfo = {};\n\n\t\t// this.bgImg = new engine.Image();\n\t\t// this.bgImg.source = this.bgImgUrl;\n\n\t\tthis.mainContainer = new engine.Container();\n\t\tthis.viewContainer = new engine.Container();\n\t\tthis.addChild(this.viewContainer);\n\n\t\tthis.viewContainer.width = props.viewWidth;\n\t\tthis.viewContainer.height = props.viewHeight;\n\n\t\t// this.bgImg = new engine.Sprite(getTextureByName('rock-背景'));\n\t\tthis.bgImg = new engine.Image();\n\t\tthis.bgImg.source = engine.getAssetByName(\"rock-背景\").url;\n\t\tthis.viewContainer.addChild(this.bgImg);\n\n\t\tthis.container0 = new engine.Container();\n\t\tthis.container1 = new engine.Container();\n\t\tthis.container2 = new engine.Container();\n\n\t\tthis.mainContainer.addChild(this.container0);\n\t\tthis.mainContainer.addChild(this.container1);\n\t\tthis.mainContainer.addChild(this.container2);\n\n\t\tthis.viewContainer.addChild(this.mainContainer);\n\t\tthis.mainContainer.x = props.cOriginSizeX;\n\t\tthis.mainContainer.y = props.cOriginSizeY;\n\n\t\tlet mask = new engine.Rect();\n\t\tmask.x = props.cOriginSizeX;\n\t\tmask.y = props.cOriginSizeY;\n\t\tmask.fillColor = 0xffff00;\n\t\tmask.width = props.maskSizeW;\n\t\tmask.height = props.maskSizeH;\n\t\tthis.addChild(mask);\n\n\t\tthis.mainContainer.mask = mask;\n\n\t\t// this.container0.width = 140;\n\t\t// this.container0.height = 221;\n\n\t\t// this.container1.width = 140()\n\t\t// this.container1.height = 221;\n\n\t\t// this.container2.width = 140;\n\t\t// this.container2.height = 221;\n\n\t\tif(this.prizes.length > 3){\n\t\t\tthis.createItem(2);\n\t\t\tthis.prizeMaxH = this.prizes.length * (props.imgSizeW + props.spaceSizeY) + props.spaceSizeY;\n\t\t}else{\n\t\t\tthis.createItem(1);\n\t\t\tthis.prizeMaxH = 4 * (props.imgSizeW + props.spaceSizeY) + props.spaceSizeY;\n\t\t}\n\n\t\tthis.orgY = -(this.prizeMaxH - props.maskSizeH) + props.imgSizeH * 0.5;\n\t\tfor(let i = 0; i < 3; i++){\n\t\t\tthis['container' + i].x = i * (props.cSpaceSizeX * 2 + props.imgSizeW);\n\t\t\t// this['container' + i].y = this.orgY;\n\t\t\tthis['container' + i].y = this.orgY;\n\n\t\t}\n\n\t\t//mask 438 221\n\n\t}\n\n\t/**\n\t * type 1.小于4个奖品 2.4个及以上奖品\n\t */\n\tprivate createItem(type:number):void{\n\t\tlet len = 4;\n\t\tif(type == 1){\n\t\t\tlen = 4;\n\t\t}else if(type == 2){\n\t\t\tlen = this.prizes.length;\n\t\t}\n\n\t\tfor(let j = 0; j < 3; j++){\n\t\t\tthis.itemInfo[\"items\" + j] = [];\n\t\t\tfor(let i = 0; i < len; i++){\n\t\t\t\tlet url = this.prizes[i % this.prizes.length].icon;\n\t\t\t\tlet item = new engine.Sprite();\n\t\t\t\titem.texture = engine.Texture.fromImage(url);\n\t\t\t\tthis.itemInfo[\"items\" + j][i] = item;\n\t\t\t\tthis[\"container\" + j].addChild(item);\n\n\t\t\t\titem.width = props.imgSizeW;\n\t\t\t\titem.height = props.imgSizeH;\n\t\t\t\titem.x = props.spaceSizeX;\n\t\t\t\titem.y = props.spaceSizeY + i * (props.imgSizeH + props.spaceSizeY);\n\n\t\t\t\t// console.log('i=', i)\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t}\n\n\n\t/**\n\t * 重置场景\n\t */\n\treset() {\n\t\tfor(let i = 0; i < 3; i++){\n\t\t\tthis[\"container\" + i].y = this.orgY;\n\t\t}\n\t}\n\n\t/**\n\t * 开始\n\t */\n\tstart() {\n\t\tthis.prizeId = props.prizeId;\n\t\tconsole.log(\"this.prizeId=\",this.prizeId);\n\t\tfor(let i = 0; i < 3; i++){\n\t\t\tengine.Tween.removeTweens(this[\"container\" + i]);\n\t\t\tsetTimeout(() => {\n\t\t\t\tengine.Tween.get(this[\"container\" + i],{loop:true}).to({y:0}, this.countdown).call(()=>{\n\t\t\t\t\tthis[\"container\" + i].y = this.orgY;\n\t\t\t\t});\n\t\t\t}, this.timeSpace * i);\n\t\t}\n\n\t\tsetTimeout(() => {\n\t\t\tfor(let i = 0; i < 3; i++){\n\t\t\t\t// this[\"container\" + i].y = 0;//this.orgY;\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\tthis[\"container\" + i].y = this.orgY;\n\t\t\t\t\tengine.Tween.removeTweens(this[\"container\" + i]);\n\t\t\t\t\tengine.Tween.get(this[\"container\" + i]).to({y:-(props.imgSizeH * 0.5 + props.spaceSizeY)}, 1500);\n\t\t\t\t}, this.timeSpace * i);\n\t\t\t}\n\t\t\tthis.setPrizePos();\n\n\t\t\tsetTimeout(() => {\t\n\t\t\t\tengine.globalEvent.dispatchEvent('rock-gameover');\n\t\t\t}, this.timeSpace * 2 + 2000);\n\t\t}, 2500);\n\t\t\n\t}\n\n\tprivate setPrizePos():void{\n\t\tlet direct = Math.random() > 0.5 ? 1 : -1;\n\t\tfor(let j = 0; j < 3; j++){\n\t\t\tlet len = this.itemInfo[\"items\" + j].length;\n\t\t\tdirect *= -1;\n\t\t\tfor(let i = 0; i < len; i++){\n\t\t\t\tlet plen = this.prizes.length;\n\t\t\t\tif(direct > 0){\n\t\t\t\t\tthis.itemInfo[\"items\" + j][i].texture = engine.Texture.fromImage(this.prizes[(plen - 1) - (i % plen)].icon);\n\t\t\t\t\t// this.itemInfo[\"items\" + j][i].source = this.prizes[(plen - 1) - (i % plen)].icon;\n\t\t\t\t}else{\n\t\t\t\t\tthis.itemInfo[\"items\" + j][i].texture = engine.Texture.fromImage(this.prizes[(i % plen)].icon);\n\t\t\t\t\t// this.itemInfo[\"items\" + j][i].source = this.prizes[(i % plen)].icon;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfor(let i = 0; i < 3; i++){\n\t\t\t// this.prizeId = \"sss_3\";\n\t\t\tthis.itemInfo[\"items\" + i][1].texture = engine.Texture.fromImage(this.getPrizeUrl(this.prizeId));\n\t\t\t// this.itemInfo[\"items\" + i][1].source = this.getPrizeUrl(this.prizeId);\n\t\t}\n\n\t}\n\n\tprivate getPrizeUrl(pid:string):string{\n\t\tlet purl = \"\";\n\t\tfor(let i = 0; i < 3; i++){\n\t\t\tif(this.prizes[i].prizeId == pid){\n\t\t\t\treturn this.prizes[i].icon;\n\t\t\t}\n\t\t}\n\t\treturn purl;\n\t}\n\n\n\t/**\n\t * 暂停\n\t */\n\tpause() {\n\t\t\n\t}\n\n\t/**\n\t * 恢复\n\t */\n\trevive() {\n\t}\n\n\t/**\n\t * 重新开始\n\t */\n\tresume() {\n\t\t// this.reset()\n\t\t// this.start()\n\t}\n\n\t/**\n\t * 玩家死亡\n\t */\n\tprivate died() {\n\t\tthis.pause()\n\t}\n\n}\n","/**\n * Created by rockyl on 2020-01-09.\n */\n\nimport GameView from \"./GameView\";\nimport {injectProps} from \"../props\";\n\n\nexport class GameWrapper extends engine.Container {\n\tprivate _status;\n\tprivate _gameView: GameView;\n\n\tconstructor() {\n\t\tsuper();\n\t\tengine.globalEvent.addEventListener('rock-reset', this.reset, this);\n\t\tengine.globalEvent.addEventListener('rock-start', this.start, this);\n\t\tengine.globalEvent.addEventListener('rock-info', this.rinfo, this);\n\n\t\t// this.addEventListener(engine.MouseEvent.CLICK, this.onTap, this);\n\t\t// gameView.reset()\n\t\t// gameView.start()\n\t}\n\n\treset(event: engine.Event) {\t\t\n\t\tinjectProps(event.data);\n\t\tthis._gameView.visible = true;\n\t\tthis._gameView.reset();\n\t}\n\n\tstart(event: engine.Event) {\n\t\tinjectProps(event.data);\n\t\tthis._status = 1;\n\t\tthis._gameView.start();\n\t}\n\n\tprivate rinfo(event: engine.Event):void{\n\t\tinjectProps(event.data);\n\t\tconsole.log(\"event=\",event)\n\t\tconsole.log(\"event.data = \",event.data);\n\n\t\tlet gameView = this._gameView = new GameView();\n\t\tthis.addChild(gameView);\n\n\t}\n\n\tpause() {\n\t\tthis._gameView.pause();\n\t}\n\n\tresume() {\n\t\tthis._gameView.resume();\n\t}\n\n\trevive() {\n\t\tthis._gameView.revive();\n\t}\n\n\tclear() {\n\t\tthis._gameView.visible = false;\n\t}\n\n\tprivate onTap(event) {\n\t//\tthis._gameView.tap(event);\n\t}\n}\n","/**\n * Created by rockyl on 2019-11-20.\n */\n\nimport {GameWrapper} from \"./game/GameWrapper\";\nimport {injectProps, prepareProps} from \"./props\";\n\nexport default function (props) {\n\tprepareProps();\n\tinjectProps(props);\n\n\tlet instance = new GameWrapper();\n\treturn instance;\n}\n"],"names":["__extends"],"mappings":";;;;;;CAIO,IAAI,KAAK,GAAQ,EAAE,CAAC;AAE3B,UAAgB,YAAY;KAC3B,IAAI,SAAS,GAAG,QAAQ,EAAE,CAAC;KAE3B,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;CACrC,CAAC;AAED,UAAgB,WAAW,CAAC,CAAC;KAC5B,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;CAC7B,CAAC;;;CCDD;KAAsCA,kCAAgB;KAoCrD;SAAA,YACC,iBAAO,SA8DP;SA7DA,KAAI,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,cAAc,EAAE,KAAI,CAAC,KAAK,EAAE,KAAI,CAAC,CAAC;SAuDzD,KAAI,CAAC,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;SAC7B,KAAI,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;SAC3B,KAAI,CAAC,SAAS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C;SAC/C,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;MAExB;KAED,2BAAK,GAAL;SACC,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC;MACvB;KAED,4BAAM,GAAN;SACC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC;MACxB;KAED,4BAAM,GAAN;SACC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC;MACxB;KAED,2BAAK,GAAL;SACC,IAAI,CAAC,SAAS,CAAC,OAAO,GAAG,KAAK,CAAC;MAC/B;KAEO,2BAAK,GAAb,UAAc,KAAK;MAElB;KACF,kBAAC;CAAD,CAAC,CAxDgC,MAAM,CAAC,SAAS,GAwDhD;;;iBCzDwB,KAAK;KAC7B,YAAY,EAAE,CAAC;KACf,WAAW,CAAC,KAAK,CAAC,CAAC;KAEnB,IAAI,QAAQ,GAAG,IAAI,WAAW,EAAE,CAAC;KACjC,OAAO,QAAQ,CAAC;CACjB,CAAC;;;;;;;;;"}
\ No newline at end of file
\ No newline at end of file
src/custom/rockji/src/game/GameView.ts
View file @
55cac8e5
...
@@ -108,6 +108,8 @@ export default class GameView extends engine.Container {
...
@@ -108,6 +108,8 @@ export default class GameView extends engine.Container {
this
.
prizes
=
props
.
prizes
;
this
.
prizes
=
props
.
prizes
;
this
.
countdown
=
150
;
this
.
countdown
=
150
;
this
.
timeSpace
=
500
;
this
.
timeSpace
=
500
;
console
.
log
(
"props.prizes="
,
props
.
prizes
);
}
}
private
waterSvga
private
waterSvga
...
@@ -136,7 +138,7 @@ export default class GameView extends engine.Container {
...
@@ -136,7 +138,7 @@ export default class GameView extends engine.Container {
// this.bgImg = new engine.Sprite(getTextureByName('rock-背景'));
// this.bgImg = new engine.Sprite(getTextureByName('rock-背景'));
this
.
bgImg
=
new
engine
.
Image
();
this
.
bgImg
=
new
engine
.
Image
();
this
.
bgImg
.
source
=
getAssetByName
(
"rock-背景"
).
url
;
this
.
bgImg
.
source
=
engine
.
getAssetByName
(
"rock-背景"
).
url
;
this
.
viewContainer
.
addChild
(
this
.
bgImg
);
this
.
viewContainer
.
addChild
(
this
.
bgImg
);
this
.
container0
=
new
engine
.
Container
();
this
.
container0
=
new
engine
.
Container
();
...
@@ -205,8 +207,8 @@ export default class GameView extends engine.Container {
...
@@ -205,8 +207,8 @@ export default class GameView extends engine.Container {
this
.
itemInfo
[
"items"
+
j
]
=
[];
this
.
itemInfo
[
"items"
+
j
]
=
[];
for
(
let
i
=
0
;
i
<
len
;
i
++
){
for
(
let
i
=
0
;
i
<
len
;
i
++
){
let
url
=
this
.
prizes
[
i
%
this
.
prizes
.
length
].
icon
;
let
url
=
this
.
prizes
[
i
%
this
.
prizes
.
length
].
icon
;
let
item
=
new
engine
.
Imag
e
();
let
item
=
new
engine
.
Sprit
e
();
item
.
source
=
url
;
item
.
texture
=
engine
.
Texture
.
fromImage
(
url
)
;
this
.
itemInfo
[
"items"
+
j
][
i
]
=
item
;
this
.
itemInfo
[
"items"
+
j
][
i
]
=
item
;
this
[
"container"
+
j
].
addChild
(
item
);
this
[
"container"
+
j
].
addChild
(
item
);
...
@@ -215,7 +217,7 @@ export default class GameView extends engine.Container {
...
@@ -215,7 +217,7 @@ export default class GameView extends engine.Container {
item
.
x
=
props
.
spaceSizeX
;
item
.
x
=
props
.
spaceSizeX
;
item
.
y
=
props
.
spaceSizeY
+
i
*
(
props
.
imgSizeH
+
props
.
spaceSizeY
);
item
.
y
=
props
.
spaceSizeY
+
i
*
(
props
.
imgSizeH
+
props
.
spaceSizeY
);
console
.
log
(
'i='
,
i
)
//
console.log('i=', i)
}
}
}
}
...
@@ -236,6 +238,7 @@ export default class GameView extends engine.Container {
...
@@ -236,6 +238,7 @@ export default class GameView extends engine.Container {
*/
*/
start
()
{
start
()
{
this
.
prizeId
=
props
.
prizeId
;
this
.
prizeId
=
props
.
prizeId
;
console
.
log
(
"this.prizeId="
,
this
.
prizeId
);
for
(
let
i
=
0
;
i
<
3
;
i
++
){
for
(
let
i
=
0
;
i
<
3
;
i
++
){
engine
.
Tween
.
removeTweens
(
this
[
"container"
+
i
]);
engine
.
Tween
.
removeTweens
(
this
[
"container"
+
i
]);
setTimeout
(()
=>
{
setTimeout
(()
=>
{
...
@@ -271,16 +274,19 @@ export default class GameView extends engine.Container {
...
@@ -271,16 +274,19 @@ export default class GameView extends engine.Container {
for
(
let
i
=
0
;
i
<
len
;
i
++
){
for
(
let
i
=
0
;
i
<
len
;
i
++
){
let
plen
=
this
.
prizes
.
length
;
let
plen
=
this
.
prizes
.
length
;
if
(
direct
>
0
){
if
(
direct
>
0
){
this
.
itemInfo
[
"items"
+
j
][
i
].
source
=
this
.
prizes
[(
plen
-
1
)
-
(
i
%
plen
)].
icon
;
this
.
itemInfo
[
"items"
+
j
][
i
].
texture
=
engine
.
Texture
.
fromImage
(
this
.
prizes
[(
plen
-
1
)
-
(
i
%
plen
)].
icon
);
// this.itemInfo["items" + j][i].source = this.prizes[(plen - 1) - (i % plen)].icon;
}
else
{
}
else
{
this
.
itemInfo
[
"items"
+
j
][
i
].
source
=
this
.
prizes
[(
i
%
plen
)].
icon
;
this
.
itemInfo
[
"items"
+
j
][
i
].
texture
=
engine
.
Texture
.
fromImage
(
this
.
prizes
[(
i
%
plen
)].
icon
);
// this.itemInfo["items" + j][i].source = this.prizes[(i % plen)].icon;
}
}
}
}
}
}
for
(
let
i
=
0
;
i
<
3
;
i
++
){
for
(
let
i
=
0
;
i
<
3
;
i
++
){
// this.prizeId = "sss_3";
// this.prizeId = "sss_3";
this
.
itemInfo
[
"items"
+
i
][
1
].
source
=
this
.
getPrizeUrl
(
this
.
prizeId
);
this
.
itemInfo
[
"items"
+
i
][
1
].
texture
=
engine
.
Texture
.
fromImage
(
this
.
getPrizeUrl
(
this
.
prizeId
));
// this.itemInfo["items" + i][1].source = this.getPrizeUrl(this.prizeId);
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment