1b: add constructor with 3 params
This commit is contained in:
parent
7d3f773365
commit
7a9956fb63
@ -11,9 +11,12 @@ package fr.enssat.BoulderDash.models.displayableElement;
|
||||
*/
|
||||
public class BoulderModel extends DisplayableElementModel {
|
||||
BoulderModel(boolean convertible) {
|
||||
super(false, true, "boulder",
|
||||
2, false, true,
|
||||
false, "die", convertible);
|
||||
this.loadSprite("boulder");
|
||||
super("boulder", false,true);
|
||||
setPriority(2);
|
||||
setAnimate(true);
|
||||
setCollideSound("die");
|
||||
setConvertibleValue(convertible);
|
||||
|
||||
loadSprite("boulder");
|
||||
}
|
||||
}
|
@ -11,9 +11,10 @@ package fr.enssat.BoulderDash.models.displayableElement;
|
||||
*/
|
||||
public class BrickWallModel extends DisplayableElementModel {
|
||||
BrickWallModel() {
|
||||
super(true, false, "brickwall",
|
||||
3, false, false,
|
||||
false, "touch");
|
||||
this.loadSprite("brickwall");
|
||||
super("brickwall", true, false);
|
||||
setPriority(3);
|
||||
setCollideSound("touch");
|
||||
|
||||
loadSprite("brickwall");
|
||||
}
|
||||
}
|
||||
|
@ -23,9 +23,9 @@ public class DiamondModel extends DisplayableElementModel {
|
||||
private ArrayList<BufferedImage> framesDiamond;
|
||||
|
||||
DiamondModel() {
|
||||
super(true, true, "diamond",
|
||||
0, false, true,
|
||||
false, "coin");
|
||||
super("diamond", true, true);
|
||||
setAnimate(true);
|
||||
setCollideSound("coin");
|
||||
|
||||
this.initSprites();
|
||||
}
|
||||
|
@ -11,9 +11,7 @@ package fr.enssat.BoulderDash.models.displayableElement;
|
||||
*/
|
||||
public class DirtModel extends DisplayableElementModel {
|
||||
DirtModel() {
|
||||
super(true, false,
|
||||
"dirt", 0, false,
|
||||
false, false, null);
|
||||
super("dirt", true, false);
|
||||
|
||||
this.loadSprite("dirt");
|
||||
}
|
||||
|
@ -52,20 +52,22 @@ public abstract class DisplayableElementModel {
|
||||
this.collideSound = collideSound;
|
||||
}
|
||||
|
||||
public DisplayableElementModel(boolean destructible, boolean moving, String spriteName, int priority, boolean impactExplosive, boolean animate, boolean falling, String collideSound) {
|
||||
this(
|
||||
destructible, moving, spriteName,
|
||||
private DisplayableElementModel(boolean destructible, boolean moving, String spriteName,
|
||||
int priority, boolean impactExplosive, boolean animate,
|
||||
boolean falling, String collideSound) {
|
||||
this(destructible, moving, spriteName,
|
||||
priority, impactExplosive, animate,
|
||||
falling, collideSound, false
|
||||
);
|
||||
falling, collideSound, false);
|
||||
}
|
||||
|
||||
public DisplayableElementModel(final String spriteName){
|
||||
this(
|
||||
false, false, spriteName,
|
||||
public DisplayableElementModel(final String spriteName, boolean destructible, boolean moving){
|
||||
this(destructible, moving, spriteName,
|
||||
0, false, false,
|
||||
false, null
|
||||
);
|
||||
false, null);
|
||||
}
|
||||
|
||||
public DisplayableElementModel(final String spriteName){
|
||||
this(spriteName, false, false);
|
||||
}
|
||||
|
||||
public static BoulderModel newBoulderModel(boolean convertible) {
|
||||
|
@ -11,9 +11,9 @@ package fr.enssat.BoulderDash.models.displayableElement;
|
||||
*/
|
||||
public class ExpandingWallModel extends DisplayableElementModel {
|
||||
ExpandingWallModel() {
|
||||
super(false, false, "expandingwall",
|
||||
10, false, false,
|
||||
false, null);
|
||||
super("expandingwall");
|
||||
setPriority(10);
|
||||
|
||||
this.loadSprite("expandingwall");
|
||||
}
|
||||
}
|
@ -24,9 +24,10 @@ public class MagicWallModel extends DisplayableElementModel {
|
||||
private long speed;
|
||||
|
||||
MagicWallModel() {
|
||||
super(false, false, "magicwall",
|
||||
3, false, false,
|
||||
false, "touch");
|
||||
super("magicwall");
|
||||
setPriority(3);
|
||||
setCollideSound("touch");
|
||||
|
||||
this.currentFrame = 0;
|
||||
this.speed = 100;
|
||||
this.initSprites();
|
||||
|
@ -47,9 +47,11 @@ public class RockfordModel extends DisplayableElementModel {
|
||||
private boolean hasExploded;
|
||||
|
||||
RockfordModel() {
|
||||
super(true, true, "rockford",
|
||||
1, true, true,
|
||||
false, null);
|
||||
super("rockford", true, true);
|
||||
setPriority(1);
|
||||
setImpactExplosive(true);
|
||||
setAnimate(true);
|
||||
|
||||
// Speed of the animation of the sprite
|
||||
this.setSpeed(100);
|
||||
// Init the sprites in arrays
|
||||
|
@ -11,9 +11,10 @@ package fr.enssat.BoulderDash.models.displayableElement;
|
||||
*/
|
||||
public class SteelWallModel extends DisplayableElementModel {
|
||||
SteelWallModel() {
|
||||
super(false, false, "steelwall",
|
||||
3, false, false,
|
||||
false, "touch");
|
||||
super("steelwall");
|
||||
setPriority(3);
|
||||
setCollideSound("touch");
|
||||
|
||||
this.loadSprite("steelwall");
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user