Make the Enemy Flip Image Horizontal

juliomario14juliomario14 AtlantaMember, PRO Posts: 7

Hello, I made my enemy face the player when i'm near it (face right) but when i jump him the enemy doesnt face me (facing left) i can think of an equation that can do that type of behavior. Any body have any ideas! Thank yuo

Comments

  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772

    Use a Change Attribute Behavior and just change the actors Flip Horizontal setting.

  • juliomario14juliomario14 AtlantaMember, PRO Posts: 7

    but then who i can change the enemy attribute to from true to false when my player pass it or jump it over.

  • juliomario14juliomario14 AtlantaMember, PRO Posts: 7

    who=how lol sorry

  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772

    Well it depends on how you set up your coding for the game. What I would do is Constraint my players X and Y values to two attributes. That way you can know where your player is at at all times and act accordingly.

    So I'd do something like this (not real code, just ideas):
    
    Attributes:
    playerX
    playerY
    
    (constrained to the players X and Y location)
    
    In your enemie(s):
    
    if self.positionX<playerX face to the right (flip horizontal as needed)
    if self.positionX>playerX face to the left (flip horizontal as needed)
    

    Hope that helps.

  • SmokeyAce73SmokeyAce73 EarthMember Posts: 370
    edited April 2014

    @Jamie_C said:
    Well it depends on how you set up your coding for the game

    Coding?!? @Jamie_C You should know better! :blush: >

  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772

    @SmokeyAce73, lol! I know, I wrestle with what to call it sometimes... :)

  • juliomario14juliomario14 AtlantaMember, PRO Posts: 7

    @jaime_c Thank you, GOT IT !!!

  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772

    Great, glad to hear it!

Sign In or Register to comment.