Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void update(GameContainer gc,TiledMap TM)
- {
- Input i = gc.getInput();
- for(int j = 0; j < TM.TILES.size();j++)
- {
- if((this.loc.getX()/width == TM.TILES.get(j).getStartAndEndLoc().getX())&&(this.loc.getY()/height == TM.TILES.get(j).getStartAndEndLoc().getY()))
- {
- for(int k = 0; k < TM.TP.size();k++)
- {
- if(TM.TILES.get(j).tileType == TM.TP.get(k).getName())
- {
- if(i.isKeyDown(Input.KEY_LEFT))&&(TM.TP.)
- {
- this.loc.set(this.loc.getX()-1,this.loc.getY(),this.loc.getX()-1+width,this.loc.getY()+height);
- }
- if(i.isKeyDown(Input.KEY_RIGHT))
- {
- this.loc.set(this.loc.getX()+1,this.loc.getY(),this.loc.getX()+1+width,this.loc.getY()+height);
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement