mouse folow

GeminisLOL

  • Posts: 19
someone could be so kind to show me a visual code in which the player changes sprite according to the position of the mouse ???

JeffreyDriver

  • Posts: 1873
Have you asked this before? It's difficult to give an answer without knowing exactly what you're trying to do. Are you trying to change animation? How many potential changes are there? Does it depend on angle, distance, or both?

Can you link to a video of what you're trying to do? Or draw a diagram explaining?
Current Projects:
Horror Point & Click Episode 1.
I always appreciate useful feedback. Thank you.
www.jeffreydriver.co.uk


GeminisLOL

  • Posts: 19
this is the code for the follow to mouse
https://drive.google.com/open?id=1dI7Bw86dqWbKJPZ96fWd-OKulfIfvbN9
---------------------------------------------
This is the video of the game, so you can see what I created. 
https://drive.google.com/open?id=1_4-zAey-J3NLogpYY2MjiV2TrlyWU1s2
I want that if the mouse is between angles 135 and 225, the weapon changes direction to the left.

I want to put only four directions for the animations, although I can walk on 8.

addresses
left
Right
down
up

JeffreyDriver

  • Posts: 1873
First of all, I suggest that you install the Easy Math extension - http://community.stencyl.com/index.php/topic,27769.0.html

It has blocks for things like getting the angle between two points. It'll really simplify what you're doing.

Then it's a case of creating your IF/OTHERWISE IF statements to switch the animation.
Current Projects:
Horror Point & Click Episode 1.
I always appreciate useful feedback. Thank you.
www.jeffreydriver.co.uk

GeminisLOL

  • Posts: 19
I'm going to install the extension.
and if it's an if but it does not come out right