Application Android et IOS pour l'amicale des élèves
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ShapeI.js 956B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. // @flow
  2. import BaseShape from "./BaseShape";
  3. export default class ShapeI extends BaseShape {
  4. #colors: Object;
  5. constructor(colors: Object) {
  6. super();
  7. this.position.x = 3;
  8. this.#colors = colors;
  9. }
  10. getColor(): string {
  11. return this.#colors.tetrisI;
  12. }
  13. getShapes() {
  14. return [
  15. [
  16. [0, 0, 0, 0],
  17. [1, 1, 1, 1],
  18. [0, 0, 0, 0],
  19. [0, 0, 0, 0],
  20. ],
  21. [
  22. [0, 0, 1, 0],
  23. [0, 0, 1, 0],
  24. [0, 0, 1, 0],
  25. [0, 0, 1, 0],
  26. ],
  27. [
  28. [0, 0, 0, 0],
  29. [0, 0, 0, 0],
  30. [1, 1, 1, 1],
  31. [0, 0, 0, 0],
  32. ],
  33. [
  34. [0, 1, 0, 0],
  35. [0, 1, 0, 0],
  36. [0, 1, 0, 0],
  37. [0, 1, 0, 0],
  38. ],
  39. ];
  40. }
  41. }