Created
May 9, 2016 19:33
-
-
Save TheophileWalter/2554df4ba36fabb2ffc388059568db80 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Méthode d'affichage du labyrinthe. | |
public void paintComponent(Graphics g) { | |
Graphics2D g2 = (Graphics2D) g; | |
for (int i = laby.getHero().cell.getI()-VIEW_FIELD; i <= laby.getHero().cell.getI()+VIEW_FIELD; i++) { | |
for (int j = laby.getHero().cell.getJ()-VIEW_FIELD; j <= laby.getHero().cell.getJ()+VIEW_FIELD; j++) { | |
Cell cell = laby.get(i, j); | |
if (cell == null) { | |
continue; | |
} | |
cell.paintCell(g2, (j-laby.getHero().cell.getJ()+VIEW_FIELD)*SCALE, (i-laby.getHero().cell.getI()+VIEW_FIELD)*SCALE, SCALE); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment