diff --git a/lib/kotludens/com/persesgames/math/Matrix4.kt b/lib/kotludens/com/persesgames/math/Matrix4.kt index 8595270..3cb4ed4 100644 --- a/lib/kotludens/com/persesgames/math/Matrix4.kt +++ b/lib/kotludens/com/persesgames/math/Matrix4.kt @@ -78,9 +78,9 @@ matrix[10] = -2f / (far - near) matrix[11] = 0f - matrix[12] = (right + left) / (right - left) - matrix[13] = (top + bottom) / (top - bottom) - matrix[14] = (far + near) / (far - near) + matrix[12] = - (right + left) / (right - left) + matrix[13] = - (top + bottom) / (top - bottom) + matrix[14] = - (far + near) / (far - near) matrix[15] = 1f } diff --git a/lib/kotludens/com/persesgames/math/Matrix4.kt b/lib/kotludens/com/persesgames/math/Matrix4.kt index 8595270..3cb4ed4 100644 --- a/lib/kotludens/com/persesgames/math/Matrix4.kt +++ b/lib/kotludens/com/persesgames/math/Matrix4.kt @@ -78,9 +78,9 @@ matrix[10] = -2f / (far - near) matrix[11] = 0f - matrix[12] = (right + left) / (right - left) - matrix[13] = (top + bottom) / (top - bottom) - matrix[14] = (far + near) / (far - near) + matrix[12] = - (right + left) / (right - left) + matrix[13] = - (top + bottom) / (top - bottom) + matrix[14] = - (far + near) / (far - near) matrix[15] = 1f } diff --git a/lib/kotludens/com/persesgames/texture/Textures.kt b/lib/kotludens/com/persesgames/texture/Textures.kt index 111f08a..db24963 100644 --- a/lib/kotludens/com/persesgames/texture/Textures.kt +++ b/lib/kotludens/com/persesgames/texture/Textures.kt @@ -54,7 +54,7 @@ vec4 scaledBox = vec4(a_boundingBox, 1.0, 1.0) * scale(a_scale) * rotateZ(a_rotation); - gl_Position = u_projectionView * vec4(a_position + scaledBox.xy, -1, 1.0); + gl_Position = u_projectionView * vec4(a_position + scaledBox.xy, 1.0, 1.0); } """ diff --git a/lib/kotludens/com/persesgames/math/Matrix4.kt b/lib/kotludens/com/persesgames/math/Matrix4.kt index 8595270..3cb4ed4 100644 --- a/lib/kotludens/com/persesgames/math/Matrix4.kt +++ b/lib/kotludens/com/persesgames/math/Matrix4.kt @@ -78,9 +78,9 @@ matrix[10] = -2f / (far - near) matrix[11] = 0f - matrix[12] = (right + left) / (right - left) - matrix[13] = (top + bottom) / (top - bottom) - matrix[14] = (far + near) / (far - near) + matrix[12] = - (right + left) / (right - left) + matrix[13] = - (top + bottom) / (top - bottom) + matrix[14] = - (far + near) / (far - near) matrix[15] = 1f } diff --git a/lib/kotludens/com/persesgames/texture/Textures.kt b/lib/kotludens/com/persesgames/texture/Textures.kt index 111f08a..db24963 100644 --- a/lib/kotludens/com/persesgames/texture/Textures.kt +++ b/lib/kotludens/com/persesgames/texture/Textures.kt @@ -54,7 +54,7 @@ vec4 scaledBox = vec4(a_boundingBox, 1.0, 1.0) * scale(a_scale) * rotateZ(a_rotation); - gl_Position = u_projectionView * vec4(a_position + scaledBox.xy, -1, 1.0); + gl_Position = u_projectionView * vec4(a_position + scaledBox.xy, 1.0, 1.0); } """ diff --git a/src/com/persesgames/shooter/Shooter.kt b/src/com/persesgames/shooter/Shooter.kt index 9bb8376..51aaa20 100644 --- a/src/com/persesgames/shooter/Shooter.kt +++ b/src/com/persesgames/shooter/Shooter.kt @@ -66,7 +66,7 @@ val map = TiledMap("maps", "level_1_01.json") var sprites = SpriteBatch() - var x = -2000f + var x = 0f var y = 15500f var sprite = Sprite("SHIP") var numberOfSprites: Int = 5000 @@ -145,13 +145,13 @@ for (index in 0..numberOfSprites) { r = index * 0.05f d = index * 2.13f - x = (Math.sin((time + d).toDouble()) * r).toFloat() - y = (Math.cos((time + d).toDouble()) * r).toFloat() + x = 1000f + (Math.sin((time + d).toDouble()) * r).toFloat() + y = 500f + (Math.cos((time + d).toDouble()) * r).toFloat() sprites.draw(sprite, x.toFloat(), y.toFloat(), scale = 0.4f + Math.sin(time.toDouble() + r).toFloat(), rotation = r * 10f) } - sprites.draw(sprite, -350f, -350f, scale = 4f, rotation = -time) + sprites.draw(sprite, 350f, 350f, scale = 4f, rotation = -time) sprites.render()