mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-12 03:24:06 +09:00
added a typewriter (no gui)
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
package net.torvald.terrarum.modulebasegame.gameactors
|
||||
|
||||
import net.torvald.terrarum.gameactors.AVKey
|
||||
import net.torvald.terrarum.langpack.Lang
|
||||
|
||||
/**
|
||||
* Created by minjaesong on 2022-08-26.
|
||||
*/
|
||||
class FixtureTypewriter : FixtureBase {
|
||||
|
||||
var typewriterKeymapName = "us_qwerty" // used to control the keyboard input behaviour
|
||||
private set
|
||||
|
||||
private var carriagePosition = 0
|
||||
|
||||
// constructor used when new typewriter is created
|
||||
constructor(keymapName: String) : this() {
|
||||
typewriterKeymapName = keymapName
|
||||
}
|
||||
|
||||
// constructor used when the game loads from the savefile
|
||||
constructor() : super(
|
||||
BlockBox(BlockBox.NO_COLLISION, 1, 1),
|
||||
nameFun = { Lang["ITEM_TYPEWRITER"] }
|
||||
) {
|
||||
|
||||
density = 2000.0
|
||||
|
||||
setHitboxDimension(16, 16, 8, 0)
|
||||
|
||||
makeNewSprite(FixtureBase.getSpritesheet("basegame", "sprites/fixtures/typewriter.tga", 32, 16)).let {
|
||||
it.setRowsAndFrames(1,1)
|
||||
}
|
||||
|
||||
actorValue[AVKey.BASEMASS] = 3.6
|
||||
}
|
||||
|
||||
companion object {
|
||||
const val TYPEWRITER_COLUMNS = 64
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package net.torvald.terrarum.modulebasegame.gameitems
|
||||
|
||||
import com.badlogic.gdx.graphics.g2d.TextureRegion
|
||||
import net.torvald.terrarum.gameitems.ItemID
|
||||
import net.torvald.terrarum.itemproperties.Material
|
||||
import net.torvald.terrarum.modulebasegame.gameactors.FixtureTikiTorch
|
||||
|
||||
/**
|
||||
* Created by minjaesong on 2022-08-26.
|
||||
*/
|
||||
class ItemTypewriter(originalID: ItemID) : FixtureItemBase(originalID, "net.torvald.terrarum.modulebasegame.gameactors.FixtureTypewriter") {
|
||||
|
||||
override var dynamicID: ItemID = originalID
|
||||
override val originalName = "ITEM_TYPEWRITER"
|
||||
override var baseMass = FixtureTikiTorch.MASS
|
||||
override var stackable = true
|
||||
override var inventoryCategory = Category.MISC
|
||||
override val isUnique = false
|
||||
override val isDynamic = false
|
||||
override val material = Material()
|
||||
override val itemImage: TextureRegion
|
||||
get() = getItemImageFromSheet("basegame", "sprites/fixtures/typewriter.tga", 32, 16)
|
||||
|
||||
override var baseToolSize: Double? = baseMass
|
||||
|
||||
init {
|
||||
equipPosition = EquipPosition.HAND_GRIP
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user