General libGdx question (stuttering, "blurring" trouble)

so i tried to re-make everything without using delta, and the result still the same :clue:
this is the new class (am not using the Screen class anymore, the other are the same ) :

and you can download the Jar file from here


package com.me.mygdxgame;

import com.badlogic.gdx.ApplicationListener;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Input.Keys;
import com.badlogic.gdx.graphics.GL10;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.Texture.TextureFilter;
import com.badlogic.gdx.graphics.g2d.Sprite;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;

import com.me.mygdxgame.entities.Player;

public class MyGdxGame implements ApplicationListener {

	private SpriteBatch batch;

	private boolean leftPressed, rightPressed, upPressed, downPressed;
	private Texture heroTexture;
	private Sprite heroSprite;
	private float xSpeed, ySpeed, xDirection, yDirection;
	private Player player;

	@Override
	public void create() {
		player = new Player(100, 100, 16, 16);

		heroTexture = new Texture("data/heroRight.png");
		heroTexture.setFilter(TextureFilter.Linear, TextureFilter.Linear);
		heroSprite = new Sprite(heroTexture);

		batch = new SpriteBatch();

		xSpeed = 10;
		ySpeed = 10;
	}

	@Override
	public void dispose() {

	}

	@Override
	public void render() {
		Gdx.gl.glClearColor(0.2f, 0.2f, 0.3f, 1);
		Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT);

		control();
		player.update(xDirection, yDirection);

		heroSprite.setColor(1, 1, 1, 1);

		heroSprite.setX(player.getX());
		heroSprite.setY(player.getY());

		batch.begin();
		heroSprite.draw(batch);
		batch.end();
	}

	@Override
	public void resize(int width, int height) {
	}

	@Override
	public void pause() {
	}

	@Override
	public void resume() {
	}

	private void control() {

		leftPressed = Gdx.input.isKeyPressed(Keys.DPAD_LEFT);

		rightPressed = Gdx.input.isKeyPressed(Keys.DPAD_RIGHT);

		upPressed = Gdx.input.isKeyPressed(Keys.DPAD_UP);

		downPressed = Gdx.input.isKeyPressed(Keys.DPAD_DOWN);

		if (rightPressed) {
			xDirection = xSpeed;
		} else if (leftPressed) {
			xDirection = -xSpeed;
		} else {
			xDirection = 0;
		}

		if (upPressed) {
			yDirection = ySpeed;
		} else if (downPressed) {
			yDirection = -ySpeed;
		} else {
			yDirection = 0;
		}

	}
}


thank you

Not flickering for me at all :frowning: :clue:

move the player from left to right or up and down like 10 times. you will see the stuttering.
these are typical delta symptoms

ah yes please say stuttering or jitter… flicking is more like things disappearing and reappearing (like the ghosts in atari 2600 version pacman ;DD)

yes exactly, but also, even when this doesn’t happened, i guess in matheus23 case, didn’t you notice some kind of blurring ??
like the player have the Flash effect (the super hero) it REALLY hurt my eyes, do you have that please ??
beside, any suggestion to fix the problem :stuck_out_tongue: cause am not using delta anymore
please if you have any solution try to apply it here
it the project folder

thank you very much

looks fine. Try Gdx.graphics.setVSync(true); for good measure

overall dont worry about it now… if you just have one object that moves the effect is very enhanced
the more stuff you have going on in the game, the less this effect appears to be an issue

so just code away for now

Hm. If by blurring you mean a totally normal occurring white ‘ghost image’ of the player behind the player, because the monitor (or your eyes) aren’t perfect? Yeah. Then yes. Probably :slight_smile:

YES !! THAT :clue:
should i pass a test ::slight_smile: ??
Off Topic :
i’ve been playing videos games since the age of 5, addicted to it since 8 or 9 (i play at least 5 hours per day) and the last 4 years 90% of my time at home is in front of my computer screen, and i don’t feel like i have any trouble with my eyes, my mother always want me to make a test but am afraid of wearing glasses, i HATE them >:( !!

If we both mean and see the same thing, then I already explained the reason in your other thread. It won’t be smooth with the given movement speed.

EDIT: Oops, this is the thread ;D

The ghosting here is perfectly normal dude.
Play a black and white pong game even on your nice monitor and you get some ghosting.
Dont worry :stuck_out_tongue:

okay folks :slight_smile:
thank’s a lot :smiley: