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

2017/4/22

Different World, Different Bullets

Ostarius Ostarius

2017/4/22

#
Is it possible for an actor to shoot different bullets when he is in a different World? Let's say that in Worlds MyWorld1 through MyWorld7 it shoots "Beapons" If it is in MyWorld8 it shoots "BossWeapons"
danpost danpost

2017/4/22

#
Ostarius wrote...
Is it possible for an actor to shoot different bullets when he is in a different World? Let's say that in Worlds MyWorld1 through MyWorld7 it shoots "Beapons" If it is in MyWorld8 it shoots "BossWeapons"
Why not?
Actor bullet = new Beapons();
if (getWorld() instanceof MyWorld8) bullet = new BossWeapons();
bullet.setRotation( ...
getWorld().addObject(bullet, ...
Ostarius Ostarius

2017/4/22

#
Wow that is actually really smart Thank you :D
You need to login to post a reply.