import ru.deadsoftware.cavedroid.game.GameItemsHolder
import ru.deadsoftware.cavedroid.game.model.item.Item
-class Drop(
+class Drop @JvmOverloads constructor(
x: Float,
y: Float,
_item: Item,
+ val amount: Int = 1,
) : Rectangle(x, y, DROP_SIZE, DROP_SIZE) {
val itemKey = _item.params.key
val velocity = getInitialVelocity()
var pickedUp = false
+ @Suppress("UNNECESSARY_LATEINIT")
@Transient
lateinit var item: Item
private set
}
companion object {
- private const val MAGNET_DISTANCE = 16f
+ private const val MAGNET_DISTANCE = 8f
- const val MAGNET_VELOCITY = 128f
+ const val MAGNET_VELOCITY = 256f
const val DROP_SIZE = 8f
private fun getInitialVelocity(): Vector2 = Vector2(0f, -1f)