Select animation in 8 positions depending on mouse position

0 favourites
  • 6 posts
From the Asset Store
A set of retro 16-Bit Neon UI elements to make your menus pop!
  • Good afternoon guys, I have a problem. I have an object that is the mouse pointer MOuse.x MOUSE.y... and I want my sprite character to change its image depending on the position where the mouse pointer is in reference in the SPRITE.. I mean, I load the animation right left up down or diagonals depending on whether the mouse is in the upper right left down or diagonals... but I can't get how to get what position it is in in reference to my character...

    Does anyone know how to do it...

  • Using system compare two values, you combine two conditions such as if mouse.x > sprite.x and mouse.y > sprite.Y then set animation diagonal down/right

  • I'm trying to combine with two values... but it doesn't seem to work... it only works up or down... or right/left but not the 4 positions... although I really need the diagonals too... could you tell me how to do it please

  • What is si no, an 'Else'? Write out the 4 conditions. The other two conditions are when X and Y are less than. So this would work for the 4 main directions, test it.

  • oesn't work separately either.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • In the end I solved it by means of degrees that I think is more simple and effective. I leave it here in case someone needs something similar.

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