Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
Lwd
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
Lwd
Commits
8acdd228
Commit
8acdd228
authored
Mar 30, 2021
by
Lwd
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
aaaa
parent
e9e05281
Changes
13
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
11352 additions
and
830 deletions
+11352
-830
custom-hot-zone.component.html
...app/common/custom-hot-zone/custom-hot-zone.component.html
+61
-70
upload-dragon-bone.component.ts
...common/upload-dragon-bone/upload-dragon-bone.component.ts
+173
-173
form.component.html
form/src/app/form/form.component.html
+57
-2
form.component.ts
form/src/app/form/form.component.ts
+53
-4
yarn.lock
form/yarn.lock
+9829
-0
Comic Sans MS Bold.ttf
play/assets/tmpGame/fonts/Comic Sans MS Bold.ttf
+0
-0
Comic Sans MS Bold.ttf.meta
play/assets/tmpGame/fonts/Comic Sans MS Bold.ttf.meta
+5
-0
Game.fire
play/assets/tmpGame/scene/Game.fire
+896
-434
game.js
play/assets/tmpGame/script/game/game.js
+26
-2
item.js
play/assets/tmpGame/script/game/item.js
+134
-131
result.js
play/assets/tmpGame/script/game/result.js
+75
-7
data_mgr.js
play/assets/tmpGame/script/manager/data_mgr.js
+3
-1
res_mgr.js
play/assets/tmpGame/script/manager/res_mgr.js
+40
-6
No files found.
form/src/app/common/custom-hot-zone/custom-hot-zone.component.html
View file @
8acdd228
...
@@ -12,15 +12,13 @@
...
@@ -12,15 +12,13 @@
<h5>
add background:
</h5>
<h5>
add background:
</h5>
<div
class=
"bg-box"
>
<div
class=
"bg-box"
>
<app-upload-image-with-preview
<app-upload-image-with-preview
[
picUrl
]="
bgItem
?.
url
"
[
picUrl
]="
bgItem
?.
url
"
(
imageUploaded
)="
onBackgroundUploadSuccess
($
event
)"
>
(
imageUploaded
)="
onBackgroundUploadSuccess
($
event
)"
>
</app-upload-image-with-preview>
</app-upload-image-with-preview>
</div>
</div>
</div>
</div>
<div
nz-col
nzSpan=
"5"
nzOffset=
"1"
class=
"img-box"
<div
nz-col
nzSpan=
"5"
nzOffset=
"1"
class=
"img-box"
*
ngFor=
"let it of hotZoneArr; let i = index"
>
*
ngFor=
"let it of hotZoneArr; let i = index"
>
<div
<div
style=
"margin: auto; padding: 5px; margin-top: 30px; width:90%; border: 2px dashed #ddd; border-radius: 10px"
>
style=
"margin: auto; padding: 5px; margin-top: 30px; width:90%; border: 2px dashed #ddd; border-radius: 10px"
>
...
@@ -42,8 +40,7 @@
...
@@ -42,8 +40,7 @@
</div>
</div>
<div
*
ngIf=
"it.itemType == 'pic'"
>
<div
*
ngIf=
"it.itemType == 'pic'"
>
<app-upload-image-with-preview
<app-upload-image-with-preview
[
picUrl
]="
it
?.
pic_url
"
[
picUrl
]="
it
?.
pic_url
"
(
imageUploaded
)="
onItemImgUploadSuccess
($
event
,
it
)"
>
(
imageUploaded
)="
onItemImgUploadSuccess
($
event
,
it
)"
>
</app-upload-image-with-preview>
</app-upload-image-with-preview>
</div>
</div>
...
@@ -53,10 +50,8 @@
...
@@ -53,10 +50,8 @@
</div>
</div>
<div
style=
"width: 100%; margin-top: 5px;"
>
<div
style=
"width: 100%; margin-top: 5px;"
>
<app-audio-recorder
<app-audio-recorder
[
audioUrl
]="
it
.
audio_url
"
[
audioUrl
]="
it
.
audio_url
"
(
audioUploaded
)="
onItemAudioUploadSuccess
($
event
,
it
)"
></app-audio-recorder>
(
audioUploaded
)="
onItemAudioUploadSuccess
($
event
,
it
)"
></app-audio-recorder>
</div>
</div>
</div>
</div>
...
@@ -67,8 +62,7 @@
...
@@ -67,8 +62,7 @@
<div
nz-col
nzSpan=
"5"
nzOffset=
"1"
>
<div
nz-col
nzSpan=
"5"
nzOffset=
"1"
>
<div
class=
"bg-box"
>
<div
class=
"bg-box"
>
<button
nz-button
nzType=
"dashed"
(
click
)="
addBtnClick
()"
<button
nz-button
nzType=
"dashed"
(
click
)="
addBtnClick
()"
class=
"add-btn"
>
class=
"add-btn"
>
<i
nz-icon
nzType=
"plus-circle"
nzTheme=
"outline"
></i>
<i
nz-icon
nzType=
"plus-circle"
nzTheme=
"outline"
></i>
<!--Add Image-->
<!--Add Image-->
Add hot zone
Add hot zone
...
@@ -83,8 +77,7 @@
...
@@ -83,8 +77,7 @@
<div
class=
"save-box"
>
<div
class=
"save-box"
>
<button
class=
"save-btn"
nz-button
nzType=
"primary"
[
nzSize
]="'
large
'"
nzShape=
"round"
<button
class=
"save-btn"
nz-button
nzType=
"primary"
[
nzSize
]="'
large
'"
nzShape=
"round"
(
click
)="
saveClick
()"
>
(
click
)="
saveClick
()"
>
<i
nz-icon
nzType=
"save"
></i>
<i
nz-icon
nzType=
"save"
></i>
Save
Save
</button>
</button>
...
@@ -96,5 +89,3 @@
...
@@ -96,5 +89,3 @@
<label
style=
"opacity: 0; position: absolute; top: 0px; font-family: 'BRLNSR_1'"
>
1
</label>
<label
style=
"opacity: 0; position: absolute; top: 0px; font-family: 'BRLNSR_1'"
>
1
</label>
\ No newline at end of file
form/src/app/common/upload-dragon-bone/upload-dragon-bone.component.ts
View file @
8acdd228
import
{
ApplicationRef
,
Component
,
EventEmitter
,
Input
,
OnChanges
,
OnDestroy
,
Output
}
from
'
@angular/core
'
;
import
{
ApplicationRef
,
Component
,
EventEmitter
,
Input
,
OnChanges
,
OnDestroy
,
Output
}
from
'
@angular/core
'
;
import
{
NzMessageService
,
UploadXHRArgs
,
UploadFile
}
from
'
ng-zorro-antd
'
;
import
{
NzMessageService
,
UploadXHRArgs
,
UploadFile
}
from
'
ng-zorro-antd
'
;
...
@@ -59,8 +59,8 @@ export class UploadDragonBoneComponent implements OnDestroy, OnChanges {
...
@@ -59,8 +59,8 @@ export class UploadDragonBoneComponent implements OnDestroy, OnChanges {
constructor
(
private
appRef
:
ApplicationRef
,
private
nzMessageService
:
NzMessageService
)
{
constructor
(
private
appRef
:
ApplicationRef
,
private
nzMessageService
:
NzMessageService
)
{
this
.
uploadUrl
=
(
<
any
>
window
).
courseware
.
uploadUrl
();
this
.
uploadUrl
=
(
<
any
>
window
).
courseware
.
uploadUrl
();
this
.
uploadData
=
(
<
any
>
window
).
courseware
.
uploadData
();
this
.
uploadData
=
(
<
any
>
window
).
courseware
.
uploadData
();
window
[
'
air
'
].
getUploadCallback
=
(
url
,
data
)
=>
{
window
[
'
air
'
].
getUploadCallback
=
(
url
,
data
)
=>
{
this
.
uploadUrl
=
url
;
this
.
uploadUrl
=
url
;
...
...
form/src/app/form/form.component.html
View file @
8acdd228
...
@@ -4,6 +4,13 @@
...
@@ -4,6 +4,13 @@
<input
type=
"text"
nz-input
[(
ngModel
)]="
item
.
contentObj
.
title
"
(
blur
)="
saveItem
()"
>
<input
type=
"text"
nz-input
[(
ngModel
)]="
item
.
contentObj
.
title
"
(
blur
)="
saveItem
()"
>
</div>
</div>
<div
class=
"section-content;text-align:center"
>
<div
style=
"display: inline-block; margin-bottom: 10px"
>
<app-audio-recorder
[
audioUrl
]="
item
.
contentObj
.
audio_url
"
(
audioUploaded
)="
onAudioUploadSuccessByItem
($
event
,
item
.
contentObj
)"
>
</app-audio-recorder>
</div>
</div>
<div
*
ngFor=
"let it of pageArr; let i = index"
style=
"padding: 0.5vw; width: 20%;"
>
<div
*
ngFor=
"let it of pageArr; let i = index"
style=
"padding: 0.5vw; width: 20%;"
>
<div
class=
"border"
style=
"display: flex; align-items: center;"
>
<div
class=
"border"
style=
"display: flex; align-items: center;"
>
...
@@ -64,12 +71,60 @@
...
@@ -64,12 +71,60 @@
<!--公共部分-->
<!--公共部分-->
<div
class=
"item-box"
style=
"width: 35% ;padding-left: 100px"
>
<div
class=
"item-box"
style=
"width: 35% ;padding-left: 100px"
>
<div
style=
"width: 100%;"
>
<div
style=
"width: 100%;"
>
<app-upload-image-with-preview
style=
"width: 100%"
[
picUrl
]="
it
['
groupPic
']"
<div
style=
"float: left; text-align: right; margin-right: 10px; margin-left: 10px;"
>
(
imageUploaded
)="
onImageUploadSuccessByItem
($
event
,
it
)"
>
<span>
显示选项
</span><span>
:
</span>
</div>
<div
style=
"float: left;width: 100%;"
>
<nz-radio-group
[(
ngModel
)]="
it
['
type
']"
(
ngModelChange
)="
handleQuestionTypeChange
($
event
)"
>
<label
nz-radio
[
nzValue
]="'
Image
'"
>
背景图片
</label>
<label
nz-radio
[
nzValue
]="'
Spine
'"
>
骨骼动画
</label>
</nz-radio-group>
</div>
<div
style=
"float: left;width: 100%;"
>
<div
*
ngIf=
"it['type']=='Image'"
>
<app-upload-image-with-preview
style=
"width: 100%;"
[
picUrl
]="
it
['
groupPic
']"
(
imageUploaded
)="
onImageUploadSuccessByItem
($
event
,
it
,
'
image_url
')"
>
</app-upload-image-with-preview>
</app-upload-image-with-preview>
</div>
</div>
<div
*
ngIf=
"it['type']=='Spine' "
>
<div
style=
"display: flex 1;margin-bottom: 10px;margin-left: 10px;"
>
<span>
上传 ske_json 文件
</span><span>
:
</span>
<nz-upload
nzAccept=
".json"
[
nzAction
]="
uploadUrl
"
[
nzData
]="
uploadData
"
[
nzShowUploadList
]="
false
"
(
nzChange
)="
handleChange
($
event
,
it
,'
ske_json
')"
>
<button
nz-button
><i
nz-icon
nzType=
"upload"
></i>
Upload
</button>
</nz-upload>
<span
style=
"margin-left: 10px;"
>
{{it["ske_json_name"]}}
</span>
</div>
<div
style=
"display: flex 1;margin-bottom: 10px;margin-left: 10px;"
>
<span>
上传 tex_json 文件
</span><span>
:
</span>
<nz-upload
nzAccept=
".json"
[
nzAction
]="
uploadUrl
"
[
nzData
]="
uploadData
"
[
nzShowUploadList
]="
false
"
(
nzChange
)="
handleChange
($
event
,
it
,'
tex_json
')"
>
<button
nz-button
><i
nz-icon
nzType=
"upload"
></i>
Upload
</button>
</nz-upload>
<span
style=
"margin-left: 10px;"
>
{{ it["tex_json_name"] }}
</span>
</div>
<div
style=
"display: flex 1;margin-bottom: 10px;margin-left: 10px;"
>
<span>
上传 tex_png 文件
</span><span>
:
</span>
<nz-upload
nzAccept=
".png"
[
nzAction
]="
uploadUrl
"
[
nzData
]="
uploadData
"
[
nzShowUploadList
]="
false
"
(
nzChange
)="
handleChange
($
event
,
it
,'
tex_png
')"
>
<button
nz-button
><i
nz-icon
nzType=
"upload"
></i>
Upload
</button>
</nz-upload>
<span
style=
"margin-left: 10px;"
>
{{ it["tex_png_name"] }}
</span>
</div>
</div>
</div>
<!-- <app-upload-image-with-preview style="width: 100%" [picUrl]="it['groupPic']"
(imageUploaded)="onImageUploadSuccessByItem($event, it)">
</app-upload-image-with-preview> -->
</div>
<input
style=
" width: 100%; margin-bottom: 0.5vw"
type=
"text"
nz-input
placeholder=
"点击输入文本内容"
<input
style=
" width: 100%; margin-bottom: 0.5vw"
type=
"text"
nz-input
placeholder=
"点击输入文本内容"
[(
ngModel
)]="
it
.
groupLabel
"
(
blur
)="
saveItem
()"
>
[(
ngModel
)]="
it
.
groupLabel
"
(
blur
)="
saveItem
()"
>
<app-audio-recorder
style=
"margin-top: 0.5vw"
[
audioUrl
]="
it
['
group_audio_url
']"
(
audioUploaded
)="
onAudioUploadSuccessByItem
($
event
,
it
,
'
group
')"
>
</app-audio-recorder>
</div>
</div>
<div
class=
"item-box"
style=
"width:35%; padding-left: 100px"
>
<div
class=
"item-box"
style=
"width:35%; padding-left: 100px"
>
...
...
form/src/app/form/form.component.ts
View file @
8acdd228
...
@@ -9,6 +9,7 @@ import {
...
@@ -9,6 +9,7 @@ import {
ApplicationRef
,
ApplicationRef
,
ChangeDetectorRef
ChangeDetectorRef
}
from
'
@angular/core
'
;
}
from
'
@angular/core
'
;
import
{
NzMessageService
,
UploadXHRArgs
,
UploadFile
}
from
'
ng-zorro-antd
'
;
...
@@ -19,6 +20,9 @@ import {
...
@@ -19,6 +20,9 @@ import {
})
})
export
class
FormComponent
implements
OnInit
,
OnChanges
,
OnDestroy
{
export
class
FormComponent
implements
OnInit
,
OnChanges
,
OnDestroy
{
pageArr
=
[];
//页数据
pageArr
=
[];
//页数据
fileList
uploadUrl
uploadData
_item
:
any
;
_item
:
any
;
KEY
=
'
hw_004
'
;
KEY
=
'
hw_004
'
;
...
@@ -43,10 +47,13 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
...
@@ -43,10 +47,13 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
update
=
new
EventEmitter
();
update
=
new
EventEmitter
();
constructor
(
private
appRef
:
ApplicationRef
,
private
changeDetectorRef
:
ChangeDetectorRef
)
{
constructor
(
private
appRef
:
ApplicationRef
,
this
.
uploadUrl
=
(
<
any
>
window
).
courseware
.
uploadUrl
();
public
changeDetectorRef
:
ChangeDetectorRef
)
{
this
.
uploadData
=
(
<
any
>
window
).
courseware
.
uploadData
();
window
[
'
air
'
].
getUploadCallback
=
(
url
,
data
)
=>
{
this
.
uploadUrl
=
url
;
this
.
uploadData
=
data
;
};
}
}
...
@@ -55,6 +62,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
...
@@ -55,6 +62,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
this
.
item
=
{};
this
.
item
=
{};
this
.
item
.
contentObj
=
{};
this
.
item
.
contentObj
=
{};
const
getData
=
(
<
any
>
window
).
courseware
.
getData
;
const
getData
=
(
<
any
>
window
).
courseware
.
getData
;
getData
((
data
)
=>
{
getData
((
data
)
=>
{
...
@@ -99,6 +107,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
...
@@ -99,6 +107,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
console
.
log
(
'
item:
'
,
this
.
item
);
console
.
log
(
'
item:
'
,
this
.
item
);
}
}
getDefaultPicArr
()
{
getDefaultPicArr
()
{
const
arr
=
[];
const
arr
=
[];
// for (let i = 0; i < 4; i ++) {
// for (let i = 0; i < 4; i ++) {
...
@@ -170,6 +179,38 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
...
@@ -170,6 +179,38 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
this
.
save
();
this
.
save
();
}
}
uploadSuccess
(
file
,
item
,
key
)
{
console
.
log
(
item
);
item
[
key
]
=
file
.
response
.
url
;
item
[
key
+
'
_name
'
]
=
file
.
name
;
this
.
save
();
}
handleChange
(
info
:
{
type
:
string
,
file
:
UploadFile
,
event
:
any
},
item
,
key
)
{
console
.
log
(
'
info:
'
,
info
);
switch
(
info
.
type
)
{
case
'
success
'
:
this
.
uploadSuccess
(
info
.
file
,
item
,
key
);
break
;
}
}
handleQuestionTypeChange
(
key
)
{
if
(
key
==
'
Spine
'
)
{
this
.
fileList
=
[
{
uid
:
'
-1
'
,
name
:
this
.
item
[
'
ske_json
'
],
status
:
'
done
'
,
url
:
this
.
item
[
'
ske_json
'
]
}
]
}
else
if
(
key
==
'
Image
'
)
{
}
this
.
saveItem
()
this
.
changeDetectorRef
.
detectChanges
();
this
.
changeDetectorRef
.
markForCheck
();
}
//添加页面
//添加页面
addPage
()
{
addPage
()
{
const
data
=
{
const
data
=
{
...
@@ -189,6 +230,13 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
...
@@ -189,6 +230,13 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
b_audio_url
:
''
,
b_audio_url
:
''
,
groupLabel
:
''
,
groupLabel
:
''
,
groupPic
:
''
,
groupPic
:
''
,
group_audio_url
:
''
,
type
:
''
,
ske_json
:
''
,
tex_json
:
''
,
tex_png
:
''
,
// uploadData: '',
// uploadUrl: '',
};
};
this
.
pageArr
[
i
].
pageInfo
.
push
(
data
);
this
.
pageArr
[
i
].
pageInfo
.
push
(
data
);
console
.
log
(
this
.
pageArr
);
console
.
log
(
this
.
pageArr
);
...
@@ -222,6 +270,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
...
@@ -222,6 +270,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
const
getData
=
(
<
any
>
window
).
courseware
.
getData
;
const
getData
=
(
<
any
>
window
).
courseware
.
getData
;
getData
((
data
)
=>
{
getData
((
data
)
=>
{
console
.
log
(
'
data:
'
,
data
);
console
.
log
(
'
data:
'
,
data
);
// console.log('string:', JSON.stringify(data));
},
this
.
KEY
);
},
this
.
KEY
);
}
}
...
...
form/yarn.lock
0 → 100644
View file @
8acdd228
This diff is collapsed.
Click to expand it.
play/assets/tmpGame/fonts/Comic Sans MS Bold.ttf
0 → 100644
View file @
8acdd228
File added
play/assets/tmpGame/fonts/Comic Sans MS Bold.ttf.meta
0 → 100644
View file @
8acdd228
{
"ver": "1.1.0",
"uuid": "61fcc759-2eb5-4e50-a2f3-0cc3393881d8",
"subMetas": {}
}
\ No newline at end of file
play/assets/tmpGame/scene/Game.fire
View file @
8acdd228
This diff is collapsed.
Click to expand it.
play/assets/tmpGame/script/game/game.js
View file @
8acdd228
...
@@ -114,6 +114,13 @@ var game = cc.Class({
...
@@ -114,6 +114,13 @@ var game = cc.Class({
}
}
this
.
resultNode
.
active
=
false
;
this
.
resultNode
.
active
=
false
;
//重置游戏数据游戏数据
g
.
data_mgr
.
resGameData
();
g
.
data_mgr
.
addPreloadImage
();
g
.
data_mgr
.
addPreloadAudio
();
g
.
data_mgr
.
addPreloadAnima
();
//初始化界面
//初始化界面
this
.
UpdataUi
();
this
.
UpdataUi
();
...
@@ -123,6 +130,8 @@ var game = cc.Class({
...
@@ -123,6 +130,8 @@ var game = cc.Class({
//游戏开始
//游戏开始
g
.
game
.
inst
.
gameStart
();
g
.
game
.
inst
.
gameStart
();
//清除线
//清除线
this
.
clearLine
();
this
.
clearLine
();
},
},
...
@@ -162,6 +171,15 @@ var game = cc.Class({
...
@@ -162,6 +171,15 @@ var game = cc.Class({
});
});
},
},
//播放标题音效
playAudioTitle
:
function
()
{
//获得播放路径
var
path
=
g
.
data_mgr
.
data
.
contentObj
.
audio_url
;
g
.
res_mgr
.
playAudioByUrl
(
path
,
(
url
)
=>
{
g
.
snd_mgr
.
playEffect
(
url
);
});
},
//添加项
//添加项
addItem
:
function
(
listInfo
,
content
,
item
,
i
)
{
addItem
:
function
(
listInfo
,
content
,
item
,
i
)
{
if
(
listInfo
.
length
<=
i
)
{
if
(
listInfo
.
length
<=
i
)
{
...
@@ -190,7 +208,12 @@ var game = cc.Class({
...
@@ -190,7 +208,12 @@ var game = cc.Class({
for
(
var
i
=
0
;
i
<
conten
.
childrenCount
;
i
++
)
{
for
(
var
i
=
0
;
i
<
conten
.
childrenCount
;
i
++
)
{
var
item
=
conten
.
children
[
i
]
var
item
=
conten
.
children
[
i
]
if
(
item
.
state
==
1
||
item
.
state
==
3
)
{
if
(
item
.
state
==
1
||
item
.
state
==
3
)
{
// if (state == 2) {
var
com
=
item
.
getComponent
(
"
item
"
);
//设置状态为可答题
com
.
setBtnState
(
item
.
state
);
continue
;
continue
;
// }
}
else
{
}
else
{
var
com
=
item
.
getComponent
(
"
item
"
);
var
com
=
item
.
getComponent
(
"
item
"
);
//设置状态为可答题
//设置状态为可答题
...
@@ -199,7 +222,7 @@ var game = cc.Class({
...
@@ -199,7 +222,7 @@ var game = cc.Class({
}
}
},
},
ShowLine
:
function
(
sx
,
sy
,
ex
,
ey
)
{
ShowLine
:
function
(
sx
,
sy
,
ex
,
ey
,
cb
)
{
var
b
=
0
;
var
b
=
0
;
var
a
=
0
;
var
a
=
0
;
var
k
=
ex
==
sx
?
0
:
(
ey
-
sy
)
/
(
ex
-
sx
);
var
k
=
ex
==
sx
?
0
:
(
ey
-
sy
)
/
(
ex
-
sx
);
...
@@ -220,7 +243,7 @@ var game = cc.Class({
...
@@ -220,7 +243,7 @@ var game = cc.Class({
if
(
difnode
)
{
if
(
difnode
)
{
this
.
scheduleOnce
(
function
()
{
this
.
scheduleOnce
(
function
()
{
this
.
DrawLine
(
sx
,
sy
,
difx
,
dify
);
this
.
DrawLine
(
sx
,
sy
,
difx
,
dify
);
this
.
ShowLine
(
difx
,
dify
,
ex
,
ey
);
this
.
ShowLine
(
difx
,
dify
,
ex
,
ey
,
cb
);
}.
bind
(
this
),
0.01
);
}.
bind
(
this
),
0.01
);
}
}
else
{
else
{
...
@@ -232,6 +255,7 @@ var game = cc.Class({
...
@@ -232,6 +255,7 @@ var game = cc.Class({
//显示弹窗
//显示弹窗
var
Info
=
g
.
data_mgr
.
getResultInfo
(
g
.
data_mgr
.
nowNode
.
typeId
);
var
Info
=
g
.
data_mgr
.
getResultInfo
(
g
.
data_mgr
.
nowNode
.
typeId
);
g
.
game
.
inst
.
showResult
(
Info
);
g
.
game
.
inst
.
showResult
(
Info
);
cb
&&
cb
();
}
}
},
},
...
...
play/assets/tmpGame/script/game/item.js
View file @
8acdd228
...
@@ -62,7 +62,7 @@ cc.Class({
...
@@ -62,7 +62,7 @@ cc.Class({
//设置按钮状态0可点击 1已答对 2答错 3连线完成
//设置按钮状态0可点击 1已答对 2答错 3连线完成
setBtnState
:
function
(
num
)
{
setBtnState
:
function
(
num
)
{
this
.
nodeState
[
num
].
active
=
true
;
//
this.nodeState[num].active = true;
switch
(
~~
num
)
{
switch
(
~~
num
)
{
case
0
:
case
0
:
this
.
nodeState
[
0
].
active
=
true
;
this
.
nodeState
[
0
].
active
=
true
;
...
@@ -110,15 +110,18 @@ cc.Class({
...
@@ -110,15 +110,18 @@ cc.Class({
g
.
game
.
inst
.
allLightDark
(
2
,
0
);
g
.
game
.
inst
.
allLightDark
(
2
,
0
);
//把这个答对的节点保存起来
//把这个答对的节点保存起来
g
.
data_mgr
.
itemInfo
=
this
.
spt_chick
;
g
.
data_mgr
.
itemInfo
=
this
;
}
}
//如果答对的是下排的话
//如果答对的是下排的话
if
(
this
.
itemInfo
.
positionId
==
2
)
{
if
(
this
.
itemInfo
.
positionId
==
2
)
{
//连线
//连线
var
posStart
=
g
.
data_mgr
.
itemInfo
.
parent
.
convertToWorldSpaceAR
(
g
.
data_mgr
.
itemInfo
.
position
);
var
posStart
=
g
.
data_mgr
.
itemInfo
.
spt_chick
.
parent
.
convertToWorldSpaceAR
(
g
.
data_mgr
.
itemInfo
.
spt_chick
.
position
);
var
posEnd
=
this
.
spt_chick
.
parent
.
convertToWorldSpaceAR
(
this
.
spt_chick
.
position
);
var
posEnd
=
this
.
spt_chick
.
parent
.
convertToWorldSpaceAR
(
this
.
spt_chick
.
position
);
g
.
data_mgr
.
nowNode
=
this
.
itemInfo
;
g
.
data_mgr
.
nowNode
=
this
.
itemInfo
;
g
.
game
.
inst
.
ShowLine
(
posStart
.
x
-
640
,
posStart
.
y
-
360
,
posEnd
.
x
-
640
,
posEnd
.
y
-
360
);
g
.
game
.
inst
.
ShowLine
(
posStart
.
x
-
640
,
posStart
.
y
-
360
,
posEnd
.
x
-
640
,
posEnd
.
y
-
360
,
()
=>
{
g
.
data_mgr
.
itemInfo
.
setBtnState
(
3
);
this
.
setBtnState
(
3
);
});
// //显示弹窗
// //显示弹窗
// var Info = g.data_mgr.getResultInfo(this.itemInfo.typeId);
// var Info = g.data_mgr.getResultInfo(this.itemInfo.typeId);
// g.game.inst.showResult(Info);
// g.game.inst.showResult(Info);
...
...
play/assets/tmpGame/script/game/result.js
View file @
8acdd228
/**
/**
* result
* result
*/
*/
const
Color_texts
=
[
'
#BE1AC1
'
,
'
#24C11A
'
,
'
#1A1DC1
'
,
'
#9F5307
'
];
var
result
=
cc
.
Class
({
var
result
=
cc
.
Class
({
extends
:
cc
.
Component
,
extends
:
cc
.
Component
,
...
@@ -29,6 +31,16 @@ var result = cc.Class({
...
@@ -29,6 +31,16 @@ var result = cc.Class({
default
:
null
,
default
:
null
,
type
:
cc
.
Animation
,
type
:
cc
.
Animation
,
displayName
:
"
撒花特效
"
displayName
:
"
撒花特效
"
},
Armature
:
{
default
:
null
,
type
:
dragonBones
.
ArmatureDisplay
,
displayName
:
"
动画
"
},
layoutText
:
{
default
:
null
,
type
:
cc
.
Node
,
displayName
:
"
文字布局
"
}
}
},
},
...
@@ -39,13 +51,24 @@ var result = cc.Class({
...
@@ -39,13 +51,24 @@ var result = cc.Class({
//更新界面ui
//更新界面ui
updateUI
:
function
(
Info
)
{
updateUI
:
function
(
Info
)
{
this
.
Picture
.
active
=
false
;
this
.
Armature
.
node
.
active
=
false
;
if
(
Info
)
{
if
(
Info
)
{
//当前数据
//当前数据
this
.
itemInfo
=
Info
;
this
.
itemInfo
=
Info
;
//显示图片
if
(
Info
.
type
==
"
Image
"
)
{
//设置图片
//设置图片
this
.
setPicture
(
Info
.
groupPic
);
this
.
setPicture
(
Info
.
groupPic
);
//设置图片
}
this
.
setTips
(
Info
.
groupLabel
);
//显示骨骼动画
if
(
Info
.
type
==
"
Spine
"
)
{
g
.
res_mgr
.
loadSpine
(
this
.
Armature
,
Info
);
}
this
.
initRichText
(
Info
.
groupLabel
);
this
.
wellDone
.
active
=
false
;
this
.
wellDone
.
active
=
false
;
this
.
frame_tips
.
active
=
true
;
this
.
frame_tips
.
active
=
true
;
this
.
eff_sahua
.
node
.
active
=
false
;
this
.
eff_sahua
.
node
.
active
=
false
;
...
@@ -61,9 +84,9 @@ var result = cc.Class({
...
@@ -61,9 +84,9 @@ var result = cc.Class({
}
}
},
},
//
设置标签
//
初始化文本
setTips
:
function
(
num
)
{
initRichText
(
text
)
{
this
.
lb_tips
.
string
=
num
;
this
.
lb_tips
.
string
=
text
;
},
},
//设置图片
//设置图片
...
@@ -75,6 +98,51 @@ var result = cc.Class({
...
@@ -75,6 +98,51 @@ var result = cc.Class({
}.
bind
(
this
));
}.
bind
(
this
));
},
},
//播放龙骨动画
playSpine
()
{
this
.
Armature
.
playAnimation
(
g
.
data_mgr
.
dragonName
,
1
);
},
stopSpine
()
{
this
.
Armature
.
dragonAtlasAsset
=
null
;
this
.
Armature
.
dragonAsset
=
null
;
this
.
Armature
.
armatureName
=
''
;
this
.
scheduleOnce
(()
=>
{
g
.
res_mgr
.
loadSpine
(
this
.
Armature
,
this
.
Info
);
})
},
playAudio
()
{
cc
.
assetManager
.
loadRemote
(
this
.
itemInfo
.
group_audio_url
,
null
,
(
err
,
clip
)
=>
{
this
.
audioID
=
cc
.
audioEngine
.
play
(
clip
,
false
,
1
);
this
.
audioDuration
=
cc
.
audioEngine
.
getDuration
(
this
.
audioID
);
this
.
textDuration
=
this
.
audioDuration
/
this
.
layoutText
.
childrenCount
;
this
.
textIndex
=
0
;
this
.
schedule
(
this
.
chengeTextColor
,
this
.
textDuration
,
this
.
layoutText
.
childrenCount
,
0.01
)
});
},
stopAudio
()
{
cc
.
audioEngine
.
stop
(
this
.
audioID
);
this
.
unschedule
(
this
.
chengeTextColor
);
this
.
isPlaying
=
false
;
this
.
stopSpine
();
},
chengeTextColor
()
{
if
(
!
this
.
layoutText
.
children
[
this
.
textIndex
]
||
this
.
textIndex
==
this
.
layoutText
.
childrenCount
)
{
this
.
isPlaying
=
false
;
this
.
unschedule
(
this
.
chengeTextColor
);
}
this
.
layoutText
.
children
[
this
.
textIndex
]
&&
(
this
.
layoutText
.
children
[
this
.
textIndex
].
color
=
new
cc
.
Color
().
fromHEX
(
Color_texts
[
3
]));
this
.
layoutText
.
children
[
this
.
textIndex
-
1
]
&&
(
this
.
layoutText
.
children
[
this
.
textIndex
-
1
].
color
=
new
cc
.
Color
().
fromHEX
(
Color_texts
[
3
]));
this
.
textIndex
++
;
},
clearTextColor
()
{
for
(
let
i
=
0
;
i
<
this
.
layoutText
.
children
.
length
;
i
++
)
{
this
.
layoutText
.
children
[
i
].
color
=
new
cc
.
Color
().
fromHEX
(
Color_texts
[
3
]);
}
},
//点击关闭
//点击关闭
onBtnClose
:
function
()
{
onBtnClose
:
function
()
{
this
.
node
.
active
=
false
;
this
.
node
.
active
=
false
;
...
...
play/assets/tmpGame/script/manager/data_mgr.js
View file @
8acdd228
This diff is collapsed.
Click to expand it.
play/assets/tmpGame/script/manager/res_mgr.js
View file @
8acdd228
...
@@ -53,13 +53,47 @@ g.res_mgr = {
...
@@ -53,13 +53,47 @@ g.res_mgr = {
if
(
audio_url
)
{
if
(
audio_url
)
{
cc
.
assetManager
.
loadRemote
(
audio_url
,
(
err
,
audioClip
)
=>
{
cc
.
assetManager
.
loadRemote
(
audio_url
,
(
err
,
audioClip
)
=>
{
cb
&&
cb
(
audioClip
);
cb
&&
cb
(
audioClip
);
// const audioId = cc.audioEngine.play(audioClip, false, 0.8);
// if (cb) {
// cc.audioEngine.setFinishCallback(audioId, () => {
// cb();
// });
// }
});
});
}
}
},
},
//加载龙骨
loadSpine
(
animationDisplay
,
Info
)
{
if
(
Info
.
type
==
'
Image
'
)
{
return
;
}
cc
.
assetManager
.
loadAny
([{
url
:
Info
.
tex_json
,
ext
:
'
.txt
'
},
{
url
:
Info
.
ske_json
,
ext
:
'
.txt
'
}],
(
error
,
assets
)
=>
{
if
(
error
)
{
console
.
log
(
error
)
}
else
{
cc
.
assetManager
.
loadRemote
(
Info
.
tex_png
,
(
error
,
texture
)
=>
{
if
(
error
)
{
console
.
log
(
error
)
}
else
{
var
atlas
=
new
dragonBones
.
DragonBonesAtlasAsset
();
atlas
.
_uuid
=
Info
.
tex_json
;
atlas
.
atlasJson
=
assets
[
0
];
atlas
.
texture
=
texture
;
var
asset
=
new
dragonBones
.
DragonBonesAsset
();
asset
.
_uuid
=
Info
.
ske_json
;
asset
.
dragonBonesJson
=
assets
[
1
];
animationDisplay
.
dragonAtlasAsset
=
atlas
;
animationDisplay
.
dragonAsset
=
asset
;
let
data
=
asset
.
_dragonBonesJsonData
.
armature
[
0
];
if
(
!
data
)
{
return
;
}
animationDisplay
.
armatureName
=
data
.
name
;
g
.
data_mgr
.
dragonName
=
data
.
animation
[
0
].
name
;
animationDisplay
.
node
.
active
=
true
;
}
});
}
});
},
}
}
\ No newline at end of file
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