mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-18 22:44:04 +09:00
Former-commit-id: 0e240de4ca38a59724f364df4624c8dc79c0112d Former-commit-id: b017b24ab7591ea2fd2518308bd5656597c14f47
45 lines
1.3 KiB
Kotlin
45 lines
1.3 KiB
Kotlin
package net.torvald.terrarum.gameactors
|
|
|
|
import net.torvald.terrarum.Terrarum
|
|
import net.torvald.terrarum.mapdrawer.MapDrawer.TILE_SIZE
|
|
import net.torvald.terrarum.mapgenerator.RoguelikeRandomiser
|
|
import org.newdawn.slick.Color
|
|
import org.newdawn.slick.GameContainer
|
|
import org.newdawn.slick.Graphics
|
|
|
|
/**
|
|
* Created by minjaesong on 16-03-05.
|
|
*/
|
|
class PhysTestBall : ActorWithBody() {
|
|
|
|
private var color = Color.orange
|
|
|
|
init {
|
|
setHitboxDimension(16, 16, 0, 0)
|
|
mass = 10.0
|
|
density = 200.0
|
|
|
|
color = RoguelikeRandomiser.composeColourFrom(RoguelikeRandomiser.POTION_PRIMARY_COLSET)
|
|
}
|
|
|
|
override fun drawBody(gc: GameContainer, g: Graphics) {
|
|
g.color = color
|
|
g.fillOval(
|
|
hitbox.posX.toFloat(),
|
|
hitbox.posY.toFloat(),
|
|
hitbox.width.toFloat(),
|
|
hitbox.height.toFloat())
|
|
|
|
g.fillOval(
|
|
hitbox.posX.toFloat() + Terrarum.ingame.world.width * TILE_SIZE,
|
|
hitbox.posY.toFloat(),
|
|
hitbox.width.toFloat(),
|
|
hitbox.height.toFloat())
|
|
|
|
g.fillOval(
|
|
hitbox.posX.toFloat() - Terrarum.ingame.world.width * TILE_SIZE,
|
|
hitbox.posY.toFloat(),
|
|
hitbox.width.toFloat(),
|
|
hitbox.height.toFloat())
|
|
}
|
|
} |