1 package ru
.deadsoftware
.cavecraft
.game
.objects
;
3 import com
.badlogic
.gdx
.math
.Rectangle
;
7 private int x
, y
, w
, h
;
11 public boolean collision
, background
, transparent
;
13 public Block(int texture
, int hp
, int drop
) {
14 this(0, 0, 16, 16, texture
, hp
, drop
, true, false, false);
17 public Block(int texture
, int hp
, int drop
, boolean collision
, boolean background
, boolean transparent
) {
18 this(0, 0, 16, 16, texture
, hp
, drop
, collision
, background
, transparent
);
21 public Block(int x
, int y
, int w
, int h
, int texture
, int hp
, int drop
, boolean collision
, boolean background
, boolean transparent
) {
26 this.texture
= texture
;
29 this.collision
= collision
;
30 this.background
= background
;
31 this.transparent
= transparent
;
34 public int getTexture() {
42 public int getDrop() {
46 public Rectangle
getRect(int x
, int y
) {
49 return new Rectangle(x
+ this.x
, y
+ this.y
, w
, h
);
52 public boolean toJump() {
53 return (y
< 8 && collision
);