LibGDX, here I am.

This commit is contained in:
minjaesong
2017-06-22 02:31:07 +09:00
parent ae00e2b8a6
commit 8e5e95e5a9
356 changed files with 3125 additions and 21138 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 123 B

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -5,7 +5,7 @@
import net.torvald.point.Point2d
import net.torvald.terrarum.Terrarum
import net.torvald.terrarum.TerrarumGDX
import net.torvald.terrarum.gameactors.AVKey
import net.torvald.terrarum.gameactors.ActorWithPhysics
import net.torvald.terrarum.itemproperties.Calculate
@@ -14,7 +14,6 @@ import net.torvald.terrarum.itemproperties.Material
import net.torvald.terrarum.blockproperties.Block
// following two are NOT UNUSED!
import org.jetbrains.annotations.NotNull
import org.newdawn.slick.GameContainer
@@ -56,42 +55,42 @@ class TestPick extends GameItem {
}
@Override
boolean primaryUse(@NotNull GameContainer gc, int delta) {
int mouseTileX = Terrarum.getMouseTileX()
int mouseTileY = Terrarum.getMouseTileY()
boolean primaryUse(float delta) {
int mouseTileX = TerrarumGdx.getMouseTileX()
int mouseTileY = TerrarumGdx.getMouseTileY()
def mousePoint = new Point2d(mouseTileX, mouseTileY)
def actorvalue = Terrarum.ingame.player.actorValue
def actorvalue = TerrarumGDX.ingame.player.actorValue
using = true
// linear search filter (check for intersection with tilewise mouse point and tilewise hitbox)
// return false if hitting actors
Terrarum.ingame.actorContainer.forEach({
TerrarumGDX.ingame.actorContainer.forEach({
if (it instanceof ActorWithPhysics && it.tilewiseHitbox.intersects(mousePoint))
return false
})
// return false if here's no tile
if (Block.AIR == Terrarum.ingame.world.getTileFromTerrain(mouseTileX, mouseTileY))
if (Block.AIR == TerrarumGDX.ingame.world.getTileFromTerrain(mouseTileX, mouseTileY))
return false
// filter passed, do the job
double swingDmgToFrameDmg = delta.toDouble() / actorvalue.getAsDouble(AVKey.ACTION_INTERVAL)
Terrarum.ingame.world.inflictTerrainDamage(
TerrarumGDX.ingame.world.inflictTerrainDamage(
mouseTileX, mouseTileY,
Calculate.pickaxePower(Terrarum.ingame.player, material) * swingDmgToFrameDmg
Calculate.pickaxePower(TerrarumGDX.ingame.player, material) * swingDmgToFrameDmg
)
return true
}
@Override
boolean endPrimaryUse(@NotNull GameContainer gc, int delta) {
boolean endPrimaryUse(float delta) {
using = false
// reset action timer to zero
Terrarum.ingame.player.actorValue.set(AVKey.__ACTION_TIMER, 0.0)
TerrarumGDX.ingame.player.actorValue.set(AVKey.__ACTION_TIMER, 0.0)
return true
}
}

View File

@@ -1,3 +1,12 @@
## Note to modders
- You DON'T just edit built-in modules; you must make your own module even if you want to replace defaults.
### To devs
- make that happen :\
## Register modules
Only the modules that enlisted in LoadOrder.csv will be loaded.