Platform game enemy's bug

For questions about using Classic.

Post » Thu Oct 14, 2010 3:43 pm

When the enemy change his direction, it sinks into the ground.

File: http://www.mediafire.com/?jxdb8jm9xb1z75v

The var "direo" is the direction of enemy. If is 1, it will walk to the left; and if is 2, it will walk to the right.
Yes, I tried to use the auto-mirror function, but it didn't work.

Anyone can help me?
B
11
S
1
G
2
Posts: 24
Reputation: 1,104

Post » Thu Oct 14, 2010 5:05 pm

You usually don't use negative width for sprites to mirror them for different directions. That's what the auto mirror attribute is meant for. Combined with the auto rotate attribute of the Platform behavior it should work just fine.

I also noticed that you have the frames of your animations always facing left. They should face right since the standard direction is right as well. You can simply flip a frame horizontally by right clicking and selecting the option.

So fix your frames, get rid of negative width (also the events that do set negative width) and enable auto rotate and auto mirror. Then you should be fine for the most part.

I'm not sure but auto rotate might not work properly on sprites that have ignored input. In that case you should be looking into setting the angle manually to the movement angle or some similar solution.

Oh, you also should put the "Start ignoring user input" action in a "Start of layout" event, btw.

And welcome to the forums! :)
B
21
S
6
G
10
Posts: 1,024
Reputation: 7,445

Post » Fri Oct 15, 2010 3:04 pm

Thanks, problem solved.

And thanks for the welcome :D
B
11
S
1
G
2
Posts: 24
Reputation: 1,104


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 2 guests