Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualPatriarch K

Posted 13 January 2013 - 05:42 AM

That must be the problem then. But I'm not very into that kind of stuff. Could you explain a little bit how to do what you mention and give some kind of code example?
Can I just do like this and NOTHING ELSE? This does not work because I get problems on the b.remove() every time when two bullets is shot at the same time and removed at the same time.

List list = Collections.synchronizedList(new ArrayList(...));

and:

synchronized(bubblor) {
Iterator<Test> b = bubblor.iterator();
while(b.hasNext()){
synchronized(enemies) {
Iterator<Enemy> e = enemies.iterator();
Test bob = b.next();
while(e.hasNext()){

Enemy fof = e.next();
Rectangle r1 = fof.getBounds();
Rectangle r2 = bob.getBounds();
if(r1.intersects(r2) ){
b.remove();

#3Patriarch K

Posted 13 January 2013 - 05:22 AM

That must be the problem then. But I'm not very into that kind of stuff. Could you explain a little bit how to do what you mention and give some kind of code example?
Can I just do like this and NOTHING ELSE?

List list = Collections.synchronizedList(new ArrayList(...));

#2Patriarch K

Posted 13 January 2013 - 05:22 AM

That must be the problem then. But I'm not very into that kind of stuff. Could you explain a little bit how to do what you mention and give some kind of code example?
Can I just do like this and NOTHING ELSE?

List list = Collections.synchronizedList(new ArrayList(...));

#1Patriarch K

Posted 13 January 2013 - 05:09 AM

That must be the problem then. But I'm not very into that kind of stuff. Could you explain a little bit how to do what you mention and give some kind of code example?


PARTNERS