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

2013/4/18

Bullet disapearing cause errors

1
2
mufusion mufusion

2013/4/20

#
i set it to 600 and spawned 3 not 5. the problem is: at the first time 3 are spawning, the second time 6,the third 9,the fourth 12 and so on. i think its something like that: the counter counts to 600 one time,do the spawn. the counter counts to 600 twice, do the spawn twice. and so on how can i "refresh" the counter? isnt counter = 0; enough? and another problem: when all gegner1 die before the counter counts to 600 theres no spawn. i think because theres no gegner1 left who can run the method. edit: when theres only 1 enemie alive 3 are spawning when the 3 are alive 6 are spawning but when i kill 3 and only one is alive 3 are spawning.
danpost danpost

2013/4/20

#
I get it. Each gegner1 object has a seperate counter that is being used to create more of them. Move the code to create gegner1 objects out of the gegner1 class and into the world class code.
mufusion mufusion

2013/4/20

#
Thank you,its working now. why didnt i thinked of it....
You need to login to post a reply.
1
2