Advertisement
thezachman1676

wat

May 26th, 2015
248
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.75 KB | None | 0 0
  1. public void update(GameContainer gc,TiledMap TM)
  2.     {
  3.         Input i = gc.getInput();
  4.  
  5.         for(int j = 0; j < TM.TILES.size();j++)
  6.         {
  7.             if((this.loc.getX()/width == TM.TILES.get(j).getStartAndEndLoc().getX())&&(this.loc.getY()/height == TM.TILES.get(j).getStartAndEndLoc().getY()))
  8.             {
  9.                 for(int k = 0; k < TM.TP.size();k++)
  10.                 {
  11.                     if(TM.TILES.get(j).tileType == TM.TP.get(k).getName())
  12.                     {
  13.                         if(i.isKeyDown(Input.KEY_LEFT))&&(TM.TP.)
  14.                         {
  15.                             this.loc.set(this.loc.getX()-1,this.loc.getY(),this.loc.getX()-1+width,this.loc.getY()+height);
  16.                         }
  17.                         if(i.isKeyDown(Input.KEY_RIGHT))
  18.                         {
  19.                             this.loc.set(this.loc.getX()+1,this.loc.getY(),this.loc.getX()+1+width,this.loc.getY()+height);
  20.                         }
  21.                     }
  22.                 }
  23.             }
  24.         }
  25.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement