Movement question again

Get help using Construct 2

Post » Sat Feb 06, 2016 2:36 pm

I spammed in the last version of this topic and i would like to delete that topic but i don't know how to do it. But i still feel bad for that topic so now i make a new version and i won't spam and i will wait for an answer no matter how long it will take. I want an enemy to move to the left when it is a certain distance from the rigth side of the player. Then it is going to pass the player, keep moving left. When it is a certain distance away from the left side of the player it is going to switch to moving rigth. Then it is going to pass the player and repeat the process so it basically follows the player. I tried making this work by doing this.
Enemy-Event-Is whitin angle
Whitin: 180
Angle: 0
Enemy-Sub event-Compare X
Player.X-1500
Enemy-Action-Set value
Action
"left"
Enemy-Event-Compare instance variable
Action
Equals to
"left"
Enemy-Action
Simulate control pressing left
Enemy-Event-Is whitin angle
Whitin: 180
Angle: 180
Enemy-Sub event-Compare X
Player.X--1500
Enemy-Action
Set value
Action
"rigth"
Enemy-Event-Compare instance variable
Action
Equals to
"rigth"
Enemy-Action
Simulate control pressing rigth

Whit this it should work. But it doesn't. So what do i need to
change to make it work?
B
11
S
2
Posts: 262
Reputation: 1,309

Post » Sat Feb 06, 2016 2:39 pm

Calfuso wrote:I spammed in the last version of this topic and i would like to delete that topic but i don't know how to do it. But i still feel bad for that topic so now i make a new version and i won't spam and i will wait for an answer no matter how long it will take. I want an enemy to move to the left when it is a certain distance from the rigth side of the player. Then it is going to pass the player, keep moving left. When it is a certain distance away from the left side of the player it is going to switch to moving rigth. Then it is going to pass the player and repeat the process so it basically follows the player. I tried making this work by doing this.
Enemy-Event-Is whitin angle
Whitin: 180
Angle: 0
Enemy-Sub event-Compare X
Player.X-1500
Enemy-Action-Set value
Action
"left"
Enemy-Event-Compare instance variable
Action
Equals to
"left"
Enemy-Action
Simulate control pressing left
Enemy-Event-Is whitin angle
Whitin: 180
Angle: 180
Enemy-Sub event-Compare X
Player.X--1500
Enemy-Action
Set value
Action
"rigth"
Enemy-Event-Compare instance variable
Action
Equals to
"rigth"
Enemy-Action
Simulate control pressing rigth

Whit this it should work. But it doesn't. So what do i need to
change to make it work?


There is really no need for yet another thread. The other thread is not only still active, but has a response to your question from R0J0hound HERE.

What is wrong with R0J0's answer?

Please continue with the original thread.
If your vision so exceeds your ability, then look to something closer.
Moderator
B
129
S
29
G
77
Posts: 5,188
Reputation: 54,281


Return to How do I....?

Who is online

Users browsing this forum: Google [Bot] and 7 guests