package sig.objects; import sig.RabiClone; import sig.engine.Alpha; import sig.engine.Object; import sig.engine.Panel; import sig.engine.Sprite; import sig.map.Map; import sig.map.Tile; public class LevelRenderer extends Object{ public LevelRenderer(Panel panel) { super(panel); this.setSprite(Sprite.TILE_SHEET); } @Override public void update(double updateMult) {} @Override public void draw(byte[] p) { for (int y=(int)(this.getY()/Tile.TILE_HEIGHT);y<(int)(RabiClone.BASE_HEIGHT/Tile.TILE_HEIGHT+this.getY()/Tile.TILE_HEIGHT+1);y++) { if (y<0||y>Map.MAP_HEIGHT) { continue; } for (int x=(int)(0+this.getX()/Tile.TILE_WIDTH);x<(int)(RabiClone.BASE_WIDTH/Tile.TILE_WIDTH+this.getX()/Tile.TILE_WIDTH+1);x++) { if (x<0||x>Map.MAP_WIDTH) { continue; } if (RabiClone.CURRENT_MAP.getTile(x,y)!=Tile.VOID) { DrawTile(x*Tile.TILE_WIDTH-this.getX(),y*Tile.TILE_HEIGHT-this.getY(),RabiClone.CURRENT_MAP.getTile(x,y)); //System.out.println((x*Tile.TILE_WIDTH+(this.getX()%Tile.TILE_WIDTH) )+","+(y*Tile.TILE_HEIGHT+(this.getY()%Tile.TILE_HEIGHT))); } } } if (RabiClone.player!=null) { Draw_Object(RabiClone.player); } } @Override public void drawBackground(byte[] p) { for (int y=0;y