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
Expand all
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) {
//engine.registerCustomCodeModule(customModule);
engine
.
registerCustomModule
(
customId
,
window
[
customId
]);
const
{
props
:
propsOption
,
assets
}
=
customModule
;
const
{
props
:
propsOption
,
assets
}
=
customModule
;
let
props
=
engine
.
computeProps
(
customModuleProps
,
propsOption
);
const
customModuleIns
=
{
id
:
customId
,
...
...
@@ -45,43 +45,74 @@ function launchWithCustomModule(customModule) {
engine
.
addCustomModule
(
customId
,
engine
.
gameStage
.
sceneContainer
.
getChildAt
(
0
));
engine
.
globalEvent
.
dispatchEvent
(
'rock-info'
,
{
prizes
:[
{
"icon"
:
"//yun.duiba.com.cn/aurora/assets/88d89ba9c3ddac732f2e017023a216be915655e4.png"
,
"id"
:
"o58df634f"
,
"index"
:
1
,
"name"
:
"一等奖"
,
"prizeId"
:
"sss_3"
,
"prizeType"
:
2
,
"refId"
:
"49781"
,
"refType"
:
"virtual"
},
{
"icon"
:
"//yun.duiba.com.cn/aurora/assets/1c0e0fcb192b2e0772bd555c3aae1c86621ccb09.png"
,
"id"
:
"o4a578392"
,
"index"
:
2
,
"name"
:
"二等奖"
,
"prizeId"
:
"sss_2"
,
"prizeType"
:
2
,
"refId"
:
"49780"
,
"refType"
:
"virtual"
},
{
"icon"
:
"//yun.duiba.com.cn/aurora/assets/bc23cd948cdd20467af9abc1f65e08e4f1e9bf30.png"
,
"id"
:
"o26efbbeb"
,
"index"
:
3
,
"name"
:
"三等奖"
,
"prizeId"
:
"sss_1"
,
"prizeType"
:
2
,
"refId"
:
"49779"
,
"refType"
:
"virtual"
}]
engine
.
globalEvent
.
dispatchEvent
(
'rock-info'
,
{
prizes
:
[
{
"icon"
:
"//yun.duiba.com.cn/polaris/odzr8wuh7y.3417f09f476bd948682b54ec13018796a63aa15f.jpeg"
,
"id"
:
"o58df634f"
,
"index"
:
1
,
"name"
:
"一等奖"
,
"prizeId"
:
"sss_3"
,
"prizeType"
:
2
,
"refId"
:
"49781"
,
"refType"
:
"virtual"
},
{
"icon"
:
"//yun.duiba.com.cn/polaris/o0shhpxtoy.22951ab8ac8975c1c08ba7933caa21fe2d629806.jpg"
,
"id"
:
"o4a578392"
,
"index"
:
2
,
"name"
:
"二等奖"
,
"prizeId"
:
"sss_2"
,
"prizeType"
:
2
,
"refId"
:
"49780"
,
"refType"
:
"virtual"
},
{
"icon"
:
"//yun.duiba.com.cn/polaris/xnjwcjf5ip.b7e68855228ddc5ef86bed1fefe63e7b1a65ebdf.jpeg"
,
"id"
:
"o26efbbeb"
,
"index"
:
3
,
"name"
:
"三等奖"
,
"prizeId"
:
"sss_1"
,
"prizeType"
:
2
,
"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
);
setTimeout
(()
=>
{
engine
.
globalEvent
.
dispatchEvent
(
'rock-start'
,{
prizeId
:
"sss_3
"
engine
.
globalEvent
.
dispatchEvent
(
'rock-start'
,
{
prizeId
:
"sss_2
"
});
},
5000
);
});
...
...
src/custom/rockji/debug/main.js
View file @
55cac8e5
...
...
@@ -23,6 +23,7 @@
_this
.
prizes
=
props
.
prizes
;
_this
.
countdown
=
150
;
_this
.
timeSpace
=
500
;
console
.
log
(
"props.prizes="
,
props
.
prizes
);
return
_this
;
}
GameView
.
prototype
.
setup
=
function
()
{
...
...
@@ -37,7 +38,7 @@
this
.
viewContainer
.
width
=
props
.
viewWidth
;
this
.
viewContainer
.
height
=
props
.
viewHeight
;
this
.
bgImg
=
new
engine
.
Image
();
this
.
bgImg
.
source
=
getAssetByName
(
"rock-背景"
).
url
;
this
.
bgImg
.
source
=
engine
.
getAssetByName
(
"rock-背景"
).
url
;
this
.
viewContainer
.
addChild
(
this
.
bgImg
);
this
.
container0
=
new
engine
.
Container
();
this
.
container1
=
new
engine
.
Container
();
...
...
@@ -82,15 +83,14 @@
this
.
itemInfo
[
"items"
+
j
]
=
[];
for
(
var
i
=
0
;
i
<
len
;
i
++
)
{
var
url
=
this
.
prizes
[
i
%
this
.
prizes
.
length
].
icon
;
var
item
=
new
engine
.
Imag
e
();
item
.
source
=
url
;
var
item
=
new
engine
.
Sprit
e
();
item
.
texture
=
engine
.
Texture
.
fromImage
(
url
)
;
this
.
itemInfo
[
"items"
+
j
][
i
]
=
item
;
this
[
"container"
+
j
].
addChild
(
item
);
item
.
width
=
props
.
imgSizeW
;
item
.
height
=
props
.
imgSizeH
;
item
.
x
=
props
.
spaceSizeX
;
item
.
y
=
props
.
spaceSizeY
+
i
*
(
props
.
imgSizeH
+
props
.
spaceSizeY
);
console
.
log
(
'i='
,
i
);
}
}
};
...
...
@@ -102,6 +102,7 @@
GameView
.
prototype
.
start
=
function
()
{
var
_this
=
this
;
this
.
prizeId
=
props
.
prizeId
;
console
.
log
(
"this.prizeId="
,
this
.
prizeId
);
var
_loop_1
=
function
(
i
)
{
engine
.
Tween
.
removeTweens
(
this_1
[
"container"
+
i
]);
setTimeout
(
function
()
{
...
...
@@ -139,15 +140,15 @@
for
(
var
i
=
0
;
i
<
len
;
i
++
)
{
var
plen
=
this
.
prizes
.
length
;
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
{
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
++
)
{
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
)
{
...
...
@@ -170,7 +171,6 @@
};
return
GameView
;
}(
engine
.
Container
));
//# sourceMappingURL=GameView.js.map
var
GameWrapper
=
(
function
(
_super
)
{
tslib
.
__extends
(
GameWrapper
,
_super
);
...
...
src/custom/rockji/debug/main.js.map
View file @
55cac8e5
This diff is collapsed.
Click to expand it.
src/custom/rockji/src/game/GameView.ts
View file @
55cac8e5
...
...
@@ -108,6 +108,8 @@ export default class GameView extends engine.Container {
this
.
prizes
=
props
.
prizes
;
this
.
countdown
=
150
;
this
.
timeSpace
=
500
;
console
.
log
(
"props.prizes="
,
props
.
prizes
);
}
private
waterSvga
...
...
@@ -136,7 +138,7 @@ export default class GameView extends engine.Container {
// this.bgImg = new engine.Sprite(getTextureByName('rock-背景'));
this
.
bgImg
=
new
engine
.
Image
();
this
.
bgImg
.
source
=
getAssetByName
(
"rock-背景"
).
url
;
this
.
bgImg
.
source
=
engine
.
getAssetByName
(
"rock-背景"
).
url
;
this
.
viewContainer
.
addChild
(
this
.
bgImg
);
this
.
container0
=
new
engine
.
Container
();
...
...
@@ -205,8 +207,8 @@ export default class GameView extends engine.Container {
this
.
itemInfo
[
"items"
+
j
]
=
[];
for
(
let
i
=
0
;
i
<
len
;
i
++
){
let
url
=
this
.
prizes
[
i
%
this
.
prizes
.
length
].
icon
;
let
item
=
new
engine
.
Imag
e
();
item
.
source
=
url
;
let
item
=
new
engine
.
Sprit
e
();
item
.
texture
=
engine
.
Texture
.
fromImage
(
url
)
;
this
.
itemInfo
[
"items"
+
j
][
i
]
=
item
;
this
[
"container"
+
j
].
addChild
(
item
);
...
...
@@ -215,7 +217,7 @@ export default class GameView extends engine.Container {
item
.
x
=
props
.
spaceSizeX
;
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 {
*/
start
()
{
this
.
prizeId
=
props
.
prizeId
;
console
.
log
(
"this.prizeId="
,
this
.
prizeId
);
for
(
let
i
=
0
;
i
<
3
;
i
++
){
engine
.
Tween
.
removeTweens
(
this
[
"container"
+
i
]);
setTimeout
(()
=>
{
...
...
@@ -271,16 +274,19 @@ export default class GameView extends engine.Container {
for
(
let
i
=
0
;
i
<
len
;
i
++
){
let
plen
=
this
.
prizes
.
length
;
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
{
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
++
){
// 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