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

2020/5/1

How to make objects fall from the top of my screen

ninjapuffin ninjapuffin

2020/5/1

#
Can anyone tell me how to make an object fall from the top of my screen thanks a lot!
Yehuda Yehuda

2020/5/1

#
Explain what you are having difficulty with. What did you try? What happened?
ninjapuffin ninjapuffin

2020/5/1

#
well i can do it but its not making multiples
Yehuda Yehuda

2020/5/1

#
So what is the issue? You tried what and what happened?
ninjapuffin ninjapuffin

2020/5/1

#
i tried stuff in the world code it only made one object
Yehuda Yehuda

2020/5/1

#
What are you asking for here? What exactly do you want to happen? What code did you try? What happened?
ninjapuffin ninjapuffin

2020/5/1

#
this is what i put in the my world code
addObject(new Bomb(), Greenfoot.getRandomNumber(600), 10 );
        addObject(new Gball(), Greenfoot.getRandomNumber(600), 10 );
        addObject(new Sball(), Greenfoot.getRandomNumber(600), 10 );
        addObject(new PointBoost(), Greenfoot.getRandomNumber(600), 10 );
danpost danpost

2020/5/1

#
ninjapuffin wrote...
i tried stuff in the world code it only made one object
You need an act method to produce one object after another.
ninjapuffin ninjapuffin

2020/5/1

#
okay let me try that
ninjapuffin ninjapuffin

2020/5/1

#
its making way too many should i set a timer
Yehuda Yehuda

2020/5/1

#
That's a solution.
danpost danpost

2020/5/1

#
Yehuda wrote...
That's a solution.
Another is by a random number generator to create random chance spawning.
ninjapuffin ninjapuffin

2020/5/1

#
okay let me try that out danpost
You need to login to post a reply.