|
|
|
@ -19,6 +19,7 @@ public class LevelRenderer extends Object{ |
|
|
|
|
public LevelRenderer(Panel panel) { |
|
|
|
|
super(panel); |
|
|
|
|
this.setSprite(Sprite.TILE_SHEET); |
|
|
|
|
setY(Tile.TILE_HEIGHT*6); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@ -45,8 +46,6 @@ public class LevelRenderer extends Object{ |
|
|
|
|
Map.SaveMap(RabiClone.CURRENT_MAP); |
|
|
|
|
System.out.println("Map saved"); |
|
|
|
|
} |
|
|
|
|
setX(RabiClone.player.getX()-RabiClone.BASE_WIDTH/2); |
|
|
|
|
setY(RabiClone.player.getY()-RabiClone.BASE_HEIGHT*(2/3d)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@ -78,6 +77,16 @@ public class LevelRenderer extends Object{ |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
Draw_Object(RabiClone.player); |
|
|
|
|
Draw_Object(RabiClone.player2); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Draws an object where its sprite is centered among its position and drawn relative to the camera position. |
|
|
|
|
* @param object |
|
|
|
|
*/ |
|
|
|
|
protected void Draw_Object(Object object) { |
|
|
|
|
super.Draw_Sprite(object.getX()-this.getX()-object.getSprite().getWidth()/2, object.getY()-this.getY()-object.getSprite().getHeight()/2, object.getSprite()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void DrawTile(double x, double y, Tile tile) { |
|
|
|
|