How do I detect wall when walking roof?

Get help using Construct 2

Post » Thu Jan 12, 2017 12:53 pm

Hi,

I am having a problem with an enemy. It is a stupid problem, but I dont know why is happening. This enemy has platform behaviour, and he can walk on the floor, and also he can invert his height to walk on the roof. The problem is when he is patrolling and he has wall to his sides, he doesnt mirror.

On the floor it works fine, but when he is up, seems like he is not detecting the walls. Why is this happening?

the pseudocode is:

if(enemy is mirrored)
----- Simulate press left
----- if(enemy has wall to left)
---------- enemy set not mirrored
else
----- Simulate press right
----- if(enemy has wall to right)
---------- enemy set mirrored

This works fine on the floor, but no when the height is negative. I tried to change the mirror just in case construct detect the negative height as mirrored, but that iks not the problem.
B
6
S
2
Posts: 61
Reputation: 1,099

Post » Thu Jan 12, 2017 2:14 pm

I don't know if this would help but have you tried 'flipping' the sprite instead of having -height, it could be a possibility that the negative height might mess with the platform behaviour. Don't know if this will help, thought I might as well just say just in case it does...
B
14
S
3
Posts: 55
Reputation: 912


Return to How do I....?

Who is online

Users browsing this forum: jaytrott86 and 7 guests