How do I move an enemy back and forth on a straight line?

Get help using Construct 2

Post » Sun Jul 06, 2014 5:45 pm

I was originally using the sine function, but I want to have more control over the NPC. Essentially I'll be setting up horizontal lines or rows across my map and have enemies spawn on different rows. Each row will have a different movement pattern. So I started, exploring the 8 direction with simulate movements. Unfortunately, this behavior isn't working as I expected. I attached the CAPx. Right now I want the 8 direction to move left until it collides with an object and then reverse. Simple enough right? But for whatever reason, it hits the object, bounces a bit the continues left. Anyone know which rookie mistake I have used on this one? Maybe there are other methods of doing this? Thanks!
You do not have the required permissions to view the files attached to this post.
B
6
Posts: 28
Reputation: 404

Post » Sun Jul 06, 2014 6:22 pm

Reverse just gives a bit of a bounce: (manual):
Invert the direction of motion. Useful as a simple way to bounce the object off an obstacle.


You need to simulate moving right afterwards.
You do not have the required permissions to view the files attached to this post.
ImageImageImage
B
71
S
22
G
249
Posts: 3,763
Reputation: 138,577

Post » Sun Jul 06, 2014 6:40 pm

Ah, I needed to set up a variable to turn off the left direction and turn on the right. That makes sense, thanks!
B
6
Posts: 28
Reputation: 404


Return to How do I....?

Who is online

Users browsing this forum: Kyatric and 30 guests