Adding Pieces positions

This commit is contained in:
Debucquoy
2023-03-21 14:14:39 +01:00
parent 4854fef677
commit 24df4e376c
4 changed files with 83 additions and 2 deletions

View File

@ -9,6 +9,7 @@ package school_project;
public class Piece extends Shape{
private Vec2 Position;
private Map linked_map;
public Piece() {
super();
@ -22,7 +23,21 @@ public class Piece extends Shape{
return Position;
}
public void getPo
public void setPosition(Vec2 position){
if (linked_map == null) {
return;
}
this.Position = position;
}
/**
* set the map the piece is into the the map argument
* @param map map where to place the piece
*/
public void setLinked_map(Map map){
this.linked_map = map;
}
/**
* Rotate the matrix of the piece. Used when the player right click