Skip to content

Commit

Permalink
reduce min delta-time to avoid weird physic behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
Quillraven committed Mar 26, 2024
1 parent 36d9bf2 commit 25abce6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class Quillyjumper : KtxGame<KtxScreen>() {

override fun render() {
clearScreen(0f, 0f, 0f, 1f)
currentScreen.render(Gdx.graphics.deltaTime.coerceAtMost(0.25f))
currentScreen.render(Gdx.graphics.deltaTime.coerceAtMost(MIN_DELTA_TIME))
audioService.update()
}

Expand All @@ -63,6 +63,7 @@ class Quillyjumper : KtxGame<KtxScreen>() {

companion object {
private val log = logger<Quillyjumper>()
private const val MIN_DELTA_TIME = 1 / 30f
const val UNIT_SCALE = 1 / 16f // 16 pixels == 1 meter in Box2D
val GRAVITY = vec2(0f, -30f)
val OBJECT_FIXTURES = mutableMapOf<GameObject, List<FixtureDefUserData>>()
Expand Down
14 changes: 7 additions & 7 deletions tiled-project.tiled-session
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
"height": 4300,
"width": 2
},
"activeFile": "assets/maps/test.tmx",
"activeFile": "assets/maps/objects.tsx",
"expandedProjectPaths": [
".",
"assets",
"assets/maps",
"lwjgl3/build"
".",
"lwjgl3/build",
"assets/maps"
],
"fileStates": {
"": {
Expand Down Expand Up @@ -49,8 +49,8 @@
"scale": 3,
"selectedLayer": 2,
"viewCenter": {
"x": 230.83333333333331,
"y": 72.49999999999999
"x": 230.33333333333331,
"y": 72.16666666666666
}
}
},
Expand All @@ -71,8 +71,8 @@
"property.type": "bool",
"recentFiles": [
"assets/maps/objects.tmx",
"assets/maps/objects.tsx",
"assets/maps/test.tmx",
"assets/maps/objects.tsx",
"assets/maps/terrain.tsx",
"assets/maps/terrain_extruded.tsx"
],
Expand Down

0 comments on commit 25abce6

Please sign in to comment.