fix stuff

imgbot
MehdiAyadi 1 year ago
parent 0707dd9077
commit 8175149540

@ -16,7 +16,6 @@ class GameSettings {
actionKeys[ActionCommand.LEFT] = listOf(Keys.LEFT, Keys.A)
actionKeys[ActionCommand.RIGHT] = listOf(Keys.RIGHT, Keys.D)
actionKeys[ActionCommand.OPEN_MENU] = listOf(Keys.ESCAPE)
actionKeys[ActionCommand.OPEN_INVENTORY] = listOf(Keys.I)
actionKeys[ActionCommand.TIME_TRAVEL] = listOf(Keys.T)
actionKeys[ActionCommand.INTERACT] = listOf(Keys.E)

@ -155,7 +155,9 @@ class TimeMap(fileName: String, val state: GameState) {
if (mapObject is RectangleMapObject) {
val itemName = mapObjectProperties.get("item", String::class.java)
this.collectibles.add(Collectible(itemName, Position(x, y, gridX, gridY), width, height))
itemName?. let {
this.collectibles.add(Collectible(itemName, Position(x, y, gridX, gridY), width, height))
}
} else {
println("Found non-rectangular map object at ${x}-${y} skipping it")
}

Loading…
Cancel
Save