Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void update(PacketMessage packet) {
- if(!packet.should_remove){
- int indexpl = 0;
- boolean end = false;
- for(OtherPlayer _other : new ArrayList<OtherPlayer>(other_players)){
- if(packet.message.equals(_other.owner)){
- x=true;
- indexpl=other_players.indexOf(_other);
- }
- }
- if(!x){
- if(!locked){
- other_players.add(new OtherPlayer(world, packet.x*vars.PX_MTR, packet.y*vars.PX_MTR, 40, 40, packet.message));
- x=true;
- }
- }
- else{
- if(!locked){
- other_players.get(indexpl).player_body.setTransform(new Vector2(packet.x,packet.y), packet.rotate);
- other_players.get(indexpl).player_body.setLinearVelocity(new Vector2(packet.velox, packet.veloy));
- }
- }
- }
- else{
- for(OtherPlayer _other: new ArrayList<OtherPlayer>(other_players)){
- if(packet.message.equals(_other.owner)){
- if(!locked){
- world.destroyBody(_other.player_body);
- other_players.remove(_other);
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment