Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
xiaoxiaole
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
wildfirecode13
xiaoxiaole
Commits
a69ebbe6
Commit
a69ebbe6
authored
Mar 27, 2020
by
zjz1994
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调整大炮资源
parent
eafaa47d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
9 deletions
+34
-9
MainScene.ts
egret/src/mainScene/MainScene.ts
+0
-2
Element.ts
egret/src/something/class/Element.ts
+34
-7
No files found.
egret/src/mainScene/MainScene.ts
View file @
a69ebbe6
...
@@ -1057,8 +1057,6 @@ export default class MainScene extends Scene {
...
@@ -1057,8 +1057,6 @@ export default class MainScene extends Scene {
this
.
soundBtn
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTap_soundBtnn
,
this
)
this
.
soundBtn
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTap_soundBtnn
,
this
)
this
.
musicBtn
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTap_musicBtn
,
this
)
this
.
musicBtn
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTap_musicBtn
,
this
)
this
.
quitBtn
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTap_quitBtn
,
this
)
this
.
quitBtn
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTap_quitBtn
,
this
)
}
}
removeEvents
()
{
removeEvents
()
{
...
...
egret/src/something/class/Element.ts
View file @
a69ebbe6
...
@@ -45,7 +45,8 @@ export class Element extends eui.Component {
...
@@ -45,7 +45,8 @@ export class Element extends eui.Component {
fishCanEliFlag
:
boolean
;
fishCanEliFlag
:
boolean
;
cannoMoveClip
:
any
;
cannoMoveClip
:
any
;
cannoStat
:
number
[]
=
[
1
,
121
,
181
,
241
,
361
];
//尝试设置碰撞状态,如果之前被特效集中,那么可以设置碰撞状态。碰撞状态之后可以准备消除。
//尝试设置碰撞状态,如果之前被特效集中,那么可以设置碰撞状态。碰撞状态之后可以准备消除。
setFishNebFlag
()
{
setFishNebFlag
()
{
if
(
this
.
_fishState
>
0
)
{
if
(
this
.
_fishState
>
0
)
{
...
@@ -200,10 +201,10 @@ export class Element extends eui.Component {
...
@@ -200,10 +201,10 @@ export class Element extends eui.Component {
this
.
_cannoDir
=
cannodir
;
this
.
_cannoDir
=
cannodir
;
this
.
resetCannoStat
();
this
.
resetCannoStat
();
this
.
showImage
.
x
=
0
;
//
this.showImage.x = 0;
this
.
showImage
.
y
=
0
;
//
this.showImage.y = 0;
this
.
showImage
.
anchorOffsetX
=
this
.
showImage
.
width
/
2
;
//
this.showImage.anchorOffsetX = this.showImage.width / 2;
this
.
showImage
.
anchorOffsetY
=
this
.
showImage
.
height
/
2
;
//
this.showImage.anchorOffsetY = this.showImage.height / 2;
var
roaidx
:
number
;
var
roaidx
:
number
;
if
(
cannodir
==
forwardDirection
.
left
){
if
(
cannodir
==
forwardDirection
.
left
){
roaidx
=
0
;
roaidx
=
0
;
...
@@ -214,7 +215,7 @@ export class Element extends eui.Component {
...
@@ -214,7 +215,7 @@ export class Element extends eui.Component {
}
else
if
(
cannodir
==
forwardDirection
.
down
){
}
else
if
(
cannodir
==
forwardDirection
.
down
){
roaidx
=
3
;
roaidx
=
3
;
}
}
this
.
showImage
.
rotation
=
[
-
90
,
0
,
90
,
180
][
roaidx
];
this
.
cannobox
.
rotation
=
[
-
90
,
0
,
90
,
180
][
roaidx
];
}
}
changeShowCannoStat
(){
changeShowCannoStat
(){
this
.
cannolab
.
text
=
this
.
_cannoStat
+
""
;
this
.
cannolab
.
text
=
this
.
_cannoStat
+
""
;
...
@@ -441,6 +442,7 @@ export class Element extends eui.Component {
...
@@ -441,6 +442,7 @@ export class Element extends eui.Component {
this
.
cannobox
.
visible
=
this
.
cannolab
.
visible
=
type
==
ElementType
.
CANNO
;
this
.
cannobox
.
visible
=
this
.
cannolab
.
visible
=
type
==
ElementType
.
CANNO
;
this
.
showImage
.
visible
=
type
!=
ElementType
.
CANNO
;
this
.
showImage
.
visible
=
type
!=
ElementType
.
CANNO
;
this
.
cannolab
.
visible
=
false
;
//鸡蛋
//鸡蛋
if
(
type
==
ElementType
.
CHICKEN_EGG
)
{
if
(
type
==
ElementType
.
CHICKEN_EGG
)
{
this
.
chickenEgg
=
Pool
.
takeOut
(
RecoverName
.
CHICKEN_EGG
)
this
.
chickenEgg
=
Pool
.
takeOut
(
RecoverName
.
CHICKEN_EGG
)
...
@@ -485,10 +487,35 @@ export class Element extends eui.Component {
...
@@ -485,10 +487,35 @@ export class Element extends eui.Component {
console
.
log
(
"paotai"
,
this
.
cannoMoveClip
);
console
.
log
(
"paotai"
,
this
.
cannoMoveClip
);
//1空,121,181,241,361
// this.cannoMoveClip.gotoAndStop(1);
// this.cannoMoveClip.gotoAndStop(120);
// this.cannoMoveClip.gotoAndStop(120);
// this.cannoMoveClip.gotoAndStop(180);
this
.
cannoMoveClip
.
addEventListener
(
egret
.
Event
.
ENTER_FRAME
,
this
.
listenCn
,
this
);
this
.
cannoMoveClip
.
addEventListener
(
egret
.
Event
.
COMPLETE
,
this
.
playComplete
,
this
);
});
});
}
}
}
}
// curframeidx:number = 1;
// testChangeMoveClip(num:number){
// this.curframeidx += num;
// this.cannoMoveClip.gotoAndStop(this.curframeidx);
// }
/**
* 炮台充能
* @param source
*/
listenCn
(){
console
.
log
(
"炮台充能"
,
this
.
cannoMoveClip
.
currentFrame
);
}
/**
* 炮台动画播放一次完毕
*/
playComplete
(){
this
.
cannoMoveClip
.
stop
();
}
/**
/**
* 替换资源时,同时修改
* 替换资源时,同时修改
...
...
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