Player movement seems like back to working, res→assets

Former-commit-id: f91181caee4dabf4cb2e51d8077441c6b0f83757
Former-commit-id: 8b450303698c5c85dea9145a056b290b95a6a7b0
This commit is contained in:
Song Minjae
2016-08-02 17:32:42 +09:00
parent 5e7a95a3b9
commit 17c39c1824
248 changed files with 371 additions and 104 deletions

View File

@@ -79,7 +79,7 @@ class Player : ActorWithBody(), Controllable, Pocketed, Factionable, Luminous, L
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.
var gamepad: Controller? = Controllers.getController(0)
var gamepad: Controller? = null
var axisX = 0f
var axisY = 0f
var axisRX = 0f
@@ -105,6 +105,13 @@ class Player : ActorWithBody(), Controllable, Pocketed, Factionable, Luminous, L
referenceID = PLAYER_REF_ID // forcibly set ID
density = BASE_DENSITY
collisionType = KINEMATIC
try {
gamepad = Controllers.getController(0)
}
catch (e: IndexOutOfBoundsException) {
println("[Player] gamepad not detected.")
}
}
override fun update(gc: GameContainer, delta: Int) {