gt: 		if (this.acceleration.x < 0) {
context: package com.game.mario.sprite.tileobject.mario;
  
  import java.util.ArrayList;
  import java.util.List;
  
  import com.badlogic.gdx.graphics.OrthographicCamera;
  import com.badlogic.gdx.graphics.Texture;
  import com.badlogic.gdx.graphics.g2d.Animation;
  import com.badlogic.gdx.graphics.g2d.Batch;
  import com.badlogic.gdx.graphics.g2d.SpriteBatch;
  import com.badlogic.gdx.graphics.g2d.TextureRegion;
  import com.badlogic.gdx.maps.MapObject;
  import com.badlogic.gdx.math.Vector2;
  import com.badlogic.gdx.utils.Array;
  import com.game.mario.GameManager;
  import com.game.mario.background.IScrollingBackground;
  import com.game.mario.background.impl.LeftScrollingBackground;
  import com.game.mario.camera.GameCamera;
  import com.game.mario.collision.tilemap.MarioTilemapCollisionHandler;
  import com.game.mario.enums.DirectionEnum;
  import com.game.mario.enums.SpriteMoveEnum;
  import com.game.mario.sound.SoundManager;
  import com.game.mario.sprite.AbstractSprite;
  import com.game.mario.sprite.Fireball;
  import com.game.mario.sprite.tileobject.AbstractTileObjectSprite;
  import com.game.mario.sprite.tileobject.item.TransferItem;
  import com.game.mario.tilemap.TmxMap;
  import com.game.mario.util.ResourcesLoader;
  import com.game.mario.util.animation.AnimationBuilder;
  
  /**
   * sizeState values : 0=small, 1=big, 2=flowered
   * 
   * 
   *
   */
  public class Mario extends AbstractTileObjectSprite {
  			
  	/** Offset contants */
  	private static final float X_OFFSET = 0.05f;
  	
  	private static final float Y_OFFSET = 0.1f;
  	
  	private static final float ACCELERATION_MAX = 5f; // 7.5f;
  
  	private static final float ACCELERATION_MAX_SPEEDUP = 8.5f;
  
  	private static final float DECELERATION_COEF = 0.2f;
  
  	private static final float ACCELERATION_COEF = 0.2f;
  
  	private static final float ACCELERATION_COEF_SPEEDUP = 0.2f;
  
  	/** Animations tables : each state of Mario */
  	private Animation animations[][];
  
  	private Animation marioRunRightAnimation;
  
  	private Animation marioRunLeftAnimation;
  
  	private Animation marioSlideRightAnimation;
  
  	private Animation marioSlideLeftAnimation;
  
  	private Animation marioJumpLeftAnimation;
  
  	private Animation marioJumpRightAnimation;
  
  	private Animation marioDeathAnimation;
  
  	private Animation marioGrowDownRightAnimation;
  
  	private Animation marioGrowDownLeftAnimation;
  
  	private Animation marioGrowUpRightAnimation;
  
  	private Animation marioGrowUpLeftAnimation;
  
  	private Animation marioFlagRightAnimation;
  
  	private Animation marioFlagLeftAnimation;
  
  	private Animation marioVictoryAnimation;
  	
  	private Animation marioStandRightAnimation;
  	
  	private Animation marioStandLeftAnimation;
  	
  	private Animation marioCrouchRightAnimation;
  	
  	private Animation marioCrouchLeftAnimation;
  
  	private SpriteMoveEnum previousState;
  
  	private int jumpTimer;
  
  	private boolean canInitiateJump;
  
  	private boolean canJumpHigher;
  
  	private boolean invincible;
  
  	private float invincibleDuration;
  	
  	private float invincibleDurationTarget;
  	
  	private boolean owningStar;
  
  	private float deathNoMoveDuration;
  
  	private boolean growingUp;
  
  	private boolean growingDown;
  
  	private boolean inTransfer;
  
  	private TransferItem transferItem;
  
  	private List<Fireball> fireballs;	
  	
  	private boolean isStuck;
  	
  	private boolean isCrouch;
  
  	public Mario(MapObject mapObject) {
  		super(mapObject, new Vector2(X_OFFSET, Y_OFFSET));
  		onFloor = true;
  		canInitiateJump = true;
  		canJumpHigher = true;
  		gravitating = true;
  		direction = DirectionEnum.RIGHT;
  		state = SpriteMoveEnum.NO_MOVE;
  		previousState = SpriteMoveEnum.NO_MOVE;
  		sizeState = GameManager.getGameManager().getSizeState();
  		changeSizeState(sizeState);
  		alive = true;
  		fireballs = new ArrayList<Fireball>();	
  		tilemapCollisionHandler = new MarioTilemapCollisionHandler();
  	}
  
  	public void changeSizeState(int i) {
  		sizeState = i;
  		if (i <= 1) {
  			setSize(1 - 2*offset.x, 1 - offset.y);
  			setRenderingSize(1, 1);
  			bounds.setWidth(1 - 2*offset.x);
  			bounds.setHeight(1 - offset.y);
  		} else {
  			setSize(1 - 2*offset.x, 2 - offset.y);
  			setRenderingSize(1, 2);
  			bounds.setWidth(1 - 2*offset.x);
  			bounds.setHeight(2 - offset.y);
  		}		
  		updateBounds();		
  		refreshAnimations();
  	}
  	
  	
  
  	@Override
  	public void initializeAnimations() {
  		
  		animations = new Animation[5][14];
  		initializeAnimation(ResourcesLoader.MARIO_SMALL, 0);
  		initializeAnimation(ResourcesLoader.MARIO_BIG, 2);
  		initializeAnimation(ResourcesLoader.MARIO_FLOWER, 3);		
  		initGrowingAnimations();		
  		initStarAnimations();
  	}
  
  	private void initializeAnimation(Texture texture, int i) {
  
  		TextureRegion[][] tmp = TextureRegion.split(texture, texture.getWidth() / (i<=1 ? 14 :16), texture.getHeight());
  			
  		animations[i] = new Animation[14];
  		animations[i][0] = AnimationBuilder.getInstance().build(tmp, 0, 3, 0.05f);
  		animations[i][1] = AnimationBuilder.getInstance().build(tmp, 5, 3, 0.05f);
  		animations[i][2] = AnimationBuilder.getInstance().build(tmp, 9, 1, 1);
  		animations[i][3] = AnimationBuilder.getInstance().build(tmp, 4, 1, 1);
  		animations[i][4] = AnimationBuilder.getInstance().build(tmp, 3, 1, 1);
  		animations[i][5] = AnimationBuilder.getInstance().build(tmp, 8, 1, 1);
  		animations[i][6] = AnimationBuilder.getInstance().build(tmp, 10, 1, 1);
  		animations[i][7] = AnimationBuilder.getInstance().build(tmp, 11, 1, 1);
  		animations[i][8] = AnimationBuilder.getInstance().build(tmp, 12, 1, 1);
  		animations[i][9] = AnimationBuilder.getInstance().build(tmp, 13, 1, 1);
  		if (i>0) {
  			// Crouch animation if Mario is big
  			animations[i][10] = AnimationBuilder.getInstance().build(tmp, 14, 1, 1);
  			animations[i][11] = AnimationBuilder.getInstance().build(tmp, 15, 1, 1);
  		}
  		animations[i][12] = null;
  		animations[i][13] = null;
  
  	}
  	
  	private void initGrowingAnimations() {
  		Texture growDownRightTexture = ResourcesLoader.MARIO_GROW_UP_RIGHT;
  		TextureRegion[][] tmp = TextureRegion.split(growDownRightTexture, growDownRightTexture.getWidth() / 3, growDownRightTexture.getHeight());		
  		marioGrowUpRightAnimation = AnimationBuilder.getInstance().build(tmp, 0, 2, 0.15f);
  		marioGrowDownRightAnimation = AnimationBuilder.getInstance().buildReversed(tmp, 1, 2, 0.15f);
  		
  		Texture growDownLeftTexture = ResourcesLoader.MARIO_GROW_UP_LEFT;
  		tmp = TextureRegion.split(growDownLeftTexture, growDownLeftTexture.getWidth() / 3, growDownLeftTexture.getHeight());
  		marioGrowUpLeftAnimation = AnimationBuilder.getInstance().build(tmp, 0, 2, 0.15f);
  		marioGrowDownLeftAnimation = AnimationBuilder.getInstance().buildReversed(tmp, 1, 2, 0.15f);
  	}
  	
  	private void initStarAnimations() {
  				
  		animations[1] = new Animation[14];
  		animations[1][0] = AnimationBuilder.getInstance().build(ResourcesLoader.MARIO_SMALL_STAR_RUN_RIGHT, 0, 24, 0.025f);
  		animations[1][1] = AnimationBuilder.getInstance().build(ResourcesLoader.MARIO_SMALL_STAR_RUN_LEFT, 0, 24, 0.025f);
  		animations[1][2] = AnimationBuilder.getInstance().build(ResourcesLoader.MARIO_SMALL_STAR_SLIDE_RIGHT, 0, 4, 0.025f);
  		animations[1][3] = AnimationBuilder.getInstance().build(ResourcesLoader.MARIO_SMALL_STAR_SLIDE_LEFT, 0, 4, 0.025f);
  		animations[1][4] = AnimationBuilder.getInstance().build(ResourcesLoader.MARIO_SMALL_STAR_JUMP_RIGHT, 0, 4, 0.025f);
  		animations[1][5] = AnimationBuilder.getInstance().build(ResourcesLoader.MARIO_SMALL_STAR_JUMP_LEFT, 0, 4, 0.025f);		
  		animations[1][7] = animations[0][7];
  		animations[1][8] = animations[0][8];
  		animations[1][9] = AnimationBuilder.getInstance().build(ResourcesLoader.MARIO_SMALL_STAR_VICTORY, 0, 4, 0.025f);;
  		animations[1][10] = null;
  		animations[1][11] = null;
  		animations[1][12] = AnimationBuilder.getInstance().build(ResourcesLoader.MARIO_SMALL_STAR_STAND_RIGHT, 0, 4, 0.025f);
  		animations[1][13] = AnimationBuilder.getInstance().build(ResourcesLoader.MARIO_SMALL_STAR_STAND_LEFT, 0, 4, 0.025f);
  		
  		animations[4] = new Animation[14];
  		animations[4][0] = AnimationBuilder.getInstance().build(ResourcesLoader.MARIO_BIG_STAR_RUN_RIGHT, 0, 24, 0.025f);
  		animations[4][1] = AnimationBuilder.getInstance().build(ResourcesLoader.MARIO_BIG_STAR_RUN_LEFT, 0, 24, 0.025f);
  		animations[4][2] = AnimationBuilder.getInstance().build(ResourcesLoader.MARIO_BIG_STAR_SLIDE_RIGHT, 0, 4, 0.025f);
  		animations[4][3] = AnimationBuilder.getInstance().build(ResourcesLoader.MARIO_BIG_STAR_SLIDE_LEFT, 0, 4, 0.025f);
  		animations[4][4] = AnimationBuilder.getInstance().build(ResourcesLoader.MARIO_BIG_STAR_JUMP_RIGHT, 0, 4, 0.025f);
  		animations[4][5] = AnimationBuilder.getInstance().build(ResourcesLoader.MARIO_BIG_STAR_JUMP_LEFT, 0, 4, 0.025f);		
  		animations[4][7] = animations[0][7];
  		animations[4][8] = animations[0][8];
  		animations[4][9] = AnimationBuilder.getInstance().build(ResourcesLoader.MARIO_BIG_STAR_VICTORY, 0, 4, 0.025f);;
  		animations[4][10] = AnimationBuilder.getInstance().build(ResourcesLoader.MARIO_BIG_STAR_CROUCH_RIGHT, 0, 4, 0.025f);
  		animations[4][11] = AnimationBuilder.getInstance().build(ResourcesLoader.MARIO_BIG_STAR_CROUCH_LEFT, 0, 4, 0.025f);
  		animations[4][12] = AnimationBuilder.getInstance().build(ResourcesLoader.MARIO_BIG_STAR_STAND_RIGHT, 0, 4, 0.025f);
  		animations[4][13] = AnimationBuilder.getInstance().build(ResourcesLoader.MARIO_BIG_STAR_STAND_LEFT, 0, 4, 0.025f);
  	}
  	
  	public void refreshAnimations() {		
  		int animationIdx = owningStar ? sizeState == 0 ? 1 : 4 : sizeState;
  		marioRunRightAnimation = animations[animationIdx][0];
  		marioRunLeftAnimation = animations[animationIdx][1];
  		marioSlideRightAnimation = animations[animationIdx][2];
  		marioSlideLeftAnimation = animations[animationIdx][3];
  		marioJumpRightAnimation = animations[animationIdx][4];
  		marioJumpLeftAnimation = animations[animationIdx][5];
  		marioDeathAnimation = animations[animationIdx][6];
  		marioFlagRightAnimation = animations[animationIdx][7];
  		marioFlagLeftAnimation = animations[animationIdx][8];
  		marioVictoryAnimation = animations[animationIdx][9];
  		marioCrouchRightAnimation = animations[animationIdx][10];
  		marioCrouchLeftAnimation = animations[animationIdx][11];		
  		marioStandRightAnimation = animations[animationIdx][12];
  		marioStandLeftAnimation = animations[animationIdx][13];
  	}
  
  	public void accelerate(boolean accelerationKeyHold) {
  		if (this.acceleration.x < (accelerationKeyHold ? ACCELERATION_MAX_SPEEDUP : ACCELERATION_MAX)) {
  			this.acceleration.x = this.acceleration.x
  					+ (accelerationKeyHold ? ACCELERATION_COEF_SPEEDUP : ACCELERATION_COEF);
  		}
  
  		if (accelerationKeyHold == false && this.acceleration.x > ACCELERATION_MAX) {
  			this.acceleration.x = ACCELERATION_MAX;
  		}
  	}
  
  	public void decelerate(float rate) {
  		if (this.acceleration.x > 0) {
  			this.acceleration.x = this.acceleration.x - DECELERATION_COEF * rate;
  		}
  