Platform game enemy's bug

This forum is currently in read-only mode.
  • When the enemy change his direction, it sinks into the ground.

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

    The var "dire��o" 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?

  • 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!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Thanks, problem solved.

    And thanks for the welcome

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)