Advertisement
Guest User

Untitled

a guest
Aug 12th, 2012
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.46 KB | None | 0 0
  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.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement