1 package ru
.deadsoftware
.cavecraft
.game
.objects
;
3 import com
.badlogic
.gdx
.graphics
.g2d
.TextureRegion
;
4 import com
.badlogic
.gdx
.math
.Rectangle
;
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);
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
;
24 public TextureRegion
getTexture() {
28 public Rectangle
getRect() {
40 public int getWidth() {
41 return (int)rect
.width
;
44 public int getHeight() {
45 return (int)rect
.height
;