Pastebin launched a little side project called HostCabi.net, check it out ;-)Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 12th, 2012  |  syntax: Java  |  size: 0.46 KB  |  hits: 19  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. public Image collisionMap(TiledMap tm) throws SlickException
  2.         {
  3.                 Image map = new Image(tm.getWidth()*32, tm.getHeight()*32);
  4.                 int li = tm.getLayerIndex("Collision");
  5.                 org.newdawn.slick.Graphics g;
  6.                 g = map.getGraphics();
  7.                
  8.                 for(int x = 0; x<tm.getWidth(); x++){
  9.                         for(int y = 0; y<tm.getHeight(); y++){
  10.                                 if(tm.getTileImage(x, y, li)!=null){
  11.                                         g.drawImage(tm.getTileImage(x, y, li), x*32, y*32, Color.white);
  12.                                 }
  13.                         }
  14.                 }
  15.                
  16.                 return(map);
  17.         }