You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
548 B
Kotlin
23 lines
548 B
Kotlin
package com.last.commit.map
|
|
|
|
import com.badlogic.gdx.math.Rectangle
|
|
|
|
class Collectible(name: String, x: Float, y: Float, val gridX: Int, val gridY: Int, width: Float, height: Float) :
|
|
Interactable {
|
|
|
|
val name: String
|
|
private val collider: Rectangle
|
|
|
|
init {
|
|
this.name = name
|
|
this.collider = Rectangle(x, y, width, height)
|
|
}
|
|
|
|
override fun interact(otherCollider: Rectangle) {
|
|
println("Interacting with item $name")
|
|
}
|
|
|
|
override fun getCollider(): Rectangle {
|
|
return this.collider
|
|
}
|
|
} |