mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-11 14:21:52 +09:00
the new sprite fully assembled
This commit is contained in:
@@ -284,7 +284,7 @@ class SpriteAssemblerPreview: Game() {
|
||||
|
||||
batch.inUse {
|
||||
batch.color = Color.WHITE
|
||||
batch.draw(renderTexture, 0f, 0f)
|
||||
batch.draw(renderTexture, 0f, 0f, renderTexture.width * 2f, renderTexture.height * 2f)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -310,9 +310,9 @@ class SpriteAssemblerPreview: Game() {
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
val appConfig = LwjglApplicationConfiguration()
|
||||
appConfig.resizable = true
|
||||
appConfig.resizable = false
|
||||
appConfig.width = 512
|
||||
appConfig.height = 512
|
||||
appConfig.height = 1024
|
||||
appConfig.foregroundFPS = 5
|
||||
appConfig.backgroundFPS = 5
|
||||
|
||||
|
||||
@@ -289,7 +289,8 @@ open class TerrarumIngame(batch: SpriteBatch) : IngameInstance(batch) {
|
||||
/** Load rest of the game with GL context */
|
||||
fun postInit() {
|
||||
//setTheRealGamerFirstTime(PlayerBuilderSigrid())
|
||||
setTheRealGamerFirstTime(PlayerBuilderTestSubject1())
|
||||
//setTheRealGamerFirstTime(PlayerBuilderTestSubject1())
|
||||
setTheRealGamerFirstTime(PlayerBuilderWerebeastTest())
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
package net.torvald.terrarum.modulebasegame.gameactors
|
||||
|
||||
import net.torvald.spriteanimation.SpriteAnimation
|
||||
import net.torvald.terrarum.ModMgr
|
||||
import net.torvald.terrarum.gameactors.AVKey
|
||||
import net.torvald.terrarum.worlddrawer.CreateTileAtlas
|
||||
|
||||
/**
|
||||
* Created by minjaesong on 2021-07-07.
|
||||
*/
|
||||
object PlayerBuilderWerebeastTest {
|
||||
operator fun invoke(): IngamePlayer {
|
||||
val p: IngamePlayer = IngamePlayer(
|
||||
ModMgr.getPath("basegame", "sprites/taimu.properties"),
|
||||
ModMgr.getPath("basegame", "sprites/taimu_glow.properties"),
|
||||
-589141658L // random value thrown
|
||||
)
|
||||
//InjectCreatureRaw(p.actorValue, "basegame", "CreatureHuman.json")
|
||||
|
||||
p.actorValue[AVKey.SCALE] = 1.0
|
||||
p.actorValue[AVKey.SPEED] = 6.0
|
||||
p.actorValue[AVKey.SPEEDBUFF] = 1.0
|
||||
p.actorValue[AVKey.ACCEL] = ActorHumanoid.WALK_ACCEL_BASE
|
||||
p.actorValue[AVKey.ACCELBUFF] = 1.0
|
||||
p.actorValue[AVKey.JUMPPOWER] = 19.0
|
||||
|
||||
p.actorValue[AVKey.BASEMASS] = 599.16
|
||||
p.actorValue[AVKey.SCALEBUFF] = 1.0 // Constant 1.0 for player, meant to be used by random mobs
|
||||
p.actorValue[AVKey.STRENGTH] = 5000
|
||||
p.actorValue[AVKey.ENCUMBRANCE] = 10000
|
||||
p.actorValue[AVKey.BASEHEIGHT] = 90
|
||||
|
||||
p.actorValue[AVKey.INTELLIGENT] = true
|
||||
|
||||
p.actorValue[AVKey.__PLAYER_QUICKSLOTSEL] = 0
|
||||
p.actorValue[AVKey.__ACTION_TIMER] = 0.0
|
||||
p.actorValue[AVKey.ACTION_INTERVAL] = ActorHumanoid.BASE_ACTION_INTERVAL
|
||||
p.actorValue[AVKey.NAME] = "Test Subject 1"
|
||||
|
||||
|
||||
/*p.makeNewSprite(TextureRegionPack(ModMgr.getGdxFile("basegame", "sprites/npc_template_anim_prototype.tga"), 48, 52))
|
||||
p.sprite!!.delays = floatArrayOf(2f, 1f/12f) // second value does nothing -- overridden by ActorHumanoid.updateSprite(float)
|
||||
p.sprite!!.setRowsAndFrames(2, 4)*/
|
||||
|
||||
p.sprite = SpriteAnimation(p)
|
||||
//p.spriteGlow = SpriteAnimation(p)
|
||||
p.reassembleSprite(p.sprite!!, p.spriteGlow)
|
||||
p.setHitboxDimension(28, p.actorValue.getAsInt(AVKey.BASEHEIGHT) ?: ActorHumanoid.BASE_HEIGHT, 24, 0)
|
||||
|
||||
p.setPosition(3.0 * CreateTileAtlas.TILE_SIZE, 3.0 * CreateTileAtlas.TILE_SIZE)
|
||||
|
||||
|
||||
PlayerBuilderSigrid.fillTestInventory(p.inventory)
|
||||
|
||||
//p.actorValue[AVKey.LUMR] = 0.84
|
||||
//p.actorValue[AVKey.LUMG] = 0.93
|
||||
//p.actorValue[AVKey.LUMB] = 1.37
|
||||
//p.actorValue[AVKey.LUMA] = 1.93
|
||||
|
||||
p.actorValue[AVKey.AIRJUMPPOINT] = 0
|
||||
p.actorValue[AVKey.SCALE] = 1.0
|
||||
|
||||
return p
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user