Commits

Valerio Riva  committed 1ba878e

composizione livello a tile!

  • Participants
  • Parent commits b94cf0b

Comments (0)

Files changed (31)

File levels/level.txt

-1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 
-1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
-1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
-1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
-1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
-1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
-1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
-1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
-1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
-1 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
-1 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
-1 0 0 0 0 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
-1 0 0 0 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
-1 0 0 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
-1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 
+7 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 9
+4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6
+4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6
+4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6
+4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6
+4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6
+4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6
+4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6
+4 0 0 0 0 0 0 0 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6
+4 0 0 0 0 0 0 5 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6
+4 0 0 0 0 0 5 5 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6
+4 0 0 0 0 5 5 5 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6
+4 0 0 0 5 5 5 5 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6
+4 0 0 5 5 5 5 5 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6
+1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3

File src/ggj/bloodrace/RaceGame.java

 import ggj.bloodrace.entities.HorizontalBottom;
 import ggj.bloodrace.entities.HorizontalTop;
 import ggj.bloodrace.entities.Player;
-import ggj.bloodrace.entities.obstacles.Obstacle;
 import ggj.bloodrace.game.levels.ElementsType;
 import ggj.bloodrace.game.levels.Level;
 import ggj.bloodrace.utils.Constants;
 		//GENERAZIONE DEL LIVELLO
 		
 		for (int i = 0;i<this.getLevel().getElements().size();i++){
-			ArrayList<Integer> row = this.getLevel().getElements().get(i);
+			ArrayList<Character> row = this.getLevel().getElements().get(i);
 			for (int j = 0;j<row.size();j++){
-				Integer element = row.get(j);
-				if (element.equals(0)) continue;
+				Character element = row.get(j);
+				if (element.equals('0')) continue;
 				int posx = Constants.BLOCK_AREA_START_X + j*Constants.BLOCK_SIZE;
 				int posy = Constants.BLOCK_AREA_START_Y+i*Constants.BLOCK_SIZE;
 			

File src/ggj/bloodrace/entities/Player.java

 import java.util.List;
 
 import ggj.bloodrace.entities.commands.ActionCommand;
-import ggj.bloodrace.entities.obstacles.Blocco;
-import ggj.bloodrace.entities.obstacles.Dosso;
-import ggj.bloodrace.entities.obstacles.Montagna;
+import ggj.bloodrace.entities.obstacles.BlockBottom;
+import ggj.bloodrace.entities.obstacles.BlockCornerLB;
+import ggj.bloodrace.entities.obstacles.BlockCornerLT;
+import ggj.bloodrace.entities.obstacles.BlockCornerRB;
+import ggj.bloodrace.entities.obstacles.BlockCornerRT;
+import ggj.bloodrace.entities.obstacles.BlockFull;
+import ggj.bloodrace.entities.obstacles.BlockLeft;
+import ggj.bloodrace.entities.obstacles.BlockRight;
+import ggj.bloodrace.entities.obstacles.BlockTop;
 import ggj.bloodrace.handlers.ActionCollision;
 import ggj.bloodrace.handlers.CollisionHandler;
 import ggj.bloodrace.utils.Constants;
 	protected PlayerCollider right;
 	protected List<Entity> entities;
 	
+	private ActionCollision topCollision;
+	private ActionCollision bottomCollision;
+	private ActionCollision rightCollision;
+	private ActionCollision leftCollision;
+	
 	public Player(CollisionHandler c, GameContainer container, List<Entity> entities) {
 		super(c);
 		instances++;
 		
 		this.loadAnimation();
 		this.assignInput();
-		
 		this.instantiateCollider();
-		
-		ActionCollision topCollision = new ActionCollision() {
+		this.defineActionCollisions();
+		this.registerCollision();
+	}
+	
+	private void defineActionCollisions() {
+		topCollision = new ActionCollision() {
 			public void execute(Entity me, Entity target) {
 				velocity = 0;
 				setYPosition((int) (target.getYPosition()+target.getShape().getHeight()));
 			}
 		};
 		
-		ActionCollision bottomCollision = new ActionCollision() {
+		bottomCollision = new ActionCollision() {
 			public void execute(Entity me, Entity target) {
 				collidesBackground = true;
 				jumping = 0;
 			}
 		};
 
-		ActionCollision rightCollision = new ActionCollision() {
+		rightCollision = new ActionCollision() {
 			public void execute(Entity me, Entity target) {
 				int rightSide = (int) (getXPosition()+shape.getWidth());
 				int bottomSide = (int) (getYPosition()+shape.getHeight());
 			}
 		};
 		
-		ActionCollision leftCollision = new ActionCollision() {
+		leftCollision = new ActionCollision() {
 			public void execute(Entity me, Entity target) {
 				int leftSide = getXPosition();
 				int bottomSide = (int) (getYPosition()+shape.getHeight());
 					setXPosition((int) (target.getXPosition()+shape.getWidth()));
 				}
 			}
-		};		
-
-		collisionHandler.registerAction(left, Dosso.class, leftCollision);
-		collisionHandler.registerAction(left, Blocco.class, leftCollision);
-		collisionHandler.registerAction(left, Montagna.class, leftCollision);
-		
-		collisionHandler.registerAction(right, Dosso.class, rightCollision);
-		collisionHandler.registerAction(right, Blocco.class, rightCollision);
-		collisionHandler.registerAction(right, Montagna.class, rightCollision);
-		
-		collisionHandler.registerAction(bottom, HorizontalBottom.class, bottomCollision);
-		collisionHandler.registerAction(bottom, Dosso.class, bottomCollision);
-		collisionHandler.registerAction(bottom, Blocco.class, bottomCollision);
-		collisionHandler.registerAction(bottom, Montagna.class,bottomCollision);
-		
-		collisionHandler.registerAction(top, HorizontalTop.class, topCollision);
-		collisionHandler.registerAction(top, Dosso.class, topCollision);
-		collisionHandler.registerAction(top, Blocco.class, topCollision);
-		collisionHandler.registerAction(top, Montagna.class, topCollision);
+		};
 	}
 	
+	private void registerCollision() {
+		collisionHandler.registerAction(left, BlockBottom.class, leftCollision);
+		collisionHandler.registerAction(left, BlockCornerLB.class, leftCollision);
+		collisionHandler.registerAction(left, BlockCornerLT.class, leftCollision);
+		collisionHandler.registerAction(left, BlockCornerRB.class, leftCollision);
+		collisionHandler.registerAction(left, BlockCornerRT.class, leftCollision);
+		collisionHandler.registerAction(left, BlockFull.class, leftCollision);
+		collisionHandler.registerAction(left, BlockLeft.class, leftCollision);
+		collisionHandler.registerAction(left, BlockRight.class, leftCollision);
+		collisionHandler.registerAction(left, BlockTop.class, leftCollision);
+
+		collisionHandler.registerAction(right, BlockBottom.class, rightCollision);
+		collisionHandler.registerAction(right, BlockCornerLB.class, rightCollision);
+		collisionHandler.registerAction(right, BlockCornerLT.class, rightCollision);
+		collisionHandler.registerAction(right, BlockCornerRB.class, rightCollision);
+		collisionHandler.registerAction(right, BlockCornerRT.class, rightCollision);
+		collisionHandler.registerAction(right, BlockFull.class, rightCollision);
+		collisionHandler.registerAction(right, BlockLeft.class, rightCollision);
+		collisionHandler.registerAction(right, BlockRight.class, rightCollision);
+		collisionHandler.registerAction(right, BlockTop.class, rightCollision);
+
+		collisionHandler.registerAction(bottom, HorizontalBottom.class, bottomCollision);
+		collisionHandler.registerAction(bottom, BlockBottom.class, bottomCollision);
+		collisionHandler.registerAction(bottom, BlockCornerLB.class, bottomCollision);
+		collisionHandler.registerAction(bottom, BlockCornerLT.class,bottomCollision);
+		collisionHandler.registerAction(bottom, BlockCornerRB.class, bottomCollision);
+		collisionHandler.registerAction(bottom, BlockCornerRT.class, bottomCollision);
+		collisionHandler.registerAction(bottom, BlockFull.class,bottomCollision);
+		collisionHandler.registerAction(bottom, BlockLeft.class, bottomCollision);
+		collisionHandler.registerAction(bottom, BlockRight.class, bottomCollision);
+		collisionHandler.registerAction(bottom, BlockTop.class,bottomCollision);
+
+		collisionHandler.registerAction(top, HorizontalTop.class, topCollision);
+		collisionHandler.registerAction(top, BlockBottom.class, topCollision);
+		collisionHandler.registerAction(top, BlockCornerLB.class, topCollision);
+		collisionHandler.registerAction(top, BlockCornerLT.class, topCollision);
+		collisionHandler.registerAction(top, BlockCornerRB.class, topCollision);
+		collisionHandler.registerAction(top, BlockCornerRT.class, topCollision);
+		collisionHandler.registerAction(top, BlockFull.class, topCollision);
+		collisionHandler.registerAction(top, BlockLeft.class, topCollision);
+		collisionHandler.registerAction(top, BlockRight.class, topCollision);
+		collisionHandler.registerAction(top, BlockTop.class, topCollision);
+	}
+
 	private void instantiateCollider() {
+		instantiateCollider(false);
+	}
+	
+	private void instantiateCollider(boolean drawColliders) {
 		top = new PlayerCollider(collisionHandler, this);
 		bottom = new PlayerCollider(collisionHandler, this);
 		left = new PlayerCollider(collisionHandler, this);
 		right = new PlayerCollider(collisionHandler, this);
 
-		try {
-			Animation animation = new Animation(new Image[] { new Image(
-					"resources/images/collider.png") }, 250);
-			top.setAnimation("basic", animation);
-			top.setCurrentAnimation(top.getAnimation("basic"));
-			animation = new Animation(new Image[] { new Image(
-					"resources/images/collider.png") }, 250);
-			bottom.setAnimation("basic", animation);
-			bottom.setCurrentAnimation(bottom.getAnimation("basic"));
-			animation = new Animation(new Image[] { new Image(
-					"resources/images/collider.png") }, 250);
-			left.setAnimation("basic", animation);
-			left.setCurrentAnimation(left.getAnimation("basic"));
-			animation = new Animation(new Image[] { new Image(
-					"resources/images/collider.png") }, 250);
-			right.setAnimation("basic", animation);
-			right.setCurrentAnimation(right.getAnimation("basic"));
-		} catch (SlickException e) {
-			e.printStackTrace();
-		}		
-		
+		if (drawColliders) {
+			try {
+				Animation animation = new Animation(new Image[] { new Image(
+						"resources/images/collider.png") }, 250);
+				top.setAnimation("basic", animation);
+				top.setCurrentAnimation(top.getAnimation("basic"));
+				animation = new Animation(new Image[] { new Image(
+						"resources/images/collider.png") }, 250);
+				bottom.setAnimation("basic", animation);
+				bottom.setCurrentAnimation(bottom.getAnimation("basic"));
+				animation = new Animation(new Image[] { new Image(
+						"resources/images/collider.png") }, 250);
+				left.setAnimation("basic", animation);
+				left.setCurrentAnimation(left.getAnimation("basic"));
+				animation = new Animation(new Image[] { new Image(
+						"resources/images/collider.png") }, 250);
+				right.setAnimation("basic", animation);
+				right.setCurrentAnimation(right.getAnimation("basic"));
+			} catch (SlickException e) {
+				e.printStackTrace();
+			}
+		}
 		
 		entities.add(top);
 		entities.add(bottom);

File src/ggj/bloodrace/entities/obstacles/Blocco.java

-package ggj.bloodrace.entities.obstacles;
-
-import ggj.bloodrace.utils.Constants;
-
-import org.newdawn.slick.Animation;
-import org.newdawn.slick.Image;
-import org.newdawn.slick.geom.Rectangle;
-
-public class Blocco extends Obstacle {
-
-	public Blocco(){
-		super();
-		
-			Animation animation = new Animation(new Image[] { Obstacle.bloccoImage }, 250);
-			this.setAnimation("basic", animation);
-			this.setCurrentAnimation(this.getAnimation("basic"));
-
-		this.shape = new Rectangle(this.getXPosition(),this.getYPosition(),this.getCurrentAnimation().getCurrentFrame().getWidth(),this.getCurrentAnimation().getCurrentFrame().getHeight());
-		this.setPosition(Constants.OBSTACLE_X_OFFSET, Constants.OBSTACLE_Y_OFFSET);
-	}
-}

File src/ggj/bloodrace/entities/obstacles/BlockBottom.java

+package ggj.bloodrace.entities.obstacles;
+
+import org.newdawn.slick.Animation;
+import org.newdawn.slick.Image;
+import org.newdawn.slick.geom.Rectangle;
+
+import ggj.bloodrace.utils.Constants;
+
+public class BlockBottom extends Obstacle {
+	public BlockBottom(){
+		super();
+		
+			Animation animation = new Animation(new Image[] { Obstacle.BottomImage }, 250);
+			this.setAnimation("basic", animation);
+			this.setCurrentAnimation(this.getAnimation("basic"));
+
+		this.shape = new Rectangle(this.getXPosition(),this.getYPosition(),this.getCurrentAnimation().getCurrentFrame().getWidth(),this.getCurrentAnimation().getCurrentFrame().getHeight());
+		this.setPosition(Constants.OBSTACLE_X_OFFSET, Constants.OBSTACLE_Y_OFFSET-58);
+	}
+}

File src/ggj/bloodrace/entities/obstacles/BlockCornerLB.java

+package ggj.bloodrace.entities.obstacles;
+
+import org.newdawn.slick.Animation;
+import org.newdawn.slick.Image;
+import org.newdawn.slick.geom.Rectangle;
+
+import ggj.bloodrace.utils.Constants;
+
+public class BlockCornerLB extends Obstacle {
+	public BlockCornerLB(){
+		super();
+		
+			Animation animation = new Animation(new Image[] { Obstacle.CornerLBImage }, 250);
+			this.setAnimation("basic", animation);
+			this.setCurrentAnimation(this.getAnimation("basic"));
+
+		this.shape = new Rectangle(this.getXPosition(),this.getYPosition(),this.getCurrentAnimation().getCurrentFrame().getWidth(),this.getCurrentAnimation().getCurrentFrame().getHeight());
+		this.setPosition(Constants.OBSTACLE_X_OFFSET, Constants.OBSTACLE_Y_OFFSET-58);
+	}
+}

File src/ggj/bloodrace/entities/obstacles/BlockCornerLT.java

+package ggj.bloodrace.entities.obstacles;
+
+import org.newdawn.slick.Animation;
+import org.newdawn.slick.Image;
+import org.newdawn.slick.geom.Rectangle;
+
+import ggj.bloodrace.utils.Constants;
+
+public class BlockCornerLT extends Obstacle {
+	public BlockCornerLT(){
+		super();
+		
+			Animation animation = new Animation(new Image[] { Obstacle.CornerLTImage }, 250);
+			this.setAnimation("basic", animation);
+			this.setCurrentAnimation(this.getAnimation("basic"));
+
+		this.shape = new Rectangle(this.getXPosition(),this.getYPosition(),this.getCurrentAnimation().getCurrentFrame().getWidth(),this.getCurrentAnimation().getCurrentFrame().getHeight());
+		this.setPosition(Constants.OBSTACLE_X_OFFSET, Constants.OBSTACLE_Y_OFFSET-58);
+	}
+}

File src/ggj/bloodrace/entities/obstacles/BlockCornerRB.java

+package ggj.bloodrace.entities.obstacles;
+
+import org.newdawn.slick.Animation;
+import org.newdawn.slick.Image;
+import org.newdawn.slick.geom.Rectangle;
+
+import ggj.bloodrace.utils.Constants;
+
+public class BlockCornerRB extends Obstacle {
+	public BlockCornerRB(){
+		super();
+		
+			Animation animation = new Animation(new Image[] { Obstacle.CornerRBImage }, 250);
+			this.setAnimation("basic", animation);
+			this.setCurrentAnimation(this.getAnimation("basic"));
+
+		this.shape = new Rectangle(this.getXPosition(),this.getYPosition(),this.getCurrentAnimation().getCurrentFrame().getWidth(),this.getCurrentAnimation().getCurrentFrame().getHeight());
+		this.setPosition(Constants.OBSTACLE_X_OFFSET, Constants.OBSTACLE_Y_OFFSET-58);
+	}
+}

File src/ggj/bloodrace/entities/obstacles/BlockCornerRT.java

+package ggj.bloodrace.entities.obstacles;
+
+import org.newdawn.slick.Animation;
+import org.newdawn.slick.Image;
+import org.newdawn.slick.geom.Rectangle;
+
+import ggj.bloodrace.utils.Constants;
+
+public class BlockCornerRT extends Obstacle {
+	public BlockCornerRT(){
+		super();
+		
+			Animation animation = new Animation(new Image[] { Obstacle.CornerRTImage }, 250);
+			this.setAnimation("basic", animation);
+			this.setCurrentAnimation(this.getAnimation("basic"));
+
+		this.shape = new Rectangle(this.getXPosition(),this.getYPosition(),this.getCurrentAnimation().getCurrentFrame().getWidth(),this.getCurrentAnimation().getCurrentFrame().getHeight());
+		this.setPosition(Constants.OBSTACLE_X_OFFSET, Constants.OBSTACLE_Y_OFFSET-58);
+	}
+}

File src/ggj/bloodrace/entities/obstacles/BlockFull.java

+package ggj.bloodrace.entities.obstacles;
+
+import org.newdawn.slick.Animation;
+import org.newdawn.slick.Image;
+import org.newdawn.slick.geom.Rectangle;
+
+import ggj.bloodrace.utils.Constants;
+
+public class BlockFull extends Obstacle {
+	public BlockFull(){
+		super();
+		
+			Animation animation = new Animation(new Image[] { Obstacle.FullImage }, 250);
+			this.setAnimation("basic", animation);
+			this.setCurrentAnimation(this.getAnimation("basic"));
+
+		this.shape = new Rectangle(this.getXPosition(),this.getYPosition(),this.getCurrentAnimation().getCurrentFrame().getWidth(),this.getCurrentAnimation().getCurrentFrame().getHeight());
+		this.setPosition(Constants.OBSTACLE_X_OFFSET, Constants.OBSTACLE_Y_OFFSET-58);
+	}
+}

File src/ggj/bloodrace/entities/obstacles/BlockLeft.java

+package ggj.bloodrace.entities.obstacles;
+
+import org.newdawn.slick.Animation;
+import org.newdawn.slick.Image;
+import org.newdawn.slick.geom.Rectangle;
+
+import ggj.bloodrace.utils.Constants;
+
+public class BlockLeft extends Obstacle {
+	public BlockLeft(){
+		super();
+		
+			Animation animation = new Animation(new Image[] { Obstacle.LeftImage }, 250);
+			this.setAnimation("basic", animation);
+			this.setCurrentAnimation(this.getAnimation("basic"));
+
+		this.shape = new Rectangle(this.getXPosition(),this.getYPosition(),this.getCurrentAnimation().getCurrentFrame().getWidth(),this.getCurrentAnimation().getCurrentFrame().getHeight());
+		this.setPosition(Constants.OBSTACLE_X_OFFSET, Constants.OBSTACLE_Y_OFFSET-58);
+	}
+}

File src/ggj/bloodrace/entities/obstacles/BlockOxygen.java

+package ggj.bloodrace.entities.obstacles;
+
+import org.newdawn.slick.Animation;
+import org.newdawn.slick.Image;
+import org.newdawn.slick.geom.Rectangle;
+
+import ggj.bloodrace.utils.Constants;
+
+public class BlockOxygen extends Obstacle {
+	public BlockOxygen(){
+		super();
+		
+			Animation animation = new Animation(new Image[] { Obstacle.OxygenImage }, 250);
+			this.setAnimation("basic", animation);
+			this.setCurrentAnimation(this.getAnimation("basic"));
+
+		this.shape = new Rectangle(this.getXPosition(),this.getYPosition(),this.getCurrentAnimation().getCurrentFrame().getWidth(),this.getCurrentAnimation().getCurrentFrame().getHeight());
+		this.setPosition(Constants.OBSTACLE_X_OFFSET, Constants.OBSTACLE_Y_OFFSET-58);
+	}
+}

File src/ggj/bloodrace/entities/obstacles/BlockRight.java

+package ggj.bloodrace.entities.obstacles;
+
+import org.newdawn.slick.Animation;
+import org.newdawn.slick.Image;
+import org.newdawn.slick.geom.Rectangle;
+
+import ggj.bloodrace.utils.Constants;
+
+public class BlockRight extends Obstacle {
+	public BlockRight(){
+		super();
+		
+			Animation animation = new Animation(new Image[] { Obstacle.RightImage }, 250);
+			this.setAnimation("basic", animation);
+			this.setCurrentAnimation(this.getAnimation("basic"));
+
+		this.shape = new Rectangle(this.getXPosition(),this.getYPosition(),this.getCurrentAnimation().getCurrentFrame().getWidth(),this.getCurrentAnimation().getCurrentFrame().getHeight());
+		this.setPosition(Constants.OBSTACLE_X_OFFSET, Constants.OBSTACLE_Y_OFFSET-58);
+	}
+}

File src/ggj/bloodrace/entities/obstacles/BlockTop.java

+package ggj.bloodrace.entities.obstacles;
+
+import org.newdawn.slick.Animation;
+import org.newdawn.slick.Image;
+import org.newdawn.slick.geom.Rectangle;
+
+import ggj.bloodrace.utils.Constants;
+
+public class BlockTop extends Obstacle {
+	public BlockTop(){
+		super();
+		
+			Animation animation = new Animation(new Image[] { Obstacle.TopImage }, 250);
+			this.setAnimation("basic", animation);
+			this.setCurrentAnimation(this.getAnimation("basic"));
+
+		this.shape = new Rectangle(this.getXPosition(),this.getYPosition(),this.getCurrentAnimation().getCurrentFrame().getWidth(),this.getCurrentAnimation().getCurrentFrame().getHeight());
+		this.setPosition(Constants.OBSTACLE_X_OFFSET, Constants.OBSTACLE_Y_OFFSET-58);
+	}
+}

File src/ggj/bloodrace/entities/obstacles/Dosso.java

-package ggj.bloodrace.entities.obstacles;
-
-import ggj.bloodrace.utils.Constants;
-
-import org.newdawn.slick.Animation;
-import org.newdawn.slick.Image;
-import org.newdawn.slick.geom.Rectangle;
-
-public class Dosso extends Obstacle {
-
-	public Dosso(){
-		super();
-		
-			Animation animation = new Animation(new Image[] { Obstacle.dossoImage }, 250);
-			this.setAnimation("basic", animation);
-			this.setCurrentAnimation(this.getAnimation("basic"));
-
-		this.shape = new Rectangle(this.getXPosition(),this.getYPosition(),this.getCurrentAnimation().getCurrentFrame().getWidth(),this.getCurrentAnimation().getCurrentFrame().getHeight());
-		this.setPosition(Constants.OBSTACLE_X_OFFSET, Constants.OBSTACLE_Y_OFFSET-58);
-	}
-}

File src/ggj/bloodrace/entities/obstacles/Fosso.java

-package ggj.bloodrace.entities.obstacles;
-
-import ggj.bloodrace.utils.Constants;
-
-import org.newdawn.slick.Animation;
-import org.newdawn.slick.Image;
-import org.newdawn.slick.geom.Rectangle;
-
-public class Fosso extends Obstacle {
-
-	public Fosso(){
-		super();
-		
-			Animation animation = new Animation(new Image[] { Obstacle.fossoImage }, 250);
-			this.setAnimation("basic", animation);
-			this.setCurrentAnimation(this.getAnimation("basic"));
-		this.shape = new Rectangle(this.getXPosition(),this.getYPosition(),this.getCurrentAnimation().getCurrentFrame().getWidth(),this.getCurrentAnimation().getCurrentFrame().getHeight());
-		this.setPosition(Constants.OBSTACLE_X_OFFSET, Constants.OBSTACLE_Y_OFFSET);
-	}
-}

File src/ggj/bloodrace/entities/obstacles/Montagna.java

-package ggj.bloodrace.entities.obstacles;
-
-import ggj.bloodrace.utils.Constants;
-
-import org.newdawn.slick.Animation;
-import org.newdawn.slick.Image;
-import org.newdawn.slick.SlickException;
-import org.newdawn.slick.geom.Rectangle;
-
-public class Montagna extends Obstacle {
-
-	public Montagna(){
-		super();
-		
-			Animation animation = new Animation(new Image[] { Obstacle.montagnaImage }, 250);
-			this.setAnimation("basic", animation);
-			this.setCurrentAnimation(this.getAnimation("basic"));
-		this.shape = new Rectangle(this.getXPosition(),this.getYPosition(),this.getCurrentAnimation().getCurrentFrame().getWidth(),this.getCurrentAnimation().getCurrentFrame().getHeight());
-		this.setPosition(Constants.OBSTACLE_X_OFFSET, Constants.OBSTACLE_Y_OFFSET-58*2);
-	}
-}

File src/ggj/bloodrace/entities/obstacles/Obstacle.java

 import ggj.bloodrace.utils.Constants;
 
 public class Obstacle extends Entity {
-	public static Image dossoImage;
-	public static Image bloccoImage;
-	public static Image fossoImage;
-	public static Image montagnaImage;
+	public static Image CornerLBImage;
+	public static Image BottomImage;
+	public static Image CornerRBImage;
+	public static Image LeftImage;
+	public static Image FullImage;
+	public static Image RightImage;
+	public static Image CornerLTImage;
+	public static Image TopImage;
+	public static Image CornerRTImage;
+	public static Image OxygenImage;
 	
 	static{
 		try {
-			dossoImage = new Image("resources/images/dosso.png");
-			bloccoImage = new Image("resources/images/square.png");
-			fossoImage = new Image("resources/images/fosso.png");
-			montagnaImage = new Image("resources/images/stret_down.png");
+			CornerLBImage = new Image("resources/images/blocks/cornerlb.png");
+			BottomImage = new Image("resources/images/blocks/bottom.png");
+			CornerRBImage = new Image("resources/images/blocks/cornerrb.png");
+			LeftImage = new Image("resources/images/blocks/left.png");
+			FullImage = new Image("resources/images/blocks/full.png");
+			RightImage = new Image("resources/images/blocks/right.png");
+			CornerLTImage = new Image("resources/images/blocks/cornerlt.png");
+			TopImage = new Image("resources/images/blocks/top.png");
+			CornerRTImage = new Image("resources/images/blocks/cornerrt.png");
+			OxygenImage = new Image("resources/images/blocks/oxygen.png");
+			
 		} catch (SlickException e) {
 			e.printStackTrace();
 		}

File src/ggj/bloodrace/game/levels/ElementsType.java

 package ggj.bloodrace.game.levels;
 
 import ggj.bloodrace.entities.Entity;
-import ggj.bloodrace.entities.Ossigeno;
-import ggj.bloodrace.entities.obstacles.Blocco;
-import ggj.bloodrace.entities.obstacles.Dosso;
-import ggj.bloodrace.entities.obstacles.Fosso;
-import ggj.bloodrace.entities.obstacles.Montagna;
-import ggj.bloodrace.entities.obstacles.Obstacle;
+import ggj.bloodrace.entities.obstacles.BlockBottom;
+import ggj.bloodrace.entities.obstacles.BlockCornerLB;
+import ggj.bloodrace.entities.obstacles.BlockCornerLT;
+import ggj.bloodrace.entities.obstacles.BlockCornerRB;
+import ggj.bloodrace.entities.obstacles.BlockCornerRT;
+import ggj.bloodrace.entities.obstacles.BlockFull;
+import ggj.bloodrace.entities.obstacles.BlockLeft;
+import ggj.bloodrace.entities.obstacles.BlockOxygen;
+import ggj.bloodrace.entities.obstacles.BlockRight;
+import ggj.bloodrace.entities.obstacles.BlockTop;
 
 
 public enum ElementsType {
+	EMPTY('0'),
+	CORNERLB('1'),
+	BOTTOM('2'),
+	CORNERRB('3'),
+	LEFT('4'),
+	FULL('5'),
+	RIGHT('6'),
+	CORNERLT('7'),
+	TOP('8'),
+	CORNERRT('9'),
+	OXYGEN('*');
 	
-	VUOTO(0),
-	BLOCCO(1),
-	FOSSO(2),
-	DOSSO(3),
-	MONTAGNA(4),
-	OSSIGENO(5),
-	BREAK(9);
+	private char value  = 0;
 	
-	
-	private int value  = 0;
-	
-	private ElementsType(int type){
+	private ElementsType(char type){
 		this.value = type;
 	}
 	
-	public int getValue(){
+	public char getValue(){
 		return this.value;
 	}
 	
-	public static ElementsType getById(int id){
+	public static ElementsType getById(char id){
 		for (ElementsType type :values())
 			if (type.getValue() == id) return type;
 	
 	
 	public static Entity getBlock(ElementsType type){
 		switch (type){
-		case DOSSO:
-			return new Dosso();
-		case FOSSO:
-			return new Fosso();
-		case BLOCCO:
-			return new Blocco();
-		case MONTAGNA:
-			return new Montagna();
-		case OSSIGENO:
-			return new Ossigeno();
-		case BREAK:
+		case CORNERLB:
+			return new BlockCornerLB();
+		case BOTTOM:
+			return new BlockBottom();
+		case CORNERRB:
+			return new BlockCornerRB();
+		case LEFT:
+			return new BlockLeft();
+		case FULL:
+			return new BlockFull();
+		case RIGHT:
+			return new BlockRight();
+		case CORNERLT:
+			return new BlockCornerLT();
+		case TOP:
+			return new BlockTop();
+		case CORNERRT:
+			return new BlockCornerRT();
+		case OXYGEN:
+			return new BlockOxygen();
+		case EMPTY:
 			return null;
 		default:
 			throw new IllegalStateException("Non posso creare un ostacolo :"+type);

File src/ggj/bloodrace/game/levels/Level.java

 
 public class Level {
 
-	private List<ArrayList<Integer>> elements = new ArrayList<ArrayList<Integer>>();
+	private List<ArrayList<Character>> elements = new ArrayList<ArrayList<Character>>();
 	
-	public List<ArrayList<Integer>> getElements() {
+	public List<ArrayList<Character>> getElements() {
 		return elements;
 	}
 
-	public void setElements(List<ArrayList<Integer>> elements) {
+	public void setElements(List<ArrayList<Character>> elements) {
 		this.elements = elements;
 	}
 
 			BufferedReader br = new BufferedReader(new InputStreamReader(is));
 			String line = null;
 			while ((line = br.readLine()) != null) {
-				ArrayList<Integer> row = new ArrayList<Integer>();
+				ArrayList<Character> row = new ArrayList<Character>();
 				String[] elements = line.split(" ");
 				for (String element : elements)
-					row.add(Integer.parseInt(element));
+					row.add(element.toCharArray()[0]);
 				this.elements.add(row);
 			}
+			br.close();
 		} catch (IOException e) {
 			e.printStackTrace();
 		}
-
 	}
 }

File src/ggj/bloodrace/utils/Constants.java

 	
 	public static final int LEVEL_HEIGHT = 300;
 	
-	public static final int BLOCK_SIZE = 32;
+	public static final int BLOCK_SIZE = 29;
 	public static final int BLOCK_AREA_START_X = 0;
 	public static final int BLOCK_AREA_START_Y = 50;
 }

File src/resources/images/blocks/bottom.png

Added
New image

File src/resources/images/blocks/cornerlb.png

Added
New image

File src/resources/images/blocks/cornerlt.png

Added
New image

File src/resources/images/blocks/cornerrb.png

Added
New image

File src/resources/images/blocks/cornerrt.png

Added
New image

File src/resources/images/blocks/full.png

Added
New image

File src/resources/images/blocks/left.png

Added
New image

File src/resources/images/blocks/oxygen.png

Added
New image

File src/resources/images/blocks/right.png

Added
New image

File src/resources/images/blocks/top.png

Added
New image