Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
test_jelly_match
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
test_jelly_match
Commits
11779dfa
Commit
11779dfa
authored
May 22, 2023
by
limingzhe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: debug
parent
c483cfac
Changes
6
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
343 additions
and
179 deletions
+343
-179
test_jelly_match.fire
assets/test_jelly_match/scene/test_jelly_match.fire
+238
-145
test_jelly_match.js
assets/test_jelly_match/scene/test_jelly_match.js
+63
-30
btn.png
assets/test_jelly_match/texture/btn.png
+0
-0
btn.png.meta
assets/test_jelly_match/texture/btn.png.meta
+36
-0
builder.json
settings/builder.json
+5
-3
project.json
settings/project.json
+1
-1
No files found.
assets/test_jelly_match/scene/test_jelly_match.fire
View file @
11779dfa
This diff is collapsed.
Click to expand it.
assets/test_jelly_match/scene/test_jelly_match.js
View file @
11779dfa
...
...
@@ -1152,22 +1152,25 @@ cc.Class({
this
.
scoreNum
=
0
;
const
scoreLabel
=
this
.
getRichText
(
"
Score:
"
+
this
.
scoreNum
,
100
,
"
#ffffff
"
,
6
,
"
#111111
"
,
true
);
this
.
canvas
.
addChild
(
scoreLabel
,
2
)
scoreLabel
.
x
=
this
.
canvas
.
width
/
2
-
150
*
this
.
_mapScaleMin
;
scoreLabel
.
y
=
this
.
canvas
.
height
/
2
-
50
*
this
.
_mapScaleMin
;
scoreLabel
.
scale
=
0.5
*
1
/
this
.
jellyLayer
.
scale
;
scoreLabel
.
x
=
this
.
canvas
.
width
/
2
-
270
*
scoreLabel
.
scale
;
scoreLabel
.
y
=
this
.
canvas
.
height
/
2
-
50
*
scoreLabel
.
scale
;
// scoreLabel.anchorX = 1;
// scoreLabel.anchorY = 1;
scoreLabel
.
scale
=
0.5
;
this
.
scoreLabel
=
scoreLabel
;
},
initStepLabel
()
{
this
.
stepNum
=
1
0
;
const
stepLabel
=
this
.
getRichText
(
"
Step:
"
+
this
.
stepNum
,
50
,
"
#ffffff
"
,
3
,
"
#111111
"
,
true
);
this
.
stepNum
=
2
0
;
const
stepLabel
=
this
.
getRichText
(
"
Step:
"
+
this
.
stepNum
,
100
,
"
#ffffff
"
,
6
,
"
#111111
"
,
true
);
this
.
canvas
.
addChild
(
stepLabel
,
2
)
stepLabel
.
x
=
this
.
scoreLabel
.
x
;
stepLabel
.
y
=
this
.
scoreLabel
.
y
-
2
0
*
this
.
_mapScaleMin
;
stepLabel
.
y
=
this
.
scoreLabel
.
y
-
2
5
*
this
.
scoreLabel
.
scale
;
// stepLabel.anchorX = 1;
stepLabel
.
anchorY
=
1
;
stepLabel
.
scale
=
this
.
scoreLabel
.
scale
;
this
.
stepLabel
=
stepLabel
;
},
...
...
@@ -1221,7 +1224,7 @@ cc.Class({
const
baseX
=
-
this
.
canvas
.
height
/
2
+
edge
+
dis
/
2
;
const
baseY
=
-
this
.
canvas
.
height
/
2
+
edge
+
dis
/
2
-
3
0
*
this
.
_mapScaleMin
;
const
baseY
=
-
this
.
canvas
.
height
/
2
+
edge
+
dis
/
2
-
2
0
*
this
.
_mapScaleMin
;
const
disX
=
dis
;
const
disY
=
dis
;
...
...
@@ -1229,6 +1232,9 @@ cc.Class({
this
.
baseX
=
baseX
;
this
.
baseY
=
baseY
;
for
(
let
i
=
0
;
i
<
col
;
i
++
)
{
const
logicX
=
i
.
toString
();
...
...
@@ -1248,17 +1254,17 @@ cc.Class({
node
.
x
=
baseX
+
disX
*
i
;
node
.
y
=
baseY
+
disY
*
j
;
node
.
scale
=
len
/
512
this
.
canvas
.
addChild
(
node
);
this
.
jellyLayer
.
addChild
(
node
);
node
.
addChild
(
jellyBg
);
const
jelly
=
this
.
getOneJelly
(
i
,
j
);
jelly
.
x
=
node
.
x
;
jelly
.
y
=
node
.
y
;
jelly
.
scale
=
512
*
0.8
*
node
.
scaleX
/
jelly
.
width
;
this
.
canvas
.
addChild
(
jelly
,
2
);
this
.
jellyLayer
.
addChild
(
jelly
,
2
);
console
.
log
(
'
jelly.width:
'
,
jelly
.
width
);
console
.
log
(
'
jellyBg.width:
'
,
jellyBg
.
width
);
//
console.log('jelly.width: ', jelly.width);
//
console.log('jellyBg.width: ', jellyBg.width);
this
.
itemBgObj
[
logicX
][
logicY
]
=
node
;
this
.
blockArray
[
i
][
j
]
=
jelly
;
...
...
@@ -1352,6 +1358,8 @@ cc.Class({
playAudio
(
this
.
finishClip
);
})
this
.
showRestart
();
},
refreshRichText
(
labelNode
,
text
)
{
...
...
@@ -1449,7 +1457,7 @@ cc.Class({
jelly
.
x
=
xPos
;
jelly
.
y
=
curY
;
jelly
.
scale
=
512
*
0.8
*
(
this
.
blockLen
/
512
)
/
jelly
.
width
;
this
.
canvas
.
addChild
(
jelly
,
2
);
this
.
jellyLayer
.
addChild
(
jelly
,
2
);
this
.
blockArray
[
col
][
this
.
gridSize
-
emptyBlocksCount
-
1
]
=
jelly
;
...
...
@@ -1477,10 +1485,10 @@ cc.Class({
const
blockScript
=
this
.
blockArray
[
col
][
row
];
if
(
!
blockScript
||
blockScript
.
colorId
!==
colorId
||
blockScript
.
isVisited
)
{
console
.
log
(
"
blockScript:
"
,
blockScript
);
console
.
log
(
"
blockScript colorId:
"
,
blockScript
.
colorId
);
console
.
log
(
"
blockScript isVisited:
"
,
blockScript
.
isVisited
);
console
.
log
(
"
return 2
"
);
//
console.log("blockScript: ", blockScript);
//
console.log("blockScript colorId: ", blockScript.colorId);
//
console.log("blockScript isVisited: ", blockScript.isVisited);
//
console.log("return 2");
return
;
}
...
...
@@ -1517,15 +1525,17 @@ cc.Class({
},
addScore
(
jelly
,
score
)
{
const
richText
=
this
.
getRichText
(
"
+
"
+
score
,
"
40
"
,
"
#ffffff
"
,
"
3
"
,
"
111111
"
);
const
richText
=
this
.
getRichText
(
"
+
"
+
score
,
"
60
"
,
"
#ffffff
"
,
"
5
"
,
"
111111
"
);
richText
.
x
=
jelly
.
x
;
richText
.
y
=
jelly
.
y
;
richText
.
parent
=
jelly
.
parent
;
richText
.
zIndex
=
5
;
richText
.
opacity
=
0
;
richText
.
scale
=
1
/
this
.
jellyLayer
.
scale
;
cc
.
tween
(
richText
)
.
to
(
1
,
{
opacity
:
255
},
{
easing
:
"
cubicOut
"
})
.
delay
(
0.5
)
.
to
(
0.1
,
{
opacity
:
0
},
{
easing
:
"
cubicOut
"
})
.
call
(()
=>
{
richText
.
destroy
();
...
...
@@ -8009,6 +8019,7 @@ cc.Class({
this
.
showResultLayer
();
this
.
endTesting
();
// this.showRestart();
// playAudioByUrl(this.data.finish_right_audio_url, () => {
// delayCall(0.5, () => {
...
...
@@ -8097,28 +8108,31 @@ cc.Class({
showRestart
()
{
const
btn
=
getSprNode
(
"
btn_restart
"
);
btn
.
scale
=
this
.
_mapScaleMin
;
btn
.
baseS
=
btn
.
scale
;
const
btn
=
getSprNode
(
"
btn
"
);
btn
.
scale
=
this
.
jellyLayer
.
scale
;
btn
.
baseS
=
btn
.
scale
*
0.5
;
btn
.
y
=
-
100
*
btn
.
scale
;
this
.
canvas
.
addChild
(
btn
,
21
);
const
rt
=
this
.
getRichText
(
"
Replay
"
,
70
,
"
#ffffff
"
,
5
,
"
#111111
"
,
true
);
rt
.
y
=
10
;
btn
.
addChild
(
rt
);
btn
.
on
(
cc
.
Node
.
EventType
.
TOUCH_START
,
()
=>
{
// btn.removeFromParent();
// this.initData();
// this.initStar();
// this.showChangeQuesAnim();
// playAudio(this.btnClip);
const
middleLayer
=
cc
.
find
(
'
middleLayer
'
);
if
(
middleLayer
)
{
middleLayer
.
getComponent
(
'
middleLayer
'
).
reloadBundle
();
}
cc
.
director
.
loadScene
(
cc
.
director
.
getScene
().
name
);
// const middleLayer = cc.find('middleLayer');
// if (middleLayer) {
// middleLayer.getComponent('middleLayer').reloadBundle();
// }
})
const
time
=
0.9
;
btn
.
scale
=
0
;
cc
.
tween
(
btn
)
.
delay
(
2.5
)
//
.delay(2.5)
.
to
(
time
,
{
scale
:
btn
.
baseS
},
{
easing
:
"
elasticOut
"
})
.
start
();
...
...
@@ -8279,6 +8293,25 @@ cc.Class({
const
sy
=
this
.
canvas
.
height
/
bg
.
height
;
bg
.
scale
=
Math
.
max
(
sx
,
sy
);
if
(
this
.
canvas
.
width
<
this
.
canvas
.
height
)
{
this
.
isVertical
=
true
;
}
console
.
log
(
"
this.canvas.width:
"
,
this
.
canvas
.
width
);
console
.
log
(
"
this.canvas.height:
"
,
this
.
canvas
.
height
);
this
.
jellyLayer
=
new
cc
.
Node
();
if
(
this
.
isVertical
)
{
this
.
jellyLayer
.
scale
=
1920
/
this
.
canvas
.
height
;
}
else
{
// this.jellyLayer.scale = this.canvas.height / 1080;
this
.
jellyLayer
.
scale
=
this
.
canvas
.
width
/
1920
;
}
this
.
canvas
.
addChild
(
this
.
jellyLayer
,
1
);
},
initVerticalBg
()
{
...
...
assets/test_jelly_match/texture/btn.png
0 → 100644
View file @
11779dfa
127 KB
assets/test_jelly_match/texture/btn.png.meta
0 → 100644
View file @
11779dfa
{
"ver": "2.3.5",
"uuid": "5c2fe851-1332-47d0-836f-2319c32b7a4b",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 661,
"height": 230,
"platformSettings": {},
"subMetas": {
"btn": {
"ver": "1.0.4",
"uuid": "7c9f1d61-512c-40af-8ba7-c5987e4f6bd8",
"rawTextureUuid": "5c2fe851-1332-47d0-836f-2319c32b7a4b",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 661,
"height": 230,
"rawWidth": 661,
"rawHeight": 230,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
settings/builder.json
View file @
11779dfa
{
"title"
:
"play"
,
"packageName"
:
"org.cocos2d.demo"
,
"startScene"
:
"
0737ce42-24f0-45c6-8e1a-8bdab4f74ba3
"
,
"startScene"
:
"
1545f2b8-c734-4b0a-9cdb-51218dc4602b
"
,
"excludeScenes"
:
[],
"includeSDKBox"
:
false
,
"orientation"
:
{
...
...
@@ -28,7 +28,8 @@
},
"ios"
:
{
"REMOTE_SERVER_ROOT"
:
""
,
"packageName"
:
"org.cocos2d.demo"
"packageName"
:
"org.cocos2d.demo"
,
"ios_enable_jit"
:
true
},
"mac"
:
{
"REMOTE_SERVER_ROOT"
:
""
,
...
...
@@ -50,5 +51,6 @@
"scheme"
:
"https"
,
"skipRecord"
:
false
},
"appBundle"
:
false
"appBundle"
:
false
,
"agreements"
:
{}
}
settings/project.json
View file @
11779dfa
{
"last-module-event-record-time"
:
16
00677246969
,
"last-module-event-record-time"
:
16
84763325695
,
"migrate-history"
:
[
"cloud-function"
]
...
...
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