How do I make enemy shoot at player

Get help using Construct 2

Post » Sun Oct 02, 2016 6:49 am

Message: kab can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
I am trying to make the spider shoot at the player.I know it doesn't make sense to make a spider shoot but i am just trying to make a game logic that works then will replace assets later.

I need to do the following

1)Spawn a spider and spiderbullet on a tree that is visible on window
2)Make the spider shoot at the player
3)If the player bullet hit the spider destroy spider and bullet

Check the capx https://www.dropbox.com/s/f5vf7jz0w2kqfey/workingdemo.capx?dl=0 to see my attempt thus far
B
5
S
1
Posts: 32
Reputation: 389

Post » Sun Oct 02, 2016 8:29 am

Image


I changed the name of "Spiderbullet" to "Spidertower" cause it was a tower you wanted, I guess. (it has the tower behavior)
I cloned the "Bullet" and named the clone "Spiderbullet" it's the bullet for the "Spidertower".

If you don't understand, let me know.
B
12
S
7
G
4
Posts: 114
Reputation: 3,067

Post » Sun Oct 02, 2016 9:48 am

Message: kab can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
Thanks a ton for the reply Pandadoor...

"spiderbullet" is in fact the clone of bullet.I used a different sprite to know what is going on?

I want the spider to aim the spiderbullet at the player and then release the spiderbullet like a bullet to hit the player.Remove the conflicting behaviours as you see fit

Here is the updated capx

https://www.dropbox.com/s/f5vf7jz0w2kqf ... .capx?dl=0
B
5
S
1
Posts: 32
Reputation: 389

Post » Sun Oct 02, 2016 1:00 pm

Your link doesn't work but I worked on the previous version.

Image

(In your capx Spiderbullet wasn't a clone, it had the tower behavior)

I removed the clone, now "Spidertower" = "Spiderbullet" (it has both behaviors, tower and bullet)
You have to add the bullet behavior to the Spiderbullet sprite AND set the initial state of the bullet behavior to Disabled
You should add the Destroy outside layout behavior to.
B
12
S
7
G
4
Posts: 114
Reputation: 3,067

Post » Sun Oct 02, 2016 6:55 pm

Message: kab can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
Thanks once again for the help and sorry for the wrong link.Now its almost done but the angle of the bullet isn't right.The tip should hit the player

What am i missing here

Latest-> https://www.dropbox.com/s/f5vf7jz0w2kqfey/workingdemo.capx?dl=0
B
5
S
1
Posts: 32
Reputation: 389

Post » Sun Oct 02, 2016 8:50 pm

You edit the SpiderBullet sprite in the editor and you rotate 90° (clockwise or anticlockwise) and that's it.
B
12
S
7
G
4
Posts: 114
Reputation: 3,067

Post » Sun Oct 09, 2016 12:19 pm

Thanks a ton mate ....work perfect
B
5
S
1
Posts: 32
Reputation: 389


Return to How do I....?

Who is online

Users browsing this forum: jasontoups and 1 guest