How do I create an object and move to a position?

Get help using Construct 2

Post » Tue Aug 11, 2015 12:09 pm

Hi,
Could somebody help with creating an object and moving it to a position?

I want to create an object at the edge of a layout and move it to the player's position. Player will also be in a moving to some other position.

The scenario will be like an enemy created to an edge of a layout and moving towards the player to kill him. Player will be running off to escape from the enemy.

Please check the screen shot below
https://dl.dropboxusercontent.com/u/87665007/Pic/1.png

In the above case, the enemy is being created at a defined position and just appearing at the player's position. I want the enemy to move (Like chasing) towards the player.

Please help. Thanks.
B
24
S
7
Posts: 335
Reputation: 2,220

Post » Tue Aug 11, 2015 12:13 pm

Would giving the enemy bullet behaviour and setting it's angle towards the player work for you?
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 » Tue Aug 11, 2015 12:46 pm

@littlestain I got the same idea but if I add bullet to the enemy, it won't change it direction along with the player, rite.

Enemy changing its direction along with the player would be great.

Please solve this problem.

Thanks.
B
24
S
7
Posts: 335
Reputation: 2,220

Post » Tue Aug 11, 2015 12:50 pm

You mean like this?

system every tick
> enemy set bullet angle of motion = angle(enemy.x,enemy.y,player.x,player.y)
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 » Tue Aug 11, 2015 12:58 pm

Wow. I didn't know there is such option. Thanks a lot man. Its working

@littlestain
B
24
S
7
Posts: 335
Reputation: 2,220


Return to How do I....?

Who is online

Users browsing this forum: newday198913, rotacak and 4 guests