You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the code snippet below, it says incompatible types for region where i have marked asterisk, for some reason it only recognises it as java.lang.object.
public TextureRegion getFrame(float dt){
currentState = getState();
TextureRegion region;
switch(currentState){
case JUMPING:
region = marioJump.getKeyFrame(stateTimer); ***********
break;
case RUNNING:
region = marioRun.getKeyFrame(stateTimer, true); ***********
break;
case FALLING:
case STANDING:
default:
region = marioStand;
break;
}
The text was updated successfully, but these errors were encountered:
Make sure that the region in use is from "import com.badlogic.gdx.graphics.g2d.TextureRegion;" and not import com.badlogic.gdx.graphics.Texture;
Also the variables are set as:
private Animation marioRun;
private Animation growMario;
In the code snippet below, it says incompatible types for region where i have marked asterisk, for some reason it only recognises it as java.lang.object.
The text was updated successfully, but these errors were encountered: