How do I Make a bullet track the player for 2 seconds

Just started using Construct 2? Post your questions here

Post » Wed Oct 11, 2017 12:53 am

I have a problem, I'm trying to make a "top down" game where bullets track the player for 2 seconds but with how I have it set up right now the first one only tracks the player and then zoom off of the map (Which is what i want) but then everything else will just go in a straight line...

any fixes/ suggestions?
B
4
Posts: 1
Reputation: 202

Post » Wed Oct 11, 2017 12:50 pm

Hey @Jayyyyde!

Not sure that's what you need. In this capx you can control the player with the arrows. The cannon will shoot a bullet every 3 seconds. Each bullet will follow the player for 2 seconds, then, stays in a straight line until it leaves the layout. Bullet speed is slightly higher than player speed.

https://www.dropbox.com/s/cnzjg4i94epg9 ... .capx?dl=0

Hope this helps. Cheers!
Bruno

I like to eat, but I'm no cook. Why liking to play games would make you a game designer?
B
21
S
6
G
3
Posts: 659
Reputation: 3,845

Post » Thu Oct 12, 2017 6:57 am

Hi @Jayyyyde ,

If only the first bullet behaves how you want it, and then all other subsequent bullets do not, there must be an error in your event.
I'm not sure how your game looks like, but like this without too much information I would use a pathfinding behavior, and use this event :

bullet => On created => find path to "player.X player .Y"

Then, for the 2 second timer, I would also ad a "bullet" behavior at your bullets that activates after 2 second while you deactivate the pathfinding behavior via the "set enabled/disabled" setting.
B
12
S
4
G
1
Posts: 39
Reputation: 1,378


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 0 guests