Jump to content
  • Advertisement
Sign in to follow this  
JarbaGames

Libgdx camera movement issue

This topic is 1059 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello I am a game developer and have stumbled across a problem which for some reason is being incredibly difficult for me. Basically I am using LibGDX and TiledMap, when staying on the same coordinate the map looks perfect / sharp, but when I move there's a blur. Am I missing something? Please take a look at this video, specifically to the bed.

 

 

This is how I am currently moving players

 

public void processMovement() {
if (keyDirections[0] > 0) {
if (!collisionLayer.getCell((int)camera.position.x / 64, ((int)camera.position.y + 20 + speed) / 64).getTile().getProperties().containsKey("blocked")) {
client.gameY = (int) camera.position.y;
}
}
if (keyDirections[1] > 0) {
if (!collisionLayer.getCell(((int)camera.position.x + 20 + speed) / 64, ((int)camera.position.y) / 64).getTile().getProperties().containsKey("blocked")) {
camera.translate(10,0);
client.gameX = (int) camera.position.x;
}
}
if (keyDirections[2] > 0) {
if (collisionLayer.getCell(((int)camera.position.x - 20 - speed) / 64, ((int)camera.position.y) / 64) != null)
if (!collisionLayer.getCell(((int)camera.position.x - 20 - speed) / 64, ((int)camera.position.y) / 64).getTile().getProperties().containsKey("blocked")) {
camera.translate(-10,0);
client.gameX = (int) camera.position.x;
}
}
if (keyDirections[3] > 0) {
if (!collisionLayer.getCell((int)camera.position.x / 64, ((int)camera.position.y - 20 - speed) / 64).getTile().getProperties().containsKey("blocked")) {
camera.translate(0,-10);
client.gameY = (int) camera.position.y;
}
}
}

Share this post


Link to post
Share on other sites
Advertisement

I'm trying my hardest to find the blur... but I'm not seeing anything. I rewatched it 10 times. Even slowly advanced the video at HD full screen by milliseconds. I'm not seeing anything.

The most I can tell is that the movement from the background is a bit jarring but that's a whole different thing all together.

Edited by Tangletail

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!