Commit 2b12ba15 authored by 范雪寒's avatar 范雪寒

feat: 缺省数据与资源

parent 6526bffd
......@@ -37,6 +37,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
addTarget() {
this.item.targets.push({
targetImg: '',
targetAudio: '',
x: 0,
y: -300
});
......@@ -142,6 +143,8 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
(<any>window).courseware.setData(this.item, null, this.saveKey);
this.refresh();
this.previewCanvas.refresh();
console.log(JSON.stringify(this.item));
}
/**
......
......@@ -7,29 +7,30 @@ export let defaultData = {
},
carrots: [{
carrotImg: 'carrot',
holeImg: 'hole',
carrotImg: 'carrot1',
carrotAudio: 'child',
holeImg: 'hole1',
}, {
carrotImg: 'carrot',
holeImg: 'hole',
carrotImg: 'carrot1',
carrotAudio: 'knight',
holeImg: 'hole2',
}, {
carrotImg: 'carrot',
holeImg: 'hole',
carrotImg: 'carrot2',
carrotAudio: 'children',
holeImg: 'hole3',
}, {
carrotImg: 'carrot',
holeImg: 'hole',
carrotImg: 'carrot1',
carrotAudio: 'ddbbbbcccc',
holeImg: 'hole4',
}, {
carrotImg: 'carrot',
holeImg: 'hole',
}, {
carrotImg: 'carrot',
holeImg: 'hole',
}, {
carrotImg: 'carrot',
holeImg: 'hole',
}, {
carrotImg: 'carrot',
holeImg: 'hole',
carrotImg: 'carrot2',
carrotAudio: 'eeebbbbcccc',
holeImg: 'hole5',
}],
targets: []
targets: [{
x: -530,
y: -270,
targetImg: 'target',
targetAudio: 'kn'
}]
};
\ No newline at end of file
......@@ -51,9 +51,13 @@ export class MyGame extends Game {
imgUrlList.push(...this.data.carrots.map(data => [data.carrotImg, data.holeImg]).flat(Infinity));
imgUrlList.push(...this.data.targets.map(data => data.targetImg));
audioUrlList.push(...this.data.carrots.map(data => data.carrotAudio));
audioUrlList.push(...this.data.targets.map(data => data.targetAudio));
imgUrlList = imgUrlList.filter((data) => data != null);
audioUrlList = audioUrlList.filter((data) => data != null);
this.preLoadData(imgUrlList, audioUrlList);
}
}
......
......@@ -17,3 +17,27 @@
src: url("../../assets/font/BRLNSDB.TTF") ;
}
@font-face
{
font-family: 'BerlinSansFBDemi-Bold';
src: url("../../assets/font/BerlinSansFBDemi-Bold.TTF") ;
}
@font-face
{
font-family: 'FuturaBT-Bold';
src: url("../../assets/font/FuturaBT-Bold.TTF") ;
}
@font-face
{
font-family: 'CenturyGothic';
src: url("../../assets/font/CenturyGothic.TTF") ;
}
@font-face
{
font-family: 'CenturyGothic-Bold';
src: url("../../assets/font/CenturyGothic-Bold.TTF") ;
}
const res = [
['Img_bg', "assets/play/Img_bg.png"],
['Img_bg2', "assets/play/Img_bg2.png"],
['Img_bg_ground', "assets/play/Img_bg_ground.png"],
['Img_tittleBg', "assets/play/Img_tittleBg.png"],
['Img_bg', "assets/play/Img_bg.png"],
['Img_bg2', "assets/play/Img_bg2.png"],
['Img_bg_ground', "assets/play/Img_bg_ground.png"],
['Img_tittleBg', "assets/play/Img_tittleBg.png"],
['carrot1', "assets/play/default/carrot1.png"],
['carrot2', "assets/play/default/carrot2.png"],
['hole1', "assets/play/default/hole1.png"],
['hole2', "assets/play/default/hole2.png"],
['hole3', "assets/play/default/hole3.png"],
['hole4', "assets/play/default/hole4.png"],
['hole5', "assets/play/default/hole5.png"],
['target', "assets/play/default/target.png"],
];
const resAudio = [
['audio_new_page', "assets/play/audio_new_page.mp3"],
['audio_right', "assets/play/audio_right.mp3"],
['audio_new_page', "assets/play/audio_new_page.mp3"],
['audio_right', "assets/play/audio_right.mp3"],
['ht', "assets/play/default/ht.mp3"],
['ig', "assets/play/default/ig.mp3"],
['kn', "assets/play/default/kn.mp3"],
['ch', "assets/play/default/ch.mp3"],
['child', "assets/play/default/child.mp3"],
['tittle', "assets/play/default/tittle.mp3"],
['knight', "assets/play/default/knight.mp3"],
['children', "assets/play/default/children.mp3"],
['ddbbbbcccc', "assets/play/default/ddbbbbcccc.mp3"],
['eeebbbbcccc', "assets/play/default/eeebbbbcccc.mp3"],
['ccccccccccccccc', "assets/play/default/ccccccccccccccc.mp3"],
];
export {res, resAudio};
export { res, resAudio };
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment