Advertisement
Guest User

Untitled

a guest
Jan 19th, 2018
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1.  
  2. public class RunFlamand implements Runnable{
  3.  
  4. FlamandVert FV = new FlamandVert(100);
  5.  
  6. @Override
  7. public void run() {
  8. // TODO Auto-generated method stub
  9. boolean vivant = true;
  10. long time =0;
  11. while (vivant) {
  12. long nb =Math.round(Math.random() * (PoisChiche.PoisChiches.size()-1));
  13. FV.Attaque(PoisChiche.PoisChiches.get((int) nb));
  14. if(FV.Pv<=0) vivant=false;
  15. time= Math.round(5000+ Math.random() * (20000));
  16. try {
  17. Thread.sleep(time);
  18. } catch (InterruptedException e) {
  19. // TODO Auto-generated catch block
  20. e.printStackTrace();
  21. }
  22.  
  23.  
  24. }
  25. FlamandVert.FlamandVerts.remove(FV);
  26. System.out.println("mort du Flamand vert numero " + FV.num);
  27.  
  28.  
  29. }
  30.  
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement