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

2017/3/24

Needs help with making a bullet spawn and move...

crasnoml101 crasnoml101

2017/3/24

#
in making a Mario related game and i a have one of the koopas in the cloud that i want to throw down the spikey turtle shells. how would i go about doing so? it would be the same as like spawning a bullet for a gun but i dont know how to go about it.
danpost danpost

2017/3/24

#
Ignoring the trigger (whatever you will use to control when the koopa throws down the spikey turtle shells) that will call the method to spawn them, the method would simply be something like the following (which would be in the class of the koopa):
private void throwSpikeyTurtleShell()
{
    SpikeyTurtleShell sts = new SpikeyTurtleShell();
    getWorld().addObject(sts, getX(), getY()+50);
}
crasnoml101 crasnoml101

2017/3/31

#
Thank you!
You need to login to post a reply.