Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void drawMap(Canvas canvas, Player player, ArrayList<MapField> map)
- {
- int a = player.getShiftX()/Constants.TILE_SIZE;
- int b = player.getShiftY()/Constants.TILE_SIZE;
- for (int x = a-Constants.VISIBILITY_X; x<=a+Constants.VISIBILITY_X; x++)
- {
- if (x>=0&&x<=99)
- {
- for (int y = b-Constants.VISIBILITY_Y; y<=b+Constants.VISIBILITY_Y*2-1; y++)
- {
- if (y>=0&&y<=99)
- {
- map.get(x+y*100).update();
- map.get(x+y*100).draw(canvas);
- }
- }
- }
- }
- }
- public void draw(Canvas canvas)
- {
- canvas.drawBitmap(Graphics.TILES_BITMAP[tileId], null, rect, p);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement