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

2015/8/15

Need Help with Projectiles!

1
2
danpost danpost

2015/8/19

#
Alright. The issue is that the rotation of your character is never changing. You are mirroring its image and setting a boolean value to indicate the direction the image appears to be facing; but the rotational angle of the actor remains zero. Therefore, setting the rotation of the Shot object to that of the character does not alter the rotation of the shot. Instead of:
s.setRotation(getRotation());
try this:
s.setRotation(facingLeft ? 180 : 0);
AtomStation AtomStation

2015/8/20

#
Wow, it works really well! Thanks so much for the help!
You need to login to post a reply.
1
2