main
trivernis 2 years ago
parent 451b202775
commit d977560644
Signed by: Trivernis
GPG Key ID: DFFFCC2C7A02DB45

@ -1,16 +1,15 @@
package com.last.commit.map
import GameState
import Position
import com.badlogic.gdx.math.Rectangle
import com.badlogic.gdx.math.Vector2
import com.last.commit.audio.GameSoundEffect
import com.last.commit.inventory.InventoryItem
class Collectible(
name: String,
val pos: Position,
width: Float,
height: Float,
val size: Vector2,
val requiredItem: String
) : Interactable {

@ -75,8 +75,10 @@ class MapState(val map: TiledMap) {
return if (obj is RectangleMapObject) {
val itemName: String? = obj.properties.get("item", String::class.java)
val requiredItem = obj.properties.get("requiredItem", String::class.java) ?: ""
if (itemName != null) {
Collectible(itemName, Position(coords, gridCoords), size)
Collectible(itemName, Position(coords, gridCoords), size, requiredItem)
} else {
null
}

Loading…
Cancel
Save