Advertisement
StormWingDelta

Console Game Maze and Sprite Display Issue

Jan 28th, 2013
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.78 KB | None | 0 0
  1. // I get the funny fealing I messed something up with these loops since it renders the text inside the inner loop the same number of times as the number of sprites. v_v
  2. public void drawMapToComConsole()
  3.     {
  4.         for(int y = 0; y < getRows(); y++)
  5.         {
  6.             //System.out.print(x + " ");
  7.             for(int x = 0; x < getCols(y); x++)
  8.             {
  9.                
  10.                 System.out.print( "[");
  11.                 for(int i = 0; i < bots.size(); i++)
  12.                 {
  13.                     if(getBot(i).getXpos() == getGrid(y,x).getXpos() &&
  14.                             getBot(i).getYpos() == getGrid(y,x).getYpos())
  15.                     {
  16.                         System.out.print( getBot(i).displayChar() );//
  17.                     }
  18.                     else
  19.                     {
  20.                         System.out.print(getGrid(y,x).getCorrectDisplayer());//.getCorrectDisplayer()
  21.                     }
  22.                 }
  23.                
  24.                 System.out.print("]");
  25.                
  26.             }
  27.             System.out.println();
  28.         }
  29.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement