forked from Ady1103/rescatandopollos
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Nido.pde
76 lines (62 loc) · 1.4 KB
/
Nido.pde
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
class Nido{
private PImage imgNido;
private int limiteMinX;
private int limiteMaxX;
private int posX;
private int posY;
Nido(){
// Constructor vacio
}
Nido(PImage imgNido, int limiteMinX, int limiteMaxX){
this();
setImgNido(imgNido);
setLimiteMinX(limiteMinX);
setLimiteMaxX(limiteMaxX);
setPosY(height-imgNido.height);
setPosX((getLimiteMaxX() - getLimiteMinX()) / 2);
}
// Getters
public PImage getImgNido(){
return (this.imgNido);
}
public int getLimiteMinX(){
return (this.limiteMinX);
}
public int getLimiteMaxX(){
return (this.limiteMaxX);
}
public int getPosX(){
return (this.posX);
}
public int getPosY(){
return (this.posY);
}
// Setters
public void setImgNido(PImage imgNido){
this.imgNido = imgNido;
}
public void setLimiteMinX(int limiteMinX){
this.limiteMinX = limiteMinX;
}
public void setLimiteMaxX(int limiteMaxX){
this.limiteMaxX = limiteMaxX;
}
public void setPosX(int posX){
this.posX = posX;
}
public void setPosY(int posY){
this.posY = posY;
}
// Medodos adicionales
public void dibujarNido(int posX){
pushMatrix();
setPosX(posX);
image(getImgNido(), getPosX(), getPosY());
popMatrix();
}
public void dibujarNido(){
pushMatrix();
image(getImgNido(), getPosX(), getPosY());
popMatrix();
}
}