diff --git a/core/src/ru/deadsoftware/cavecraft/game/objects/Block.java b/core/src/ru/deadsoftware/cavecraft/game/objects/Block.java
index 839e383bfd48f63045ceaf21b29767eb65312aa1..58714852ea514847d09c29bc68a7e913b2f99b55 100644 (file)
private int tex;
private int hp, drop;
- public boolean coll, bg, tp;
+ //coll - collision, bg - background, tp - transparent, rb - requires block under it
+ private boolean coll, bg, tp, rb;
public Block(int tex, int hp, int drop) {
- this(0, 0, 16, 16, tex, hp, drop, true, false, false);
+ this(0, 0, 16, 16, tex, hp, drop, true, false, false, false);
}
public Block(int tex, int hp, int drop, boolean coll, boolean bg, boolean tp) {
- this(0, 0, 16, 16, tex, hp, drop, coll, bg, tp);
+ this(0, 0, 16, 16, tex, hp, drop, coll, bg, tp, false);
+ }
+
+ public Block(int tex, int hp, int drop, boolean coll, boolean bg, boolean tp, boolean rb) {
+ this(0, 0, 16, 16, tex, hp, drop, coll, bg, tp, rb);
}
public Block(int x, int y, int w, int h, int tex, int hp, int drop, boolean coll, boolean bg, boolean tp) {
+ this(x, y, w, h, tex, hp, drop, coll, bg, tp, false);
+ }
+
+ public Block(int x, int y, int w, int h, int tex, int hp, int drop, boolean coll, boolean bg, boolean tp, boolean rb) {
this.x = x;
this.y = y;
this.w = w;
this.coll = coll;
this.bg = bg;
this.tp = tp;
+ this.rb = rb;
+ }
+
+ public boolean hasCollision() {
+ return coll;
+ }
+
+ public boolean isBackground() {
+ return bg;
+ }
+
+ public boolean isTransparent() {
+ return tp;
+ }
+
+ public boolean requiresBlock() {
+ return rb;
}
public int getTex() {