world portal wip

This commit is contained in:
minjaesong
2023-05-28 18:41:21 +09:00
parent a3ecd4a4f4
commit ef6f39632d
11 changed files with 121 additions and 33 deletions

View File

@@ -0,0 +1,40 @@
package net.torvald.terrarum.modulebasegame.gameactors
import net.torvald.terrarum.gameactors.AVKey
import net.torvald.terrarum.langpack.Lang
import net.torvald.terrarum.modulebasegame.gameitems.FixtureItemBase
import net.torvald.terrarum.modulebasegame.ui.UIWorldPortal
import net.torvald.terrarumsansbitmap.gdx.TextureRegionPack
/**
* Created by minjaesong on 2023-05-28.
*/
class FixtureWorldPortal : FixtureBase {
constructor() : super(
BlockBox(BlockBox.NO_COLLISION, 5, 2),
nameFun = { Lang["ITEM_WORLD_PORTAL"] },
mainUI = UIWorldPortal()
) {
// TODO do something with (mainUI as UIWorldPortal).***
}
init {
val itemImage = FixtureItemBase.getItemImageFromSheet("basegame", "sprites/fixtures/portal_device.tga", 80, 32)
density = 2900.0
setHitboxDimension(80, 32, 0, 0)
makeNewSprite(TextureRegionPack(itemImage.texture, 80, 32)).let {
it.setRowsAndFrames(1,1)
}
actorValue[AVKey.BASEMASS] = FixtureLogicSignalEmitter.MASS
}
override fun reload() {
super.reload()
// TODO do something with (mainUI as UIWorldPortal).***
}
}

View File

@@ -98,6 +98,8 @@ object PlayerBuilderSigrid {
inventory.add("item@basegame:258", 995) // doors
inventory.add("item@basegame:259", 995) // doors
inventory.add("item@basegame:320", 1) // portal
WireCodex.getAll().forEach {
try {
inventory.add(it.id, 9995)