1 package ru
.deadsoftware
.cavecraft
.game
.objects
;
3 import com
.badlogic
.gdx
.math
.Rectangle
;
4 import com
.badlogic
.gdx
.math
.Vector2
;
6 import java
.io
.Serializable
;
8 public class Drop
implements Serializable
{
10 public boolean pickedUp
= false;
11 public Vector2 move
, pos
;
13 public Drop(float x
, float y
, int id
) {
15 pos
= new Vector2(x
, y
);
16 move
= new Vector2(0, -1);
19 public void pickUpDrop(Player pl
) {
20 for (int i
= 0; i
< pl
.inv
.length
; i
++) {
21 if (pl
.inv
[i
] == 0 || pl
.inv
[i
] == id
) {
33 public Rectangle
getRect() {
34 return new Rectangle(pos
.x
, pos
.y
, 8, 8);