mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-17 14:04:05 +09:00
multiple lightboxes for luminous actors
Former-commit-id: 7ee7d962a9da07d6b1a7936ee19a7458f390bbbc Former-commit-id: c5c83ec33ecaade54a73bcc211318ecd4a473182
This commit is contained in:
@@ -3,6 +3,7 @@ package net.torvald.terrarum.gameactors
|
||||
import net.torvald.spriteanimation.SpriteAnimation
|
||||
import net.torvald.terrarum.tileproperties.TileNameCode
|
||||
import net.torvald.terrarum.tileproperties.TilePropCodex
|
||||
import java.util.*
|
||||
|
||||
/**
|
||||
* Created by minjaesong on 16-06-17.
|
||||
@@ -14,7 +15,7 @@ class FixturesTikiTorch : FixturesBase(), Luminous {
|
||||
set(value) {
|
||||
throw UnsupportedOperationException()
|
||||
}
|
||||
override val lightBox: Hitbox = Hitbox(3.0, 0.0, 4.0, 3.0)
|
||||
override val lightBoxList: ArrayList<Hitbox>
|
||||
|
||||
init {
|
||||
isVisible = true
|
||||
@@ -22,6 +23,9 @@ class FixturesTikiTorch : FixturesBase(), Luminous {
|
||||
|
||||
setHitboxDimension(10, 24, 0, 0)
|
||||
|
||||
lightBoxList = ArrayList(1)
|
||||
lightBoxList.add(Hitbox(3.0, 0.0, 4.0, 3.0))
|
||||
|
||||
sprite = SpriteAnimation()
|
||||
sprite!!.setDimension(10, 27)
|
||||
sprite!!.setSpriteImage("res/graphics/sprites/fixtures/tiki_torch.png")
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package net.torvald.terrarum.gameactors
|
||||
|
||||
import java.util.*
|
||||
|
||||
/**
|
||||
* Created by minjaesong on 16-03-14.
|
||||
*/
|
||||
@@ -20,6 +22,7 @@ interface Luminous {
|
||||
* Arguments:
|
||||
*
|
||||
* Hitbox(x-offset, y-offset, width, height)
|
||||
* (Use ArrayList for normal circumstances)
|
||||
*/
|
||||
val lightBox: Hitbox
|
||||
val lightBoxList: List<Hitbox>
|
||||
}
|
||||
@@ -71,8 +71,8 @@ class Player : ActorWithBody(), Controllable, Pocketed, Factionable, Luminous, L
|
||||
set(value) {
|
||||
actorValue[AVKey.LUMINOSITY] = value
|
||||
}
|
||||
override val lightBox: Hitbox
|
||||
get() = Hitbox(0.0, 0.0, hitbox.width, hitbox.height) // use getter; dimension of the player may change by time.
|
||||
override val lightBoxList: List<Hitbox>
|
||||
get() = arrayOf(Hitbox(0.0, 0.0, hitbox.width, hitbox.height)).toList() // use getter; dimension of the player may change by time.
|
||||
|
||||
companion object {
|
||||
@Transient internal const val ACCEL_MULT_IN_FLIGHT: Double = 0.21
|
||||
|
||||
Reference in New Issue
Block a user