1 package ru
.deadsoftware
.cavedroid
.game
.objects
;
3 import com
.badlogic
.gdx
.math
.Rectangle
;
7 private int x
, y
, w
, h
;
11 //coll - collision, bg - background, tp - transparent, rb - requires block under it
12 private boolean coll
, bg
, tp
, rb
;
14 public Block(int tex
, int hp
, int drop
) {
15 this(0, 0, 16, 16, tex
, hp
, drop
, true, false, false, false);
18 public Block(int tex
, int hp
, int drop
, boolean coll
, boolean bg
, boolean tp
) {
19 this(0, 0, 16, 16, tex
, hp
, drop
, coll
, bg
, tp
, false);
22 public Block(int tex
, int hp
, int drop
, boolean coll
, boolean bg
, boolean tp
, boolean rb
) {
23 this(0, 0, 16, 16, tex
, hp
, drop
, coll
, bg
, tp
, rb
);
26 public Block(int x
, int y
, int w
, int h
, int tex
, int hp
, int drop
, boolean coll
, boolean bg
, boolean tp
) {
27 this(x
, y
, w
, h
, tex
, hp
, drop
, coll
, bg
, tp
, false);
30 public Block(int x
, int y
, int w
, int h
, int tex
, int hp
, int drop
, boolean coll
, boolean bg
, boolean tp
, boolean rb
) {
44 public boolean hasCollision() {
48 public boolean isBackground() {
52 public boolean isTransparent() {
56 public boolean requiresBlock() {
68 public int getDrop() {
72 public Rectangle
getRect(int x
, int y
) {
75 return new Rectangle(x
+ this.x
, y
+ this.y
, w
, h
);
78 public boolean toJump() {
79 return (y
< 8 && coll
);