[FreeToTake] generated piece should get a random rotation #49

Closed
opened 2023-05-11 12:00:31 +02:00 by tonitch · 7 comments
Owner

Currently the generated piece get no rotation. so the game would be done without ever rotating any pieces

we should just get a random rotation between 0 and 3 to each pieces for some randomness

Currently the generated piece get no rotation. so the game would be done without ever rotating any pieces we should just get a random rotation between 0 and 3 to each pieces for some randomness
Mat_02 self-assigned this 2023-05-16 10:43:12 +02:00
Member

i m on it !

i m on it !
Member

need some help cause i can't use call rotateRight

need some help cause i can't use call rotateRight
Author
Owner

how? you should do myiece.rotateRight(int)

how? you should do `myiece.rotateRight(int)`
Member

boolean[][] turnPiece = shape;
turnPiece.Piece.RotateRight(rand);
ret.addPiece(new Piece(turnPiece));

boolean[][] turnPiece = shape; turnPiece.Piece.RotateRight(rand); ret.addPiece(new Piece(turnPiece));
Member

that's what i'm trying to do

that's what i'm trying to do
Author
Owner

boolean[][] turnPiece = shape;
turnPiece.Piece.RotateRight(rand);
ret.addPiece(new Piece(turnPiece));

turnPiece c'est un boolean[][] il n'y a pas de methode Piece ^^
et surtout je ne pense pas que tu ai besoin de passer par un nouveau boolean[][]

tu dois juste prendre la piece déjà générée, puis faire un RotateRight(rand.nextInt(4));

genre

Piece _piece = new Piece(shape);
_piece.RotateRight(rand.nextInt(4));
ret.addPiece(_piece);
> boolean[][] turnPiece = shape; > turnPiece.Piece.RotateRight(rand); > ret.addPiece(new Piece(turnPiece)); turnPiece c'est un boolean[][] il n'y a pas de methode Piece ^^ et surtout je ne pense pas que tu ai besoin de passer par un nouveau boolean[][] tu dois juste prendre la piece déjà générée, puis faire un RotateRight(rand.nextInt(4)); genre ``` Piece _piece = new Piece(shape); _piece.RotateRight(rand.nextInt(4)); ret.addPiece(_piece); ```
tonitch self-assigned this 2023-05-19 14:51:24 +02:00
Mat_02 was unassigned by tonitch 2023-05-19 14:51:24 +02:00
Author
Owner

#83

#83
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: undefined_name/School_Project#49
No description provided.