AlexArroyoDuque Posted February 4, 2014 Share Posted February 4, 2014 Hi, I'm new in the community and I love phaser JS.I'm developing a platform game. I like to comment my problem with "intelligence projectiles" I would mention to my problem with "smart missiles".Basically I do not know how to perform this task. I am able to handle sprites with animations but I do not know as provide them with "intelligence" to attack the player.I want the enemy attack the player shooting projectiles that follow. I attach a picture with my problem. Any idea? A greeting. Link to comment Share on other sites More sharing options...
jpdev Posted February 4, 2014 Share Posted February 4, 2014 Hi Alejandro, I hope this gives you an idea: http://janpeter.net/perma/phaser/smart.html Move the player with the mouse cursor.The enemies will keep aiming at him. To see how it is done, just view the source by right click + "view page source". jpdev, ekiscrim, anthkris and 1 other 4 Link to comment Share on other sites More sharing options...
AlexArroyoDuque Posted February 4, 2014 Author Share Posted February 4, 2014 Oh! thanks thanks thanks many thanks.I'll try with with your method! Link to comment Share on other sites More sharing options...
jpdev Posted February 4, 2014 Share Posted February 4, 2014 I have edited the example a little. So that it reuses bullets and does not create an unlimited amount. Try to change the speed values in move to object - also you can call it in another foreach loop on the projectiles group, to make them follow the player even after they have been initially shot. Good luck AlexArroyoDuque 1 Link to comment Share on other sites More sharing options...
Recommended Posts