1 package ru
.deadsoftware
.cavedroid
.game
.objects
;
3 import com
.badlogic
.gdx
.graphics
.g2d
.Sprite
;
4 import com
.badlogic
.gdx
.math
.Rectangle
;
8 private int x
, y
, w
, h
;
10 private String drop
, meta
;
13 //coll - collision, bg - background, tp - transparent, rb - requires block under it
14 private boolean coll
, bg
, tp
, rb
, fluid
;
16 public Block(int left
, int top
, int right
, int bottom
, int hp
,
17 String drop
, boolean coll
, boolean bg
, boolean tp
, boolean rb
, boolean fluid
, String meta
, Sprite tex
) {
20 this.w
= 16 - right
- left
;
21 this.h
= 16 - top
- bottom
;
31 if (this.tex
!= null) this.tex
.flip(false, true);
34 public boolean hasCollision() {
38 public boolean isBackground() {
42 public boolean isTransparent() {
46 public boolean requiresBlock() {
54 public String
getDrop() {
58 public boolean hasDrop() {
59 return !drop
.equals("none");
62 public Sprite
getTex() {
66 public Rectangle
getRect(int x
, int y
) {
69 return new Rectangle(x
+ this.x
, y
+ this.y
, w
, h
);
72 public boolean isFluid() {
76 public String
getMeta() {
80 public boolean toJump() {
81 return (y
< 8 && coll
);