Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
interactiveGames_Level
Project
Project
Details
Activity
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
xuxing@jiuaoedu.com
interactiveGames_Level
Commits
ed99c6cc
Commit
ed99c6cc
authored
Feb 10, 2022
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
算式接龙好了
parent
85a40717
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
6 deletions
+24
-6
FormulaSolitaire_1.scene
...dle/games/formulaSolitaire/scene/FormulaSolitaire_1.scene
+0
-0
FormulaSolitaireCtr.ts
...ndle/games/formulaSolitaire/script/FormulaSolitaireCtr.ts
+24
-6
No files found.
assets/sceneBundle/games/formulaSolitaire/scene/FormulaSolitaire_1.scene
View file @
ed99c6cc
This diff is collapsed.
Click to expand it.
assets/sceneBundle/games/formulaSolitaire/script/FormulaSolitaireCtr.ts
View file @
ed99c6cc
...
...
@@ -9,6 +9,7 @@ import { viewMgr, VIEW_INDEX } from '../../../../startFolder/script/common/ViewM
import
{
BeginCountdownView
}
from
'../../commonView/script/BeginCountdownView'
;
import
{
ChallengeSuccView
}
from
'../../commonView/script/ChallengeSuccView'
;
import
{
GameDescView
}
from
'../../commonView/script/GameDescView'
;
import
{
SwitchOkView
}
from
'../../commonView/script/SwitchOkView'
;
import
{
FormulaSolitaireCfg
,
FS_LV_1
,
FS_LV_2
}
from
'./FormulaSolitaireCfg'
;
import
{
FormulaSolitaireItem
,
FS_ITEM_STATE
}
from
'./FormulaSolitaireItem'
;
const
{
ccclass
,
property
}
=
_decorator
;
...
...
@@ -259,10 +260,15 @@ export class FormulaSolitaireCtr extends Component {
gameEnd
(
isWin
:
boolean
)
{
this
.
gameState
=
GAME_STATE
.
END
;
if
(
isWin
)
{
viewMgr
.
openView
(
VIEW_DEF
.
ChallengeSuccView
,
(
node
)
=>
{
AudioMgr
.
playEffect
(
succMus
);
node
?.
getComponent
(
ChallengeSuccView
)?.
init
();
},
VIEW_INDEX
.
TOP
);
AudioMgr
.
playEffect
(
succMus
);
viewMgr
.
openView
(
VIEW_DEF
.
SwitchOkView
,
(
node
)
=>
{
node
.
getComponent
(
SwitchOkView
)
!
.
endCb
=
()
=>
{
viewMgr
.
openView
(
VIEW_DEF
.
ChallengeSuccView
,
(
node
)
=>
{
node
?.
getComponent
(
ChallengeSuccView
)?.
init
();
},
VIEW_INDEX
.
TOP
);
};
node
.
getComponent
(
SwitchOkView
)?.
init
(
1.5
);
});
}
else
{
viewMgr
.
openView
(
VIEW_DEF
.
ChallengeFailView
,
(
node
)
=>
{
...
...
@@ -272,7 +278,7 @@ export class FormulaSolitaireCtr extends Component {
}
checkWin
()
{
if
(
this
.
allLinePointArr
.
length
<
this
.
levelData
.
resultCount
)
return
false
;
//
if (this.allLinePointArr.length < this.levelData.resultCount) return false;
let
retArr
:
number
[][]
=
[];
for
(
let
i
=
0
;
i
<
this
.
allLinePointArr
.
length
;
++
i
)
{
let
numAtrArr
:
string
[]
=
[];
...
...
@@ -289,6 +295,7 @@ export class FormulaSolitaireCtr extends Component {
}
console
.
log
(
`所有结果`
);
console
.
log
(
retArr
);
this
.
resultLab
.
string
=
`算式结果:`
+
this
.
levelData
.
result
+
"
\
n"
+
`剩余算式:`
+
(
this
.
levelData
.
resultCount
-
count
);
if
(
count
>=
this
.
levelData
.
resultCount
)
return
true
;
return
false
;
}
...
...
@@ -329,6 +336,17 @@ export class FormulaSolitaireCtr extends Component {
return
null
;
}
onResetBtnClick
(){
for
(
let
i
=
0
;
i
<
this
.
allLinePointArr
.
length
;
++
i
)
{
let
line
=
this
.
allLinePointArr
[
i
];
for
(
let
j
=
0
;
j
<
line
.
length
;
++
j
)
{
line
[
j
].
target
.
getComponent
(
FormulaSolitaireItem
)?.
setItemState
(
FS_ITEM_STATE
.
CENTER
);
line
[
j
].
target
.
getComponent
(
FormulaSolitaireItem
)?.
setColor
(
Color
.
fromHEX
(
new
Color
(),
this
.
orgColor
));
}
}
this
.
allLinePointArr
=
[];
}
gameStart
()
{
this
.
gameState
=
GAME_STATE
.
READY
;
this
.
countdownLab
.
string
=
Utils
.
formatTime
(
Math
.
floor
(
this
.
totalTime
*
1000
));
...
...
@@ -336,7 +354,7 @@ export class FormulaSolitaireCtr extends Component {
this
.
curLinePointArr
=
[];
this
.
allLinePointArr
=
[];
this
.
loadLevelData
();
this
.
resultLab
.
string
=
`
正确答案:`
+
this
.
levelData
.
resul
t
;
this
.
resultLab
.
string
=
`
算式结果:`
+
this
.
levelData
.
result
+
"
\
n"
+
`剩余算式:`
+
this
.
levelData
.
resultCoun
t
;
this
.
creAllItem
();
this
.
setBgSprSize
();
viewMgr
.
openView
(
VIEW_DEF
.
BeginCountdownView
,
(
node
)
=>
{
...
...
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