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

2011/4/18

Shooting

Lildarkone Lildarkone

2011/4/18

#
I am trying to make a game where you can explore and I am currently working on a bow. I am having trouble making the arrows fire in the current direction of my character. Any suggestions?
mik mik

2011/4/18

#
Do you know how to make an actor move in the direction it's facing? If you do, then it's easy. To make the arrow face the same direction as the bow, you can just write (in the Bow class): arrow.setRotation(getRotation()); This sets the rotation of the bow to the same as the arrow.
Lildarkone Lildarkone

2011/4/18

#
Thanks, I seen to have the arrow moving where I want it to go. I am having a little trouble with world edge collision. I was recently having the same problem on a similar project. If you have solid code for edge collisions, it would be great if you could post it.
Lildarkone Lildarkone

2011/4/18

#
Nevermind, collision with world edge is working now. Thanks again for the arrow movement!
You need to login to post a reply.