Enemy bullets

Get help using Construct 2

Post » Wed Oct 23, 2013 11:15 pm

I have it to when the player is within line of site of the enemy, the
enemy will create the bullet...but i cant really figure out how to get the bullet to be angles directly at the player...


here is my capx.
http://www.dwbailey.com/images/lineofsite.capx


lines

75
B
9
S
2
Posts: 272
Reputation: 1,632

Post » Thu Oct 24, 2013 12:15 am

bullet set angle towards player.x player.y
Visual Novel 'Engine' in 100 Events
if you ever have to choose between buying Construct 2 on scirra.com or on Steam, read this: Review
B
22
S
9
G
1
Posts: 787
Reputation: 3,786

Post » Thu Oct 24, 2013 2:38 am

B
9
S
2
Posts: 272
Reputation: 1,632

Post » Thu Oct 24, 2013 3:57 am

Use 'Set angle toward position' instead, and it will work. You try to set an angle by addition of x and y coordinates.

Cheers,
thegrindthegrind2013-10-24 03:59:11
B
26
S
9
G
2
Posts: 78
Reputation: 2,524

Post » Thu Oct 24, 2013 5:00 am

got that to work, thanks guys
B
9
S
2
Posts: 272
Reputation: 1,632

Post » Thu Oct 24, 2013 7:58 am

You should have another look at your events.

The inverted has line of side is a subcondition of a had line of side event.
So you are checking if there is no line of sight when there is, which can never be true.
Also, it's of no use to repeat the conditions of the top-event in the subevent, for the subevent will only be checked if the top event is true..

The last three events could be put into one, by using an or-block and or adding the grass, fence and branch to a family and checking collision for that.

Good luck on your game, it seems like you really work hard at it!
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 » Thu Oct 24, 2013 6:45 pm

Hey Stain, thanks for the advice on my event sheet, I deleted the part you suggested...also made a family group for the first time..seems to work..

B
9
S
2
Posts: 272
Reputation: 1,632


Return to How do I....?

Who is online

Users browsing this forum: Darth Crusher, ketramtu18, Syazanie Amirin, XMatrix and 7 guests