This site requires JavaScript, please enable it in your browser!
Greenfoot
Username
Password
Remember Me?
Sign Up, Lost Password
Activity
About
Documentation
Download
Discuss
Scenarios
moraisai
wrote ...
2015/3/11
How can I let enemies shot in my direction?
moraisai
2015/3/11
#
Hello I need help for my greenfoot porject. My enemies are shooting but how can I let them shot into my direction?
danpost
2015/3/11
#
What have you tried, code-wise?
moraisai
2015/3/11
#
this is my shooting function: public void schuss() { if(Greenfoot.getRandomNumber(500) < 5) { bullet2 bullet2 = new bullet2(); getWorld().addObject(bullet2, getX(), getY()); bullet2.setRotation(getRotation()); } }
danpost
2015/3/11
#
You need to have your enemies 'turnTowards' your location (face toward you) before shooting.
moraisai
2015/3/11
#
It works! Thank you
You need to login to post a reply.
X