Neuer Leveltyp und reihenfolge geändert

This commit is contained in:
silas
2018-11-12 20:12:34 +01:00
parent 4d7f566656
commit 0d569fea3b
5 changed files with 197 additions and 94 deletions

View File

@@ -6548,73 +6548,8 @@ class BigSegmentsLevels extends Level{
class SimpleFourWordsLevel extends BigSegmentsLevels{
constructor(templateContainer, wordLength, bigSegmentPosition) {
console.log(bigSegmentPosition, "P");
super(templateContainer, wordLength, [bigSegmentPosition, 3]);
super(templateContainer, wordLength, [bigSegmentPosition]);
}
// createSegments() {
// if (this.words.length >= 4 &&
// this.words[0].length >= this.wordLength &&
// this.words[1].length >= this.wordLength &&
// this.words[2].length >= this.wordLength &&
// this.words[3].length >= this.wordLength &&
// this.wordLength >= 4
// ) {
// let leafsWords = [];
// leafsWords[0] = Level._createLeafsForWord(this.words[0], this.templateContainer.copyLeafTemplate());
// leafsWords[1] = Level._createLeafsForWord(this.words[1], this.templateContainer.copyLeafTemplate());
// leafsWords[2] = Level._createLeafsForWord(this.words[2], this.templateContainer.copyLeafTemplate());
// leafsWords[3] = Level._createLeafsForWord(this.words[3], this.templateContainer.copyLeafTemplate());
//
// let rootSegment = new RowSegment(this.templateContainer.copyRowTemplate());
// for (let i = 0; i < this.wordLength / 2; i++) {
// let parents = [];
// parents[0] = new ParentSegment(this.templateContainer.copyParentTemplate());
// parents[1] = new ParentSegment(this.templateContainer.copyParentTemplate());
//
// parents[0].addChild(leafsWords[0][2 * i]);
// parents[0].addChild(leafsWords[0][2 * i + 1]);
// parents[0].addChild(leafsWords[1][2 * i]);
// parents[0].addChild(leafsWords[1][2 * i + 1]);
//
// parents[1].addChild(leafsWords[2][2 * i]);
// parents[1].addChild(leafsWords[2][2 * i + 1]);
// parents[1].addChild(leafsWords[3][2 * i]);
// parents[1].addChild(leafsWords[3][2 * i + 1]);
//
// let parentSegment =null;
// if (i === this.bigSegmentPosition){
// parents[2] = new ParentSegment(this.templateContainer.copyParentTemplate());
// parents[3] = new ParentSegment(this.templateContainer.copyParentTemplate());
//
// parents[2].addChild(leafsWords[0][2 * i + 2]);
// parents[2].addChild(leafsWords[0][2 * i + 3]);
// parents[2].addChild(leafsWords[1][2 * i + 2]);
// parents[2].addChild(leafsWords[1][2 * i + 3]);
//
// parents[3].addChild(leafsWords[2][2 * i + 2]);
// parents[3].addChild(leafsWords[2][2 * i + 3]);
// parents[3].addChild(leafsWords[3][2 * i + 2]);
// parents[3].addChild(leafsWords[3][2 * i + 3]);
//
// parentSegment = new ParentSegment(this.templateContainer.copyParentTemplate());
// parentSegment.addChild(parents[0]);
// parentSegment.addChild(parents[2]);
// parentSegment.addChild(parents[1]);
// parentSegment.addChild(parents[3]);
// i++;
// }
// else{
// parentSegment = new ColumnSegment(this.templateContainer.copyColumnTemplate());
// parentSegment.addChild(parents[0]);
// parentSegment.addChild(parents[1]);
// }
//
// rootSegment.addChild(parentSegment);
// }
// this.setRootSegment(rootSegment)
// }
// }
}
class SimpleFourWordsLevel10_0 extends SimpleFourWordsLevel{
@@ -6641,6 +6576,24 @@ class SimpleFourWordsLevel10_3 extends SimpleFourWordsLevel{
}
}
class TwoSegmentFourWordsLevel10_0_3 extends BigSegmentsLevels{
constructor(templateContainer) {
super(templateContainer, 10, [0,3]);
}
}
class TwoSegmentFourWordsLevel10_1_3 extends BigSegmentsLevels{
constructor(templateContainer) {
super(templateContainer, 10, [1,3]);
}
}
class TwoSegmentFourWordsLevel10_0_2 extends BigSegmentsLevels{
constructor(templateContainer) {
super(templateContainer, 10, [0,2]);
}
}
class LevelHelper {
static setLevelType(typeId, level) {
LevelHelper.types[typeId] = level;
@@ -6675,6 +6628,9 @@ LevelHelper.types = {
82: SimpleFourWordsLevel10_2,
83: SimpleFourWordsLevel10_3,
100: SixWordsRowLevel8,
110: TwoSegmentFourWordsLevel10_0_3,
111: TwoSegmentFourWordsLevel10_1_3,
112: TwoSegmentFourWordsLevel10_0_2,
120: FourWordsLevel8,
140: SixWordsRowLevel12,
160: FourWordsLevel12,
@@ -6931,7 +6887,7 @@ class LevelSite extends WordRotatorBaseSite {
return this.nextLevel();
}
startEndSite(){
startEndSite() {
this.startSite(EndSite);
this.finish();
}
@@ -6944,7 +6900,7 @@ class LevelSite extends WordRotatorBaseSite {
const db = await WordRotatorDb.getInstance();
const nextLevelJson = await db.loadNextLevel(LevelSite.RENDERER_TYPES);
console.log("nextLevelJson", nextLevelJson);
console.log("nextLevelJson", nextLevelJson);
if (nextLevelJson === null) {
this.startEndSite();
return;
@@ -7174,7 +7130,7 @@ class LevelSite extends WordRotatorBaseSite {
break;
}
default:{
default: {
this._siteContent.classList.remove("tutorial");
}
}
@@ -7204,7 +7160,7 @@ class LevelSite extends WordRotatorBaseSite {
scaleHelper.scaleToFull(textElem, textElem.parentElement, null, true, 1, 2);
break;
}
default:{
default: {
this._siteContent.classList.remove("tutorial");
}
}
@@ -7244,14 +7200,15 @@ class LevelSite extends WordRotatorBaseSite {
break;
}
default:{
default: {
this._siteContent.classList.remove("tutorial");
}
}
}
}
}
LevelSite.RENDERER_TYPES = [20, 40, 60, 80, 81, 82, 83, 100, 120, 140, 160];
LevelSite.RENDERER_TYPES = [20, 40, 60, 80, 81, 82, 83, 100, 110, 111, 112, 120, 140, 160];
LevelSite.TUTORIAL = {
FIRST_LEVEL: 67,
SECOND_LEVEL: 15,