This site requires JavaScript, please enable it in your browser!
Greenfoot back
Roshan123
Roshan123 wrote ...

2020/10/11

Check collision before adding

2
3
4
5
Roshan123 Roshan123

2020/10/19

#
Download it If u downloaded then reply anything as soon as possible
Roshan123 Roshan123

2020/10/19

#
...
danpost danpost

2020/10/19

#
Roshan123 wrote...
If u downloaded then reply anything as soon as possible
anything as soon as possible
danpost danpost

2020/10/19

#
Roshan123 wrote...
Can u plz tell me that is their any way to fix it
Seems to work okay with this:
if(b>0 && --b ==0) addObject(new B(),r[rand],r2[rand2]);
if(b==0 && getObjects(B.class).isEmpty())b =99;
Roshan123 Roshan123

2020/10/20

#
danpost wrote...
Roshan123 wrote...
Can u plz tell me that is their any way to fix it
Seems to work okay with this:
if(b>0 && --b ==0) addObject(new B(),r[rand],r2[rand2]);
if(b==0 && getObjects(B.class).isEmpty())b =99;
Yes it works, but it doesn't check collision I also made bot class which moves randomly and sometimes when b class is added again to world then their r some chance to intersect with bot So that's why I am asking you to tell me a program which will check collision while spawning
danpost danpost

2020/10/20

#
Roshan123 wrote...
Yes it works, but it doesn't check collision
Oh, but it does. The addObject call takes care of it. Because the actor is added to a world, the addedToWorld method will be also called on the actor internally..
Roshan123 Roshan123

2020/10/20

#
danpost wrote...
Roshan123 wrote...
Yes it works, but it doesn't check collision
Oh, but it does. The addObject call takes care of it. Because the actor is added to a world, the addedToWorld method will be also called on the actor internally..
But how did u got to know that its working?? Is it possible to check or not??
danpost danpost

2020/10/20

#
Roshan123 wrote...
But how did u got to know that its working?? Is it possible to check or not??
Pause scenario and manually remove B from world (right-click on it and select Delete from drop-down). Then drag another actor to where the removed actor would be added and hit the Run button.
Roshan123 Roshan123

2020/10/20

#
danpost wrote...
Roshan123 wrote...
But how did u got to know that its working?? Is it possible to check or not??
Pause scenario and manually remove B from world (right-click on it and select Delete from drop-down). Then drag another actor to where the removed actor would be added and hit the Run button.
Yoyoyjhrhdhdj its work-king hdfshsjjsjshahahha आपका शुक्रिया । भगवान आपका भला करे
You need to login to post a reply.
2
3
4
5