added "lightBox" to the interface Luminous; determines which area of the actor is luminous, and modified lightmapRenderer code accordingly

Former-commit-id: d7d9c33977b0fa2fd505cd070cf1cb6da0bdc0db
Former-commit-id: cf7c96f2ff891e07622ac0657811ea9de2cbd7c5
This commit is contained in:
Song Minjae
2016-06-20 13:14:41 +09:00
parent e926dd84db
commit e62f8feda5
15 changed files with 122 additions and 49 deletions

View File

@@ -17,7 +17,7 @@ import java.util.*
* Created by minjaesong on 16-03-14.
*/
class Player : ActorWithBody, Controllable, Pocketed, Factionable, Luminous, LandHolder {
class Player : ActorWithBody(), Controllable, Pocketed, Factionable, Luminous, LandHolder {
/**
* empirical value.
@@ -71,6 +71,8 @@ class Player : ActorWithBody, Controllable, Pocketed, Factionable, Luminous, Lan
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.
companion object {
@Transient internal const val ACCEL_MULT_IN_FLIGHT: Double = 0.21 // TODO air control still too 'slippery' with 0.31, lower the value!
@@ -87,20 +89,19 @@ class Player : ActorWithBody, Controllable, Pocketed, Factionable, Luminous, Lan
* @throws SlickException
*/
@Throws(SlickException::class)
constructor() : super() {
init {
isVisible = true
referenceID = PLAYER_REF_ID
referenceID = PLAYER_REF_ID // forcibly set ID
super.setDensity(BASE_DENSITY)
}
override fun update(gc: GameContainer, delta_t: Int) {
override fun update(gc: GameContainer, delta: Int) {
if (vehicleRiding is Player)
throw RuntimeException("Attempted to 'ride' " + "player object.")
super.update(gc, delta_t)
super.update(gc, delta)
updateSprite(delta_t)
updateSprite(delta)
updateMovementControl()