Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
LWD_2
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
template admin
LWD_2
Commits
fb23390f
Commit
fb23390f
authored
Jun 16, 2021
by
Lwd
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
aaaa
parent
c4b74ecb
Changes
21
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
1377 additions
and
511 deletions
+1377
-511
Game.fire
play/assets/tmpGame/scene/Game.fire
+1215
-467
demo_03_fireworks_2.js
play/assets/tmpGame/script/game/demo_03_fireworks_2.js
+12
-1
game.js
play/assets/tmpGame/script/game/game.js
+17
-27
item.js
play/assets/tmpGame/script/game/item.js
+12
-3
Img_paper.png.meta
play/assets/tmpGame/textures/Img_paper.png.meta
+1
-1
bg_1.png.meta
play/assets/tmpGame/textures/bg_1.png.meta
+1
-1
bg_2.png.meta
play/assets/tmpGame/textures/bg_2.png.meta
+1
-1
bg_sahua.png
play/assets/tmpGame/textures/bg_sahua.png
+0
-0
bg_sahua.png.meta
play/assets/tmpGame/textures/bg_sahua.png.meta
+36
-0
connent_1.png.meta
play/assets/tmpGame/textures/connent_1.png.meta
+1
-1
connent_2.png.meta
play/assets/tmpGame/textures/connent_2.png.meta
+1
-1
connent_3.png.meta
play/assets/tmpGame/textures/connent_3.png.meta
+1
-1
connent_4.png.meta
play/assets/tmpGame/textures/connent_4.png.meta
+1
-1
item_bg.png.meta
play/assets/tmpGame/textures/item_bg.png.meta
+1
-1
item_bg2.png.meta
play/assets/tmpGame/textures/item_bg2.png.meta
+3
-3
item_bg3.png
play/assets/tmpGame/textures/item_bg3.png
+0
-0
item_bg3.png.meta
play/assets/tmpGame/textures/item_bg3.png.meta
+36
-0
prop_1.png.meta
play/assets/tmpGame/textures/prop_1.png.meta
+1
-1
reStart.png
play/assets/tmpGame/textures/reStart.png
+0
-0
reStart.png.meta
play/assets/tmpGame/textures/reStart.png.meta
+36
-0
top_frame.png.meta
play/assets/tmpGame/textures/top_frame.png.meta
+1
-1
No files found.
play/assets/tmpGame/scene/Game.fire
View file @
fb23390f
This diff is collapsed.
Click to expand it.
play/assets/tmpGame/script/game/demo_03_fireworks_2.js
View file @
fb23390f
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
// Learn life-cycle callbacks:
// Learn life-cycle callbacks:
// - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
// - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
import
{
asyncDelay
,
RandomInt
}
from
"
../common/utils
"
;
import
{
asyncDelay
,
RandomInt
,
showFireworks
}
from
"
../common/utils
"
;
var
effect
=
cc
.
Class
({
var
effect
=
cc
.
Class
({
extends
:
cc
.
Component
,
extends
:
cc
.
Component
,
...
@@ -25,6 +25,17 @@ var effect = cc.Class({
...
@@ -25,6 +25,17 @@ var effect = cc.Class({
g
.
speaker
.
inst
.
play_congratulation
();
g
.
speaker
.
inst
.
play_congratulation
();
},
},
showEffect2
:
function
()
{
const
bg
=
cc
.
find
(
'
Canvas/bg/connent
'
);
showFireworks
(
bg
,
cc
.
find
(
'
RibbonNodeBase
'
).
children
,
cc
.
v2
(
0
,
-
400
),
cc
.
v2
(
0
,
1000
),
200
,
200
);
showFireworks
(
bg
,
cc
.
find
(
'
RibbonNodeBase
'
).
children
,
cc
.
v2
(
-
600
,
-
400
),
cc
.
v2
(
200
,
1000
),
200
,
200
);
showFireworks
(
bg
,
cc
.
find
(
'
RibbonNodeBase
'
).
children
,
cc
.
v2
(
600
,
-
400
),
cc
.
v2
(
-
200
,
1000
),
200
,
200
);
},
async
showOneFirework
(
pos
,
parentNode
,
nodeList
)
{
async
showOneFirework
(
pos
,
parentNode
,
nodeList
)
{
for
(
let
i
=
0
;
i
<
3
;
i
++
)
{
for
(
let
i
=
0
;
i
<
3
;
i
++
)
{
this
.
showFirework
(
pos
,
parentNode
,
nodeList
,
200
,
200
,
15
);
this
.
showFirework
(
pos
,
parentNode
,
nodeList
,
200
,
200
,
15
);
...
...
play/assets/tmpGame/script/game/game.js
View file @
fb23390f
...
@@ -11,12 +11,6 @@ var game = cc.Class({
...
@@ -11,12 +11,6 @@ var game = cc.Class({
displayName
:
"
预制体
"
displayName
:
"
预制体
"
},
},
contentArr
:
{
default
:
null
,
type
:
cc
.
Node
,
displayName
:
"
底下内容
"
},
contentArr_2
:
{
contentArr_2
:
{
default
:
[],
default
:
[],
type
:
cc
.
Node
,
type
:
cc
.
Node
,
...
@@ -114,17 +108,17 @@ var game = cc.Class({
...
@@ -114,17 +108,17 @@ var game = cc.Class({
g
.
data_mgr
.
nowNum
=
itemArr
.
length
;
g
.
data_mgr
.
nowNum
=
itemArr
.
length
;
for
(
var
i
=
0
;
i
<
itemArr
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
itemArr
.
length
;
i
++
)
{
let
newItem_0
=
cc
.
instantiate
(
this
.
Item_0
[
this
.
idx
]);
let
newItem_0
=
cc
.
instantiate
(
this
.
Item_0
[
itemArr
.
length
>
14
?
0
:
1
]);
//let newItem_1 = cc.instantiate(this.Item_1);
//let newItem_1 = cc.instantiate(this.Item_1);
//更新子项
//更新子项
var
com
=
newItem_0
.
getChildByName
(
"
item
"
).
getComponent
(
"
item
"
);
var
com
=
newItem_0
.
getChildByName
(
"
item
"
).
getComponent
(
"
item
"
);
let
itemInfo
=
itemArr
[
i
>
3
?
1
:
i
];
let
itemInfo
=
itemArr
[
i
];
com
.
updateUI
(
itemInfo
);
com
.
updateUI
(
itemInfo
);
newItem_0
.
active
=
true
;
newItem_0
.
active
=
true
;
// newItem_1.active = true;
// newItem_1.active = true;
//设置类别
//设置类别
let
sheepInfo
=
g
.
data_mgr
.
getSheep
(
i
>
3
?
1
:
i
);
let
sheepInfo
=
g
.
data_mgr
.
getSheep
(
i
);
newItem_0
.
getChildByName
(
"
item
"
).
type
=
this
.
checkType
(
sheepInfo
.
sheepfoldId
);
newItem_0
.
getChildByName
(
"
item
"
).
type
=
this
.
checkType
(
sheepInfo
.
sheepfoldId
);
// newItem_1.parent = newItem_0;
// newItem_1.parent = newItem_0;
// newItem_0.parent = this.contentArr;
// newItem_0.parent = this.contentArr;
...
@@ -181,17 +175,22 @@ var game = cc.Class({
...
@@ -181,17 +175,22 @@ var game = cc.Class({
//重置UI界面
//重置UI界面
resetUI
:
function
()
{
resetUI
:
function
()
{
// //移除所有子节点
//移除所有子节点
// this.contentArr.removeAllChildren();
this
.
contentArr_2
[
0
].
removeAllChildren
();
// //移除所有子节点
this
.
contentArr_2
[
1
].
removeAllChildren
();
// this.contentArr_1[0].removeAllChildren();
this
.
contentArr_1
[
0
].
getChildByName
(
"
connent_3
"
).
getChildByName
(
"
Layout
"
).
removeAllChildren
();
// //移除所有子节点
this
.
contentArr_1
[
1
].
getChildByName
(
"
connent_3
"
).
getChildByName
(
"
Layout
"
).
removeAllChildren
();
// this.contentArr_1[1].removeAllChildren();
},
},
//重新开始
onBtnReStart
:
function
()
{
g
.
speaker
.
inst
.
play_btn
();
//移除所有计时器
this
.
unscheduleAllCallbacks
();
//初始化界面
this
.
UpdataUi
();
g
.
speaker
.
inst
.
play_restart
();
},
//游戏开始
//游戏开始
gameStart
:
function
()
{
gameStart
:
function
()
{
...
@@ -245,15 +244,6 @@ var game = cc.Class({
...
@@ -245,15 +244,6 @@ var game = cc.Class({
}
}
},
},
//重新开始
onBtnReStart
:
function
()
{
g
.
speaker
.
inst
.
play_btn
();
//移除所有计时器
this
.
unscheduleAllCallbacks
();
//初始化界面
this
.
UpdataUi
();
g
.
speaker
.
inst
.
play_restart
();
},
onBtnMask
:
function
()
{
onBtnMask
:
function
()
{
if
(
this
.
isLoadEnd
)
{
if
(
this
.
isLoadEnd
)
{
...
...
play/assets/tmpGame/script/game/item.js
View file @
fb23390f
...
@@ -21,6 +21,11 @@ cc.Class({
...
@@ -21,6 +21,11 @@ cc.Class({
type
:
cc
.
Node
,
type
:
cc
.
Node
,
displayName
:
"
图片
"
displayName
:
"
图片
"
},
},
Item_complete
:
{
default
:
null
,
type
:
cc
.
Node
,
displayName
:
"
完成显示
"
},
},
},
start
:
function
()
{
start
:
function
()
{
...
@@ -95,10 +100,11 @@ cc.Class({
...
@@ -95,10 +100,11 @@ cc.Class({
// console.log("坐标" + svLeftBottomPoint.x + "," + svLeftBottomPoint.y + "是否包含" + isIntersect_1);
// console.log("坐标" + svLeftBottomPoint.x + "," + svLeftBottomPoint.y + "是否包含" + isIntersect_1);
if
(
isIntersect_1
)
{
if
(
isIntersect_1
)
{
if
(
this
.
node
.
type
==
1
)
{
if
(
this
.
node
.
type
==
1
)
{
this
.
Item_complete
.
active
=
true
;
this
.
node
.
isComplent
=
true
;
this
.
node
.
isComplent
=
true
;
g
.
data_mgr
.
nowNum
-=
1
;
g
.
data_mgr
.
nowNum
-=
1
;
if
(
g
.
data_mgr
.
nowNum
==
0
)
{
if
(
g
.
data_mgr
.
nowNum
==
0
)
{
g
.
effect
.
inst
.
showEffect
();
g
.
effect
.
inst
.
showEffect
2
();
}
}
g
.
speaker
.
inst
.
play_good
();
g
.
speaker
.
inst
.
play_good
();
...
@@ -123,10 +129,11 @@ cc.Class({
...
@@ -123,10 +129,11 @@ cc.Class({
}
else
}
else
if
(
isIntersect_0
)
{
if
(
isIntersect_0
)
{
if
(
this
.
node
.
type
==
2
)
{
if
(
this
.
node
.
type
==
2
)
{
this
.
Item_complete
.
active
=
true
;
this
.
node
.
isComplent
=
true
;
this
.
node
.
isComplent
=
true
;
g
.
data_mgr
.
nowNum
-=
1
;
g
.
data_mgr
.
nowNum
-=
1
;
if
(
g
.
data_mgr
.
nowNum
==
0
)
{
if
(
g
.
data_mgr
.
nowNum
==
0
)
{
g
.
effect
.
inst
.
showEffect
();
g
.
effect
.
inst
.
showEffect
2
();
}
}
g
.
speaker
.
inst
.
play_good
();
g
.
speaker
.
inst
.
play_good
();
...
@@ -196,7 +203,7 @@ cc.Class({
...
@@ -196,7 +203,7 @@ cc.Class({
//点击翻面
//点击翻面
onBtnRotate
:
function
()
{
onBtnRotate
:
function
()
{
//翻面音效
//翻面音效
g
.
s
nd_mgr
.
playEffect
(
this
.
eff_btn
);
g
.
s
peaker
.
inst
.
play_btn
(
);
var
scaleX
=
this
.
node
.
scaleY
;
var
scaleX
=
this
.
node
.
scaleY
;
...
@@ -206,9 +213,11 @@ cc.Class({
...
@@ -206,9 +213,11 @@ cc.Class({
if
(
this
.
Item_name
.
node
.
active
)
{
if
(
this
.
Item_name
.
node
.
active
)
{
this
.
Item_name
.
node
.
active
=
false
;
this
.
Item_name
.
node
.
active
=
false
;
this
.
Item_photo
.
active
=
true
;
this
.
Item_photo
.
active
=
true
;
this
.
Item_redName
.
active
=
false
;
}
else
{
}
else
{
this
.
Item_name
.
node
.
active
=
true
;
this
.
Item_name
.
node
.
active
=
true
;
this
.
Item_photo
.
active
=
false
;
this
.
Item_photo
.
active
=
false
;
this
.
Item_redName
.
active
=
true
;
}
}
})
})
.
to
(
0.3
,
{
scaleX
:
scaleX
})
.
to
(
0.3
,
{
scaleX
:
scaleX
})
...
...
play/assets/tmpGame/textures/Img_paper.png.meta
View file @
fb23390f
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
"type": "sprite",
"type": "sprite",
"wrapMode": "clamp",
"wrapMode": "clamp",
"filterMode": "bilinear",
"filterMode": "bilinear",
"premultiplyAlpha":
fals
e,
"premultiplyAlpha":
tru
e,
"genMipmaps": false,
"genMipmaps": false,
"packable": true,
"packable": true,
"width": 29,
"width": 29,
...
...
play/assets/tmpGame/textures/bg_1.png.meta
View file @
fb23390f
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
"type": "sprite",
"type": "sprite",
"wrapMode": "clamp",
"wrapMode": "clamp",
"filterMode": "bilinear",
"filterMode": "bilinear",
"premultiplyAlpha":
fals
e,
"premultiplyAlpha":
tru
e,
"genMipmaps": false,
"genMipmaps": false,
"packable": true,
"packable": true,
"width": 1280,
"width": 1280,
...
...
play/assets/tmpGame/textures/bg_2.png.meta
View file @
fb23390f
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
"type": "sprite",
"type": "sprite",
"wrapMode": "clamp",
"wrapMode": "clamp",
"filterMode": "bilinear",
"filterMode": "bilinear",
"premultiplyAlpha":
fals
e,
"premultiplyAlpha":
tru
e,
"genMipmaps": false,
"genMipmaps": false,
"packable": true,
"packable": true,
"width": 1280,
"width": 1280,
...
...
play/assets/tmpGame/textures/bg_sahua.png
0 → 100644
View file @
fb23390f
1.27 KB
play/assets/tmpGame/textures/bg_sahua.png.meta
0 → 100644
View file @
fb23390f
{
"ver": "2.3.5",
"uuid": "f59901e3-76d1-45da-b36f-d3f0a7c6cef3",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": true,
"genMipmaps": false,
"packable": true,
"width": 36,
"height": 24,
"platformSettings": {},
"subMetas": {
"bg_sahua": {
"ver": "1.0.4",
"uuid": "130348e9-f1a0-4858-8d2a-dfd298bc57f1",
"rawTextureUuid": "f59901e3-76d1-45da-b36f-d3f0a7c6cef3",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 36,
"height": 24,
"rawWidth": 36,
"rawHeight": 24,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
play/assets/tmpGame/textures/connent_1.png.meta
View file @
fb23390f
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
"type": "sprite",
"type": "sprite",
"wrapMode": "clamp",
"wrapMode": "clamp",
"filterMode": "bilinear",
"filterMode": "bilinear",
"premultiplyAlpha":
fals
e,
"premultiplyAlpha":
tru
e,
"genMipmaps": false,
"genMipmaps": false,
"packable": true,
"packable": true,
"width": 548,
"width": 548,
...
...
play/assets/tmpGame/textures/connent_2.png.meta
View file @
fb23390f
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
"type": "sprite",
"type": "sprite",
"wrapMode": "clamp",
"wrapMode": "clamp",
"filterMode": "bilinear",
"filterMode": "bilinear",
"premultiplyAlpha":
fals
e,
"premultiplyAlpha":
tru
e,
"genMipmaps": false,
"genMipmaps": false,
"packable": true,
"packable": true,
"width": 520,
"width": 520,
...
...
play/assets/tmpGame/textures/connent_3.png.meta
View file @
fb23390f
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
"type": "sprite",
"type": "sprite",
"wrapMode": "clamp",
"wrapMode": "clamp",
"filterMode": "bilinear",
"filterMode": "bilinear",
"premultiplyAlpha":
fals
e,
"premultiplyAlpha":
tru
e,
"genMipmaps": false,
"genMipmaps": false,
"packable": true,
"packable": true,
"width": 488,
"width": 488,
...
...
play/assets/tmpGame/textures/connent_4.png.meta
View file @
fb23390f
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
"type": "sprite",
"type": "sprite",
"wrapMode": "clamp",
"wrapMode": "clamp",
"filterMode": "bilinear",
"filterMode": "bilinear",
"premultiplyAlpha":
fals
e,
"premultiplyAlpha":
tru
e,
"genMipmaps": false,
"genMipmaps": false,
"packable": true,
"packable": true,
"width": 520,
"width": 520,
...
...
play/assets/tmpGame/textures/item_bg.png.meta
View file @
fb23390f
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
"type": "sprite",
"type": "sprite",
"wrapMode": "clamp",
"wrapMode": "clamp",
"filterMode": "bilinear",
"filterMode": "bilinear",
"premultiplyAlpha":
fals
e,
"premultiplyAlpha":
tru
e,
"genMipmaps": false,
"genMipmaps": false,
"packable": true,
"packable": true,
"width": 110,
"width": 110,
...
...
play/assets/tmpGame/textures/item_bg2.png.meta
View file @
fb23390f
...
@@ -4,11 +4,11 @@
...
@@ -4,11 +4,11 @@
"type": "sprite",
"type": "sprite",
"wrapMode": "clamp",
"wrapMode": "clamp",
"filterMode": "bilinear",
"filterMode": "bilinear",
"premultiplyAlpha":
fals
e,
"premultiplyAlpha":
tru
e,
"genMipmaps": false,
"genMipmaps": false,
"packable": true,
"packable": true,
"width":
308
,
"width":
154
,
"height":
172
,
"height":
86
,
"platformSettings": {},
"platformSettings": {},
"subMetas": {
"subMetas": {
"item_bg2": {
"item_bg2": {
...
...
play/assets/tmpGame/textures/item_bg3.png
0 → 100644
View file @
fb23390f
2.21 KB
play/assets/tmpGame/textures/item_bg3.png.meta
0 → 100644
View file @
fb23390f
{
"ver": "2.3.5",
"uuid": "6ba3f108-a477-4fb0-85eb-3483d09cfb16",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": true,
"genMipmaps": false,
"packable": true,
"width": 104,
"height": 59,
"platformSettings": {},
"subMetas": {
"item_bg3": {
"ver": "1.0.4",
"uuid": "7cc1176f-4e77-4587-bad7-3ef22aacbb7e",
"rawTextureUuid": "6ba3f108-a477-4fb0-85eb-3483d09cfb16",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 104,
"height": 59,
"rawWidth": 104,
"rawHeight": 59,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
play/assets/tmpGame/textures/prop_1.png.meta
View file @
fb23390f
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
"type": "sprite",
"type": "sprite",
"wrapMode": "clamp",
"wrapMode": "clamp",
"filterMode": "bilinear",
"filterMode": "bilinear",
"premultiplyAlpha":
fals
e,
"premultiplyAlpha":
tru
e,
"genMipmaps": false,
"genMipmaps": false,
"packable": true,
"packable": true,
"width": 72,
"width": 72,
...
...
play/assets/tmpGame/textures/reStart.png
0 → 100644
View file @
fb23390f
2.29 KB
play/assets/tmpGame/textures/reStart.png.meta
0 → 100644
View file @
fb23390f
{
"ver": "2.3.5",
"uuid": "342b35ae-d6d0-4221-a4e1-098813b75f13",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": true,
"genMipmaps": false,
"packable": true,
"width": 36,
"height": 42,
"platformSettings": {},
"subMetas": {
"reStart": {
"ver": "1.0.4",
"uuid": "e0f45385-06ab-42bb-9f92-c2088daa3615",
"rawTextureUuid": "342b35ae-d6d0-4221-a4e1-098813b75f13",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 36,
"height": 42,
"rawWidth": 36,
"rawHeight": 42,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
play/assets/tmpGame/textures/top_frame.png.meta
View file @
fb23390f
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
"type": "sprite",
"type": "sprite",
"wrapMode": "clamp",
"wrapMode": "clamp",
"filterMode": "bilinear",
"filterMode": "bilinear",
"premultiplyAlpha":
fals
e,
"premultiplyAlpha":
tru
e,
"genMipmaps": false,
"genMipmaps": false,
"packable": true,
"packable": true,
"width": 535,
"width": 535,
...
...
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