How do I make an enemy lunge itself at player randomly

Just started using Construct 2? Post your questions here

Post » Sat Mar 29, 2014 12:21 am

Hello everyone,

I have this breakout like game that I would like to have the bricks lunge themselves at the player on random intervals.

Currently the setup I have for the bricks is that they are moving left and right until they hit something then switch their direction. I have tried a myriad of (if not silly then stupid) workarounds for the bricks to shoot at the player's position (and not follow him around or stop when they reach the position but continue along like a bullet) but failed.

The bricks have the bullet behavior (that is how they move left and right) but I can't figure out the above; any ideas?

Thank you very much.
B
19
S
7
Posts: 161
Reputation: 1,751

Post » Sat Mar 29, 2014 5:02 pm

I made you a little capx:

http://honigmilch.com/capx/brick_to_player.capx

(The green thing is you drag-paddle)
What it basically does: The brick waits for his time to shoot and then sets his bullet's angle of motion towards the player and also the bullet speed.
B
77
S
28
G
32
Posts: 481
Reputation: 19,763

Post » Mon Mar 31, 2014 5:55 am

That did it, thank you very much! :D
B
19
S
7
Posts: 161
Reputation: 1,751


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 2 guests