DEADSOFTWARE

Add more blocks
[cavedroid.git] / core / src / ru / deadsoftware / cavecraft / game / objects / Block.java
1 package ru.deadsoftware.cavecraft.game.objects;
3 import com.badlogic.gdx.graphics.g2d.TextureRegion;
4 import com.badlogic.gdx.math.Rectangle;
6 public class Block {
8 private Rectangle rect;
9 private TextureRegion texture;
11 public boolean collision, foreground;
13 public Block(int x, int y, int w, int h, TextureRegion texture) {
14 this(x,y,w,h,texture, true, false);
15 }
17 public Block(int x, int y, int w, int h, TextureRegion texture, boolean collision, boolean foreground) {
18 rect = new Rectangle(x,y,w,h);
19 this.texture = texture;
20 this.collision = collision;
21 this.foreground = foreground;
22 }
24 public TextureRegion getTexture() {
25 return texture;
26 }
28 public Rectangle getRect() {
29 return rect;
30 }
32 public int getX() {
33 return (int)rect.x;
34 }
36 public int getY() {
37 return (int)rect.y;
38 }
40 public int getWidth() {
41 return (int)rect.width;
42 }
44 public int getHeight() {
45 return (int)rect.height;
46 }
47 }