shoot bullets to player location?

Get help using Construct 2

Post » Mon May 02, 2016 8:50 am

Hi everyone. How to make that the enemies will shoot bullets to player's location ?
B
8
S
3
Posts: 100
Reputation: 1,023

Post » Mon May 02, 2016 9:02 am

Several ways...
Start with the beginners tutorial and ghost shooter tutorial. They will get you started with this topic in no time.

In short.. spawn bullet sprite containing the bullet behavior at player object and set its angle to player.x,player.y...
Last edited by chrisinfinger on Mon May 02, 2016 9:04 am, edited 1 time in total.
Check out my completed games on the Arcade! Capt. Doe Save the Universe! & Clicker Wizard!
B
66
S
17
G
8
Posts: 637
Reputation: 9,370

Post » Mon May 02, 2016 9:03 am

There are several ways to do this and here is one possibility:

From https://www.scirra.com/manual/132/common-actions
Set angle toward position
Set the object's angle to face a position in the layout.


Bullet on created: set object's angle to face (player.x, player.y)

If your Bullet behavior has set angle on, your Bullet object should head toward the player right when it is created.
I got a game that you multiply, breath fire with two heads and brawl foes to oblivion with your clones: http://www.newgrounds.com/portal/view/660664 (use Chrome on Windows for best performance)

My sites:
http://twinblazar.deviantart.com
http://twinblazar.newgrounds.com
https://twitter.com/twinblazar
http://www.pixiv.net/member.php?id=15072448
B
30
S
11
G
11
Posts: 411
Reputation: 8,469

Post » Fri May 06, 2016 5:35 pm

TwinBlazar wrote:There are several ways to do this and here is one possibility:

From https://www.scirra.com/manual/132/common-actions
Set angle toward position
Set the object's angle to face a position in the layout.


Bullet on created: set object's angle to face (player.x, player.y)

If your Bullet behavior has set angle on, your Bullet object should head toward the player right when it is created.



thanks :)
B
8
S
3
Posts: 100
Reputation: 1,023


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 18 guests