(x1: number, x2: number)
| 452 | } |
| 453 | |
| 454 | private handlePatterns(x1: number, x2: number): void{ |
| 455 | // If the pattern is null or done, we need a new pattern |
| 456 | if(this.currentPattern == null || this.currentPattern.isPatternDone()){ |
| 457 | // If the level is null, we begin with level 0 |
| 458 | if(this.currentPatternLevel == null) |
| 459 | this.currentPatternLevel = new TheSeaPatternLevel_Level0(this); |
| 460 | // Else, if the level is done, we get the next level from it |
| 461 | else if(this.currentPatternLevel.isLevelDone()) |
| 462 | this.currentPatternLevel = this.currentPatternLevel.getNextLevel(); |
| 463 | |
| 464 | // We get the new pattern from the current level |
| 465 | this.currentPattern = this.currentPatternLevel.getPattern(this.distance); |
| 466 | } |
| 467 | |
| 468 | // We run the pattern |
| 469 | this.currentPattern.run(x1, x2); |
| 470 | } |
| 471 | |
| 472 | private moveVertically(): void{ |
| 473 | var upPressed: boolean = Keyboard.isKeyPressed("up"); |
no test coverage detected