Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
sl
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
任建锋
sl
Commits
bb68010b
Commit
bb68010b
authored
Jul 19, 2018
by
任建锋
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
s
parent
d3dcdb90
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
134 additions
and
3 deletions
+134
-3
SlGameSceneModule_20180719185638.ts
.history/src/module/game/SlGameSceneModule_20180719185638.ts
+131
-0
SlGameSceneModule.js
dist/module/game/SlGameSceneModule.js
+1
-1
SlGameSceneModule.js.map
dist/module/game/SlGameSceneModule.js.map
+1
-1
SlGameSceneModule.ts
src/module/game/SlGameSceneModule.ts
+1
-1
No files found.
.history/src/module/game/SlGameSceneModule_20180719185638.ts
0 → 100644
View file @
bb68010b
import
{
YtModule
}
from
"duiba-yt"
;
import
{
YtSceneManager
}
from
"duiba-yt"
;
import
{
YtModuleManager
}
from
"duiba-yt"
;
import
{
YtModuleName
}
from
"duiba-yt"
;
import
{
YtLang
}
from
"duiba-yt"
;
import
{
SlModuleName
}
from
"../../enum/SlModuleName"
;
import
{
GamePlayModel
}
from
"duiba-tw"
;
export
class
SlGameSceneModule
extends
YtModule
{
/**
* 是否校验积分
*/
protected
checkScore
:
boolean
;
/**
* 数据
*/
protected
model
:
GamePlayModel
;
protected
initModel
():
void
{
this
.
model
=
new
GamePlayModel
();
}
/**
* 扩展数据
* */
protected
other
:
any
;
protected
score
=
0
;
//销毁
public
dispose
(){
var
j
;
for
(
j
in
this
.
display
){
console
.
log
(
this
.
display
[
j
])
if
(
this
.
display
[
j
]){
this
.
display
[
j
].
dispose
()
}
}
}
public
show
(){
YtSceneManager
.
ins
.
change
(
this
.
display
);
this
.
resetGame
()
}
protected
resetGame
(){
this
.
model
.
update
();
}
protected
gameOver
():
void
{
this
.
removeEvent
();
//将最高纪录缓存
this
.
enableMouseEvt
(
false
);
this
.
removeEvent
();
this
.
model
.
cacheMaxScore
(
this
.
score
);
this
.
model
.
submit
(
this
.
submit_result
.
bind
(
this
),
this
.
score
);
}
/**
* 更新游戏积分
* @param type 1 增加, 2 简少, 3重置
* @param score 分值
*/
protected
updateScore
(
type
:
number
,
score
:
number
):
void
{
if
(
type
==
1
)
{
this
.
score
+=
score
;
}
else
if
(
type
==
2
)
{
this
.
score
-=
score
;
this
.
score
=
Math
.
max
(
0
,
this
.
score
);
}
else
{
this
.
score
=
score
;
}
this
.
datapash
();
}
/**
* 阶段性提交
*/
protected
datapash
():
void
{
if
(
this
.
model
.
checkDatapash
(
this
.
score
))
{
this
.
model
.
datapash
();
}
}
protected
submit_result
():
void
{
let
moduleName
:
string
;
if
(
this
.
model
.
gameIsWinning
)
{
moduleName
=
SlModuleName
.
GAME_WIN_PANEL
;
}
else
{
moduleName
=
SlModuleName
.
GAME_LOSE_PANEL
;
}
YtModuleManager
.
ins
.
openModule
(
moduleName
);
this
.
enableMouseEvt
(
true
);
}
/**
* 导入外部网格
* @param importMeshes 网格资源列表
* @param onSuccess 成功回调
*/
protected
ImportMeshes
(
importMeshes
,
onSuccess
){
var
_length
=
importMeshes
.
length
;
var
_meshes
=
[]
var
_skeletons
=
[]
var
_loadCount
=
0
;
importMeshes
.
forEach
((
list
)
=>
{
BABYLON
.
SceneLoader
.
ImportMesh
(
""
,
list
.
rootUrl
,
list
.
sceneFilename
,
YtSceneManager
.
ins
.
scene
,
(
_mesh
,
_skeleton
)
=>
{
try
{
_meshes
.
push
(
_mesh
)
_skeletons
.
push
(
_skeleton
)
_loadCount
++
if
(
_loadCount
==
_length
){
onSuccess
(
_meshes
,
_skeletons
)
}
}
catch
(
e
)
{
console
.
error
(
e
)
}
}
);
})
}
}
\ No newline at end of file
dist/module/game/SlGameSceneModule.js
View file @
bb68010b
...
...
@@ -36,8 +36,8 @@ var SlGameSceneModule = /** @class */ (function (_super) {
}
};
SlGameSceneModule
.
prototype
.
show
=
function
()
{
this
.
resetGame
();
duiba_yt_2
.
YtSceneManager
.
ins
.
change
(
this
.
display
);
this
.
resetGame
();
};
SlGameSceneModule
.
prototype
.
resetGame
=
function
()
{
this
.
model
.
update
();
...
...
dist/module/game/SlGameSceneModule.js.map
View file @
bb68010b
{"version":3,"file":"SlGameSceneModule.js","sourceRoot":"","sources":["../../../src/module/game/SlGameSceneModule.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAkC;AAClC,qCAAwC;AACxC,qCAAyC;AAGzC,wDAAqD;AACrD,qCAAyC;AAEzC;IAAuC,qCAAQ;IAA/C;QAAA,qEA0HC;QArGa,WAAK,GAAC,CAAC,CAAC;;IAqGtB,CAAC;IA/Ga,qCAAS,GAAnB;QACI,IAAI,CAAC,KAAK,GAAG,IAAI,wBAAa,EAAE,CAAC;IACrC,CAAC;IAUD,IAAI;IACG,mCAAO,GAAd;QACI,IAAI,CAAC,CAAC;QACN,KAAI,CAAC,IAAI,IAAI,CAAC,OAAO,EAAC;YAClB,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAA;YAC5B,IAAI,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAC;gBAChB,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,CAAA;aAC5B;SACJ;IACL,CAAC;IAEM,gCAAI,GAAX;QACI,IAAI,CAAC,SAAS,EAAE,CAAA;QAChB,yBAAc,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC5C,CAAC;IAES,qCAAS,G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AAe,CAAC,GAAG,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;QAC3C,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;IAC9B,CAAC;IAGD;;;;OAIG;IACO,wCAAY,GAAtB,UAAuB,YAAY,EAAC,SAAS;QACzC,IAAI,OAAO,GAAC,YAAY,CAAC,MAAM,CAAC;QAChC,IAAI,OAAO,GAAC,EAAE,CAAA;QACd,IAAI,UAAU,GAAC,EAAE,CAAA;QACjB,IAAI,UAAU,GAAC,CAAC,CAAC;QACjB,YAAY,CAAC,OAAO,CAAC,UAAC,IAAI;YACtB,OAAO,CAAC,WAAW,CAAC,UAAU,CAC1B,EAAE,EACF,IAAI,CAAC,OAAO,EACZ,IAAI,CAAC,aAAa,EAClB,yBAAc,CAAC,GAAG,CAAC,KAAK,EACxB,UAAC,KAAK,EAAC,SAAS;gBACZ,IAAI;oBACA,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;oBACnB,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;oBAC1B,UAAU,EAAE,CAAA;oBACZ,IAAG,UAAU,IAAE,OAAO,EAAC;wBACnB,SAAS,CAAC,OAAO,EAAC,UAAU,CAAC,CAAA;qBAChC;iBACJ;gBAAC,OAAO,CAAC,EAAE;oBACR,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;iBACnB;YACL,CAAC,CACJ,CAAC;QACN,CAAC,CAAC,CAAA;IACN,CAAC;IAEL,wBAAC;AAAD,CAAC,AA1HD,CAAuC,mBAAQ,GA0H9C;AA1HY,8CAAiB"}
\ No newline at end of file
{"version":3,"file":"SlGameSceneModule.js","sourceRoot":"","sources":["../../../src/module/game/SlGameSceneModule.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAkC;AAClC,qCAAwC;AACxC,qCAAyC;AAGzC,wDAAqD;AACrD,qCAAyC;AAEzC;IAAuC,qCAAQ;IAA/C;QAAA,qEA0HC;QArGa,WAAK,GAAC,C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C,CAAA;oBAC1B,UAAU,EAAE,CAAA;oBACZ,IAAG,UAAU,IAAE,OAAO,EAAC;wBACnB,SAAS,CAAC,OAAO,EAAC,UAAU,CAAC,CAAA;qBAChC;iBACJ;gBAAC,OAAO,CAAC,EAAE;oBACR,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;iBACnB;YACL,CAAC,CACJ,CAAC;QACN,CAAC,CAAC,CAAA;IACN,CAAC;IAEL,wBAAC;AAAD,CAAC,AA1HD,CAAuC,mBAAQ,GA0H9C;AA1HY,8CAAiB"}
\ No newline at end of file
src/module/game/SlGameSceneModule.ts
View file @
bb68010b
...
...
@@ -41,8 +41,8 @@ export class SlGameSceneModule extends YtModule{
}
public
show
(){
this
.
resetGame
()
YtSceneManager
.
ins
.
change
(
this
.
display
);
this
.
resetGame
()
}
protected
resetGame
(){
...
...
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