application-amicale/screens/Tetris/Shapes/ShapeJ.js

44 lines
800 B
JavaScript
Raw Normal View History

2020-03-23 11:32:50 +01:00
// @flow
import BaseShape from "./BaseShape";
export default class ShapeJ extends BaseShape {
#colors: Object;
constructor(colors: Object) {
super();
this.position.x = 3;
this.#colors = colors;
}
getColor(): string {
return this.#colors.tetrisJ;
}
getShapes() {
return [
[
[1, 0, 0],
[1, 1, 1],
[0, 0, 0],
],
[
[0, 1, 1],
[0, 1, 0],
[0, 1, 0],
],
[
[0, 0, 0],
[1, 1, 1],
[0, 0, 1],
],
[
[0, 1, 0],
[0, 1, 0],
[1, 1, 0],
],
];
}
}