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