Auto Attack?

Get help using Construct 2

Post » Mon Nov 04, 2013 5:06 pm

Hello,

is it possible to create an Auto Attack ?
When The Enemie X,Y or Z are in the near of the Player for example 200y than the Player spawn every 2 seconds Bullets and Stops moving? And when the Enemie is down that the Player moves Forward again to the next Enemie, and when he is in a distance of 200y than the Player automaticly stops and shoots again every 2 Seconds a Bullets?

When yes, how ?


Thanks
B
11
S
2
Posts: 93
Reputation: 917

Post » Mon Nov 04, 2013 5:16 pm

That is possible..
something like this will work:

for each enemy
System compare two values: distance(player.x,player.y,enemy.x,enemy.y)<200
-player stop
-player rotate toward angle(player.x,player.y,enemy.x,enemy.y)
every x seconds
- player spawn bullet.

although pick by evaluate would probably be better.
LittleStain2013-11-04 17:17:28
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Mon Nov 04, 2013 7:18 pm

@LittleStain

It works very well, just my Player dont stops.
I have put in "Stop Animation"
B
11
S
2
Posts: 93
Reputation: 917


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 12 guests