|
|
@ -1,23 +1,19 @@
|
|
|
|
package com.last.commit.map
|
|
|
|
package com.last.commit.map
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import GameState
|
|
|
|
import com.badlogic.gdx.Gdx
|
|
|
|
import com.badlogic.gdx.Gdx
|
|
|
|
import com.badlogic.gdx.graphics.OrthographicCamera
|
|
|
|
import com.badlogic.gdx.graphics.OrthographicCamera
|
|
|
|
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
|
|
|
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
|
|
|
import com.badlogic.gdx.maps.objects.RectangleMapObject
|
|
|
|
|
|
|
|
import com.badlogic.gdx.maps.tiled.TiledMap
|
|
|
|
import com.badlogic.gdx.maps.tiled.TiledMap
|
|
|
|
import com.badlogic.gdx.maps.tiled.TiledMapTileLayer
|
|
|
|
|
|
|
|
import com.badlogic.gdx.maps.tiled.TmxMapLoader
|
|
|
|
import com.badlogic.gdx.maps.tiled.TmxMapLoader
|
|
|
|
import com.badlogic.gdx.maps.tiled.renderers.OrthogonalTiledMapRenderer
|
|
|
|
import com.badlogic.gdx.maps.tiled.renderers.OrthogonalTiledMapRenderer
|
|
|
|
import com.badlogic.gdx.math.Rectangle
|
|
|
|
import com.badlogic.gdx.math.Rectangle
|
|
|
|
import com.badlogic.gdx.math.Vector2
|
|
|
|
import com.badlogic.gdx.math.Vector2
|
|
|
|
import com.badlogic.gdx.utils.Array
|
|
|
|
|
|
|
|
import com.badlogic.gdx.scenes.scene2d.ui.Image
|
|
|
|
import com.badlogic.gdx.scenes.scene2d.ui.Image
|
|
|
|
import com.last.commit.Collidable
|
|
|
|
import com.last.commit.Collidable
|
|
|
|
import com.last.commit.Player
|
|
|
|
import com.last.commit.Player
|
|
|
|
import com.last.commit.Wall
|
|
|
|
|
|
|
|
import com.last.commit.audio.GameSoundEffect
|
|
|
|
import com.last.commit.audio.GameSoundEffect
|
|
|
|
import com.last.commit.inventory.InventoryItemTextureLoader
|
|
|
|
import com.last.commit.inventory.InventoryItemTextureLoader
|
|
|
|
import GameState
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class TimeMap(fileName: String, val state: GameState) {
|
|
|
|
class TimeMap(fileName: String, val state: GameState) {
|
|
|
@ -120,7 +116,6 @@ class TimeMap(fileName: String, val state: GameState) {
|
|
|
|
fun interactWith(x: Float, y: Float, blockingCollider: Rectangle) {
|
|
|
|
fun interactWith(x: Float, y: Float, blockingCollider: Rectangle) {
|
|
|
|
val gridX = x.toInt() / CELL_SIZE
|
|
|
|
val gridX = x.toInt() / CELL_SIZE
|
|
|
|
val gridY = y.toInt() / CELL_SIZE
|
|
|
|
val gridY = y.toInt() / CELL_SIZE
|
|
|
|
println("Interacting with element at $gridX:$gridY")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//if no door is found return
|
|
|
|
//if no door is found return
|
|
|
|
val interactable: Interactable = this.findInteractableAtPosition(gridX, gridY) ?: return
|
|
|
|
val interactable: Interactable = this.findInteractableAtPosition(gridX, gridY) ?: return
|
|
|
|