parent
796f2bead0
commit
9e6bca542a
@ -0,0 +1,22 @@
|
||||
package com.last.commit.map
|
||||
|
||||
import com.badlogic.gdx.math.Rectangle
|
||||
|
||||
class Collectible(name: String, x: Float, y: Float, 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() {
|
||||
|
||||
}
|
||||
|
||||
override fun getCollider(): Rectangle {
|
||||
return this.collider
|
||||
}
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
package com.last.commit.map
|
||||
|
||||
import com.badlogic.gdx.math.Rectangle
|
||||
|
||||
interface Interactable {
|
||||
fun getCollider(): Rectangle
|
||||
|
||||
fun interact()
|
||||
}
|
@ -1,5 +1,9 @@
|
||||
package com.last.commit.map
|
||||
|
||||
interface Toggleable {
|
||||
interface Toggleable : Interactable {
|
||||
fun toggle()
|
||||
|
||||
override fun interact() {
|
||||
toggle()
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue