Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
ngt7_fish
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
ngt7_fish
Commits
b7a48342
Commit
b7a48342
authored
Nov 12, 2022
by
Tt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改完成
parent
3faa109b
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
604 additions
and
422 deletions
+604
-422
bgCloud.ts
assets/ngt7_fish/scene/game/bgCloud.ts
+67
-0
bgCloud.ts.meta
assets/ngt7_fish/scene/game/bgCloud.ts.meta
+9
-0
boatmove.ts
assets/ngt7_fish/scene/game/boatmove.ts
+9
-8
ngt7_fish.fire
assets/ngt7_fish/scene/ngt7_fish.fire
+462
-388
ngt7_fish.ts
assets/ngt7_fish/scene/ngt7_fish.ts
+53
-25
ngt7_layout_mouse.ts
assets/ngt7_fish/scene/small/ngt7_layout_mouse.ts
+4
-1
No files found.
assets/ngt7_fish/scene/game/bgCloud.ts
0 → 100644
View file @
b7a48342
const
{
ccclass
,
property
}
=
cc
.
_decorator
;
@
ccclass
export
default
class
Clund_06
extends
cc
.
Component
{
@
property
(
cc
.
Node
)
yun_1
:
cc
.
Node
=
null
;
@
property
(
cc
.
Node
)
yun_2
:
cc
.
Node
=
null
;
@
property
(
cc
.
Node
)
yun_3
:
cc
.
Node
=
null
;
@
property
(
cc
.
Node
)
yun_4
:
cc
.
Node
=
null
;
@
property
(
cc
.
Node
)
yun_5
:
cc
.
Node
=
null
;
@
property
(
cc
.
Node
)
yun_6
:
cc
.
Node
=
null
;
@
property
(
cc
.
Node
)
yun_7
:
cc
.
Node
=
null
;
private
speed
:
number
;
private
speed2
:
number
;
private
width
:
number
;
//背景图宽度
public
onEnable
()
{
}
protected
onDestroy
():
void
{
}
protected
onLoad
():
void
{
this
.
speed
=
0.5
;
this
.
speed2
=
0.8
;
let
size
=
cc
.
view
.
getCanvasSize
();
let
scale
=
(
size
.
width
/
size
.
height
)
/
(
1920
/
1080
);
if
(
scale
>
1
)
{
Math
.
floor
(
this
.
node
.
width
*=
scale
);
Math
.
floor
(
this
.
node
.
width
*=
scale
);
Math
.
floor
(
this
.
node
.
width
*=
scale
);
}
this
.
width
=
this
.
node
.
width
/
2
;
}
protected
update
(
dt
)
{
this
.
yun_1
.
x
+=
this
.
speed
;
this
.
yun_2
.
x
+=
this
.
speed2
;
this
.
yun_4
.
x
+=
this
.
speed2
;
this
.
yun_3
.
x
-=
this
.
speed
;
this
.
yun_5
.
x
-=
this
.
speed2
;
this
.
yun_6
.
x
-=
this
.
speed
;
this
.
yun_7
.
x
-=
this
.
speed
;
if
(
this
.
yun_1
.
x
>
this
.
width
+
200
)
this
.
yun_1
.
x
=
-
this
.
width
-
150
;
if
(
this
.
yun_2
.
x
>
this
.
width
+
200
)
this
.
yun_2
.
x
=
-
this
.
width
-
150
;
if
(
this
.
yun_4
.
x
>
this
.
width
+
200
)
this
.
yun_4
.
x
=
-
this
.
width
-
150
;
if
(
this
.
yun_3
.
x
<
-
this
.
width
-
200
)
this
.
yun_3
.
x
=
this
.
width
+
150
;
if
(
this
.
yun_5
.
x
<
-
this
.
width
-
200
)
this
.
yun_5
.
x
=
this
.
width
+
150
;
if
(
this
.
yun_6
.
x
<
-
this
.
width
-
200
)
this
.
yun_6
.
x
=
this
.
width
+
150
;
if
(
this
.
yun_7
.
x
<
-
this
.
width
-
200
)
this
.
yun_7
.
x
=
this
.
width
+
150
;
}
}
\ No newline at end of file
assets/ngt7_fish/scene/game/bgCloud.ts.meta
0 → 100644
View file @
b7a48342
{
"ver": "1.0.8",
"uuid": "2ea681a7-773b-4059-980f-f890bd1ea71e",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
assets/ngt7_fish/scene/game/boatmove.ts
View file @
b7a48342
...
@@ -15,21 +15,22 @@ export default class boatmove extends cc.Component {
...
@@ -15,21 +15,22 @@ export default class boatmove extends cc.Component {
// LIFE-CYCLE CALLBACKS:
// LIFE-CYCLE CALLBACKS:
onLoad
()
{
onLoad
()
{
let
mul
=
3
;
if
(
this
.
firstUp
)
{
if
(
this
.
firstUp
)
{
cc
.
tween
(
this
.
node
).
repeatForever
(
cc
.
tween
(
this
.
node
).
repeatForever
(
cc
.
tween
()
cc
.
tween
()
.
by
(
10
,
{
y
:
25
})
.
by
(
10
,
{
y
:
25
*
mul
})
.
by
(
10
,
{
y
:
-
25
})
.
by
(
10
,
{
y
:
-
25
*
mul
})
.
by
(
10
,
{
y
:
-
25
})
.
by
(
10
,
{
y
:
-
25
*
mul
})
.
by
(
10
,
{
y
:
25
})
.
by
(
10
,
{
y
:
25
*
mul
})
).
start
();
).
start
();
}
else
{
}
else
{
cc
.
tween
(
this
.
node
).
repeatForever
(
cc
.
tween
(
this
.
node
).
repeatForever
(
cc
.
tween
()
cc
.
tween
()
.
by
(
10
,
{
y
:
-
25
})
.
by
(
10
,
{
y
:
-
25
*
mul
})
.
by
(
10
,
{
y
:
25
})
.
by
(
10
,
{
y
:
25
*
mul
})
.
by
(
10
,
{
y
:
25
})
.
by
(
10
,
{
y
:
25
*
mul
})
.
by
(
10
,
{
y
:
-
25
})
.
by
(
10
,
{
y
:
-
25
*
mul
})
).
start
();
).
start
();
}
}
}
}
...
...
assets/ngt7_fish/scene/ngt7_fish.fire
View file @
b7a48342
This diff is collapsed.
Click to expand it.
assets/ngt7_fish/scene/ngt7_fish.ts
View file @
b7a48342
...
@@ -20,7 +20,14 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -20,7 +20,14 @@ export default class SceneComponent extends MyCocosSceneComponent {
addPreloadAudio
()
{
addPreloadAudio
()
{
// TODO 根据自己的配置预加载音频资源
// TODO 根据自己的配置预加载音频资源
this
.
_audioResList
.
push
({
url
:
this
.
data
.
audio_url
});
// this._audioResList.push({ url: this.data.audio_url });
let
arr
=
[];
this
.
data
.
questions
.
forEach
(
question
=>
{
question
.
options
.
forEach
(
op
=>
{
arr
.
push
({
url
:
op
.
audio
})
})
})
this
.
_audioResList
.
push
(...
arr
);
}
}
addPreloadAnima
()
{
addPreloadAnima
()
{
...
@@ -127,9 +134,9 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -127,9 +134,9 @@ export default class SceneComponent extends MyCocosSceneComponent {
let
db
=
start_ske
.
getComponent
(
dragonBones
.
ArmatureDisplay
);
let
db
=
start_ske
.
getComponent
(
dragonBones
.
ArmatureDisplay
);
let
anis
=
db
.
getAnimationNames
(
db
.
armatureName
);
let
anis
=
db
.
getAnimationNames
(
db
.
armatureName
);
db
.
playAnimation
(
anis
[
0
],
0
);
db
.
playAnimation
(
anis
[
0
],
0
);
cc
.
tween
(
start_ske
).
by
(
1
,
{
x
:
-
500
}).
call
(()
=>
{
cc
.
tween
(
start_ske
).
by
(
0.5
,
{
x
:
-
500
}).
call
(()
=>
{
pg
.
audio
.
playAudioByUrl
(
Game
.
getIns
().
startAudio
).
then
(()
=>
{
pg
.
audio
.
playAudioByUrl
(
Game
.
getIns
().
startAudio
).
then
(()
=>
{
cc
.
tween
(
start_ske
).
delay
(
1
).
by
(
1
,
{
x
:
500
}).
call
(()
=>
{
cc
.
tween
(
start_ske
).
delay
(
1
).
by
(
0.5
,
{
x
:
500
}).
call
(()
=>
{
this
.
layout_start
.
active
=
false
;
this
.
layout_start
.
active
=
false
;
resolve
(
''
);
resolve
(
''
);
}).
start
();
}).
start
();
...
@@ -173,14 +180,23 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -173,14 +180,23 @@ export default class SceneComponent extends MyCocosSceneComponent {
// 出现鱼
// 出现鱼
let
fishList
=
Game
.
getIns
().
getFishList
();
let
fishList
=
Game
.
getIns
().
getFishList
();
let
layout_fish
=
pg
.
view
.
find
(
this
,
'
layout_bottom/layout_fish
'
)
let
layout_fish
=
pg
.
view
.
find
(
this
,
'
layout_bottom/layout_fish
'
)
let
fishs_left
=
pg
.
view
.
find
(
this
,
'
layout_bottom/boat_left/fishs
'
)
let
fishs_right
=
pg
.
view
.
find
(
this
,
'
layout_bottom/boat_right/fishs
'
)
layout_fish
.
removeAllChildren
();
layout_fish
.
removeAllChildren
();
fishs_left
.
removeAllChildren
();
fishs_right
.
removeAllChildren
();
let
item
=
pg
.
view
.
find
(
this
,
'
layout_bottom/item
'
)
let
item
=
pg
.
view
.
find
(
this
,
'
layout_bottom/item
'
)
for
(
let
i
=
0
;
i
<
10
;
i
++
)
{
fishList
.
sort
((
A
,
B
)
=>
{
return
0.5
-
Math
.
random
();
})
}
fishList
.
forEach
((
fish
,
index
)
=>
{
fishList
.
forEach
((
fish
,
index
)
=>
{
let
node
=
cc
.
instantiate
(
item
);
let
node
=
cc
.
instantiate
(
item
);
layout_fish
.
addChild
(
node
);
layout_fish
.
addChild
(
node
);
this
.
scheduleOnce
(()
=>
{
this
.
scheduleOnce
(()
=>
{
this
.
updateItem
(
node
,
fish
);
this
.
updateItem
(
node
,
fish
);
},
index
*
Math
.
random
()
)
},
index
*
12
)
});
});
}
}
updateItem
(
item
,
data
:
Option
)
{
updateItem
(
item
,
data
:
Option
)
{
...
@@ -200,31 +216,27 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -200,31 +216,27 @@ export default class SceneComponent extends MyCocosSceneComponent {
item
.
y
=
-
315
-
Math
.
random
()
*
150
;
item
.
y
=
-
315
-
Math
.
random
()
*
150
;
item
.
scaleX
=
-
1
;
item
.
scaleX
=
-
1
;
text
.
scaleX
=
-
1
;
text
.
scaleX
=
-
1
;
this
.
scheduleOnce
(()
=>
{
item
.
active
=
true
;
item
.
active
=
true
;
cc
.
tween
(
item
).
repeatForever
(
cc
.
tween
().
by
(
21
*
3
,
{
x
:
1920
+
400
}).
call
(()
=>
{
cc
.
tween
(
item
).
repeatForever
(
cc
.
tween
().
by
(
21
+
(
data
.
id
%
10
),
{
x
:
1920
+
400
}).
call
(()
=>
{
item
.
scaleX
=
-
item
.
scaleX
;
item
.
scaleX
=
-
item
.
scaleX
;
text
.
scaleX
=
-
text
.
scaleX
;
text
.
scaleX
=
-
text
.
scaleX
;
}).
by
(
21
*
3
,
{
x
:
-
1920
-
400
}).
call
(()
=>
{
}).
by
(
7
+
Math
.
random
()
*
8
,
{
x
:
-
1920
-
400
}).
call
(()
=>
{
item
.
scaleX
=
-
item
.
scaleX
;
item
.
scaleX
=
-
item
.
scaleX
;
text
.
scaleX
=
-
text
.
scaleX
;
text
.
scaleX
=
-
text
.
scaleX
;
})).
start
();
})).
start
();
},
data
.
id
%
10
)
}
else
{
}
else
{
item
.
x
=
1920
/
2
+
Math
.
random
()
*
200
item
.
x
=
1920
/
2
+
Math
.
random
()
*
200
item
.
y
=
-
315
-
Math
.
random
()
*
150
;
item
.
y
=
-
315
-
Math
.
random
()
*
150
;
item
.
scaleX
=
1
;
item
.
scaleX
=
1
;
text
.
scaleX
=
1
;
text
.
scaleX
=
1
;
this
.
scheduleOnce
(()
=>
{
item
.
active
=
true
;
item
.
active
=
true
;
cc
.
tween
(
item
).
repeatForever
(
cc
.
tween
().
by
(
21
*
3
,
{
x
:
-
1920
-
400
}).
call
(()
=>
{
cc
.
tween
(
item
).
repeatForever
(
cc
.
tween
().
by
(
21
+
(
data
.
id
%
10
),
{
x
:
-
1920
-
400
}).
call
(()
=>
{
item
.
scaleX
=
-
item
.
scaleX
;
item
.
scaleX
=
-
item
.
scaleX
;
text
.
scaleX
=
-
text
.
scaleX
;
text
.
scaleX
=
-
text
.
scaleX
;
}).
by
(
21
*
3
,
{
x
:
1920
+
400
}).
call
(()
=>
{
}).
by
(
7
+
Math
.
random
()
*
8
,
{
x
:
1920
+
400
}).
call
(()
=>
{
item
.
scaleX
=
-
item
.
scaleX
;
item
.
scaleX
=
-
item
.
scaleX
;
text
.
scaleX
=
-
text
.
scaleX
;
text
.
scaleX
=
-
text
.
scaleX
;
})).
start
();
})).
start
();
},
data
.
id
%
10
)
}
}
item
.
on
(
cc
.
Node
.
EventType
.
TOUCH_START
,
this
.
onItemTouchStart
,
this
);
item
.
on
(
cc
.
Node
.
EventType
.
TOUCH_START
,
this
.
onItemTouchStart
,
this
);
item
.
on
(
cc
.
Node
.
EventType
.
TOUCH_MOVE
,
this
.
onItemTouchMove
,
this
);
item
.
on
(
cc
.
Node
.
EventType
.
TOUCH_MOVE
,
this
.
onItemTouchMove
,
this
);
...
@@ -270,11 +282,17 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -270,11 +282,17 @@ export default class SceneComponent extends MyCocosSceneComponent {
let
isRight
=
false
;
let
isRight
=
false
;
let
currentRect
=
null
;
let
currentRect
=
null
;
let
parent
=
null
;
let
netLeft
=
false
;
if
(
rect
.
intersects
(
leftRect
))
{
if
(
rect
.
intersects
(
leftRect
))
{
parent
=
boat_left
;
netLeft
=
true
;
isRight
=
!!
Game
.
getIns
().
boatLeft
.
isChild
(
data
);
isRight
=
!!
Game
.
getIns
().
boatLeft
.
isChild
(
data
);
isRight
&&
Game
.
getIns
().
boatLeft
.
setRight
(
data
);
isRight
&&
Game
.
getIns
().
boatLeft
.
setRight
(
data
);
currentRect
=
leftRect
;
currentRect
=
leftRect
;
}
else
if
(
rect
.
intersects
(
rightRect
))
{
}
else
if
(
rect
.
intersects
(
rightRect
))
{
parent
=
boat_right
;
netLeft
=
false
;
isRight
=
!!
Game
.
getIns
().
boatRight
.
isChild
(
data
);
isRight
=
!!
Game
.
getIns
().
boatRight
.
isChild
(
data
);
isRight
&&
Game
.
getIns
().
boatRight
.
setRight
(
data
);
isRight
&&
Game
.
getIns
().
boatRight
.
setRight
(
data
);
currentRect
=
rightRect
;
currentRect
=
rightRect
;
...
@@ -304,7 +322,17 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -304,7 +322,17 @@ export default class SceneComponent extends MyCocosSceneComponent {
this
.
touching
=
null
;
this
.
touching
=
null
;
}
}
})
})
let
fishs_left
=
pg
.
view
.
find
(
this
,
'
layout_bottom/boat_left/fishs
'
)
let
fishs_right
=
pg
.
view
.
find
(
this
,
'
layout_bottom/boat_right/fishs
'
)
if
(
netLeft
)
{
item
.
x
=
item
.
x
+
442
;
item
.
y
=
item
.
y
-
boat_left
.
y
;
item
.
parent
=
fishs_left
;
}
else
{
item
.
x
=
item
.
x
-
452
;
item
.
y
=
item
.
y
-
boat_right
.
y
;
item
.
parent
=
fishs_right
;
}
if
(
item
.
scaleX
==
-
1
)
{
if
(
item
.
scaleX
==
-
1
)
{
// 计算当前坐标距离最左侧的距离
// 计算当前坐标距离最左侧的距离
let
space
=
currentRect
.
width
-
((
rect
.
x
+
rect
.
width
)
-
currentRect
.
x
)
-
lastArea
/
5
;
let
space
=
currentRect
.
width
-
((
rect
.
x
+
rect
.
width
)
-
currentRect
.
x
)
-
lastArea
/
5
;
...
...
assets/ngt7_fish/scene/small/ngt7_layout_mouse.ts
View file @
b7a48342
...
@@ -58,8 +58,11 @@ export default class Ngt_star_7 extends cc.Component {
...
@@ -58,8 +58,11 @@ export default class Ngt_star_7 extends cc.Component {
this
.
bigStarArr
=
[];
this
.
bigStarArr
=
[];
let
size
=
cc
.
view
.
getCanvasSize
();
let
scale
=
(
1920
/
1080
)
/
(
size
.
width
/
size
.
height
);
let
baseX
=
this
.
position
.
x
;
let
baseX
=
this
.
position
.
x
;
let
baseY
=
this
.
position
.
y
;
let
baseY
=
this
.
position
.
y
*
scale
+
15
;
if
(
scale
<=
1
)
baseY
=
this
.
position
.
y
;
let
disW
=
80
;
// * this._mapScaleMin
let
disW
=
80
;
// * this._mapScaleMin
// let disH = 80 * this._mapScaleMin;
// let disH = 80 * this._mapScaleMin;
let
disScale
=
1
;
let
disScale
=
1
;
...
...
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