mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-11 11:04:05 +09:00
WIP removing fluid marker block
see "work_files/todo_platforms.png"
This commit is contained in:
@@ -42,7 +42,22 @@ open class FixtureBase(val blockBox: BlockBox) :
|
||||
}
|
||||
}
|
||||
|
||||
data class BlockBox(val collisionType: Int, val width: Int, val height: Int) {
|
||||
data class BlockBox(var collisionType: Int, var width: Int, var height: Int) {
|
||||
|
||||
fun redefine(collisionType: Int, width: Int, height: Int) {
|
||||
redefine(collisionType)
|
||||
redefine(width, height)
|
||||
}
|
||||
|
||||
fun redefine(width: Int, height: Int) {
|
||||
this.width = width
|
||||
this.height = height
|
||||
}
|
||||
|
||||
fun redefine(collisionType: Int) {
|
||||
this.collisionType = collisionType
|
||||
}
|
||||
|
||||
companion object {
|
||||
const val NO_COLLISION = Block.ACTORBLOCK_NO_COLLISION
|
||||
const val FULL_COLLISION = Block.ACTORBLOCK_FULL_COLLISION
|
||||
|
||||
@@ -4,13 +4,15 @@ import com.badlogic.gdx.graphics.Pixmap
|
||||
import com.badlogic.gdx.graphics.Texture
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import net.torvald.terrarum.Terrarum
|
||||
import net.torvald.terrarum.gameworld.GameWorld
|
||||
import net.torvald.terrarum.ceilInt
|
||||
import net.torvald.terrarumsansbitmap.gdx.TextureRegionPack
|
||||
|
||||
/**
|
||||
* Created by minjaesong on 2017-01-07.
|
||||
*/
|
||||
class TapestryObject(pixmap: Pixmap, val artName: String, val artAuthor: String) : FixtureBase(physics = false) {
|
||||
class TapestryObject(pixmap: Pixmap, val artName: String, val artAuthor: String) :
|
||||
FixtureBase(BlockBox(BlockBox.NO_COLLISION, 1, 1)) // placeholder blockbox
|
||||
{
|
||||
|
||||
// physics = false only speeds up for ~2 frames with 50 tapestries
|
||||
|
||||
@@ -24,6 +26,9 @@ class TapestryObject(pixmap: Pixmap, val artName: String, val artAuthor: String)
|
||||
setHitboxDimension(texture.width, texture.height, 0, 0)
|
||||
setPosition(Terrarum.mouseX, Terrarum.mouseY)
|
||||
// you CAN'T destroy the image
|
||||
|
||||
// redefine blockbox
|
||||
blockBox.redefine(texture.width.div(TILE_SIZEF).ceilInt(), texture.height.div(TILE_SIZEF).ceilInt())
|
||||
}
|
||||
|
||||
override fun update(delta: Float) {
|
||||
|
||||
Reference in New Issue
Block a user