X-Git-Url: http://deadsoftware.ru/gitweb?p=cavedroid.git;a=blobdiff_plain;f=core%2Fsrc%2Fru%2Fdeadsoftware%2Fcavecraft%2Fgame%2Fobjects%2FBlock.java;h=5d2814e7f0e1c26603c763390989819237c26685;hp=44619f0654f3c9e2a22adbee85e66e28037962ba;hb=0b8922bfbb2bbec067b532ecb7912f6afe02c4ef;hpb=1cc111dfe31e7f7098e01afeaa025e19f91aa624 diff --git a/core/src/ru/deadsoftware/cavecraft/game/objects/Block.java b/core/src/ru/deadsoftware/cavecraft/game/objects/Block.java index 44619f0..5d2814e 100644 --- a/core/src/ru/deadsoftware/cavecraft/game/objects/Block.java +++ b/core/src/ru/deadsoftware/cavecraft/game/objects/Block.java @@ -1,29 +1,31 @@ package ru.deadsoftware.cavecraft.game.objects; -import com.badlogic.gdx.graphics.g2d.TextureRegion; import com.badlogic.gdx.math.Rectangle; public class Block { private int x,y,w,h; private int texture; + private int hp, drop; public boolean collision, background, transparent; - public Block(int texture) { - this(0,0,16,16,texture, true, false, false); + public Block(int texture, int hp, int drop) { + this(0,0,16,16,texture, hp, drop, true, false, false); } - public Block(int texture, boolean collision, boolean background, boolean transparent) { - this(0,0,16,16,texture, collision, background, transparent); + public Block(int texture, int hp, int drop, boolean collision, boolean background, boolean transparent) { + this(0,0,16,16,texture, hp, drop, collision, background, transparent); } - public Block(int x, int y, int w, int h, int texture, boolean collision, boolean background, boolean transparent) { + public Block(int x, int y, int w, int h, int texture, int hp, int drop, boolean collision, boolean background, boolean transparent) { this.x = x; this.y = y; this.w = w; this.h = h; this.texture = texture; + this.hp = hp; + this.drop = drop; this.collision = collision; this.background = background; this.transparent = transparent; @@ -33,6 +35,14 @@ public class Block { return texture; } + public int getHp() { + return hp; + } + + public int getDrop() { + return drop; + } + public Rectangle getRect(int x, int y) { x*=16; y*=16;