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
9ad2908b
Commit
9ad2908b
authored
May 22, 2020
by
zjz1994
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
食物关卡兼容
parent
96e59e0f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
20 deletions
+22
-20
MainScene.ts
egret/src/mainScene/MainScene.ts
+22
-20
No files found.
egret/src/mainScene/MainScene.ts
View file @
9ad2908b
...
...
@@ -1185,27 +1185,29 @@ export default class MainScene extends Scene {
//食物
initFoods
(){
var
foodsdata
=
this
.
chapterData
.
map
.
foodsdata
;
for
(
var
i
=
0
;
i
<
foodsdata
.
length
;
i
++
){
var
ifood
=
foodsdata
[
i
];
var
ifoodtype
=
ifood
.
type
;
var
ifoodidx
=
ifood
.
luidx
;
var
ifoodir
=
ifood
.
dir
;
var
ifood1
:
Food
=
Pool
.
takeOut
(
RecoverName
.
FOOD
);
if
(
!
ifood1
){
ifood1
=
new
Food
();
if
(
foodsdata
){
for
(
var
i
=
0
;
i
<
foodsdata
.
length
;
i
++
){
var
ifood
=
foodsdata
[
i
];
var
ifoodtype
=
ifood
.
type
;
var
ifoodidx
=
ifood
.
luidx
;
var
ifoodir
=
ifood
.
dir
;
var
ifood1
:
Food
=
Pool
.
takeOut
(
RecoverName
.
FOOD
);
if
(
!
ifood1
){
ifood1
=
new
Food
();
}
var
ipos
=
ifood1
.
resetFood
(
ifoodtype
,
ifoodir
,
ifoodidx
);
ifood1
.
x
=
ipos
[
0
];
ifood1
.
y
=
ipos
[
1
];
this
.
mapupfoodContainer
.
addChild
(
ifood1
);
var
ifoodname
=
'food_'
+
i
;
ifood1
.
name
=
ifoodname
;
this
.
icefoodArr
.
push
({
name
:
ifoodname
,
inidxs
:
JSON
.
parse
(
JSON
.
stringify
(
ifood1
.
lockidxs
))
});
// console.log("食物处理",ifoodtype);
}
var
ipos
=
ifood1
.
resetFood
(
ifoodtype
,
ifoodir
,
ifoodidx
);
ifood1
.
x
=
ipos
[
0
];
ifood1
.
y
=
ipos
[
1
];
this
.
mapupfoodContainer
.
addChild
(
ifood1
);
var
ifoodname
=
'food_'
+
i
;
ifood1
.
name
=
ifoodname
;
this
.
icefoodArr
.
push
({
name
:
ifoodname
,
inidxs
:
JSON
.
parse
(
JSON
.
stringify
(
ifood1
.
lockidxs
))
});
// console.log("食物处理",ifoodtype);
}
}
...
...
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