DEADSOFTWARE

8d27235a4fc941f87309855bf6c85e6e09538ed9
[cavedroid.git] / core / src / ru / deadsoftware / cavecraft / game / objects / Block.java
1 package ru.deadsoftware.cavecraft.game.objects;
3 import com.badlogic.gdx.math.Rectangle;
5 public class Block {
7 private int x, y, w, h;
8 private int tex;
9 private int hp, drop;
11 public boolean coll, bg, tp, rb;
13 public Block(int tex, int hp, int drop) {
14 this(0, 0, 16, 16, tex, hp, drop, true, false, false, false);
15 }
17 public Block(int tex, int hp, int drop, boolean coll, boolean bg, boolean tp) {
18 this(0, 0, 16, 16, tex, hp, drop, coll, bg, tp, false);
19 }
21 public Block(int tex, int hp, int drop, boolean coll, boolean bg, boolean tp, boolean rb) {
22 this(0, 0, 16, 16, tex, hp, drop, coll, bg, tp, rb);
23 }
25 public Block(int x, int y, int w, int h, int tex, int hp, int drop, boolean coll, boolean bg, boolean tp) {
26 this(x, y, w, h, tex, hp, drop, coll, bg, tp, false);
27 }
29 public Block(int x, int y, int w, int h, int tex, int hp, int drop, boolean coll, boolean bg, boolean tp, boolean rb) {
30 this.x = x;
31 this.y = y;
32 this.w = w;
33 this.h = h;
34 this.tex = tex;
35 this.hp = hp;
36 this.drop = drop;
37 this.coll = coll;
38 this.bg = bg;
39 this.tp = tp;
40 this.rb = rb;
41 }
43 public int getTex() {
44 return tex;
45 }
47 public int getHp() {
48 return hp;
49 }
51 public int getDrop() {
52 return drop;
53 }
55 public Rectangle getRect(int x, int y) {
56 x *= 16;
57 y *= 16;
58 return new Rectangle(x + this.x, y + this.y, w, h);
59 }
61 public boolean toJump() {
62 return (y < 8 && coll);
63 }
65 }