How do I movimiento player

  • good afternoon,

    I am doing a tactile game and the problem I have is that when the cursor is on top of the player it stays vibrating as if it moved very fast. My idea is that when you are playing the player this will stay still until you move your finger again and this will follow.

    Thank you

  • Without seeing a capx my guess is you are using touch controls and you may have your image points in your sprite in different locations causing the animation to jiggle.

    Make sure your animation points are all in the same location on the sprites. You can use Apply to all animations to set the point.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I only have one point and it is in the center of the image and it continues to vibrate

  • Then it could be in how you are handling your movement of the piece as it relates to the touch control.

    If that is constantly checking X and Y it can cause a jiggle.

    Also check your collision boxes. Different sizes can cause a jiggle.

    I would have to see a CAPX to tell you any more.

  • I do not know how to upload the capx, but I append a capture of the player movement, I'm sure the bug is in that part, but I'm not able to find the error.

    http://imgur.com/qw2URjS

    Thank you

  • imgur.com/dxcCEp6

    Yup that would definitely cause your sprite to jiggle when it reached your touch point.

    That is because that event is telling it to keep finding that angle and keep moving forward 17 pixels. So it shoots past that touch point and reverses angle and goes 17 pixels back the other direction and just keeps doing that.

    Do you want the sprite to stop moving when it reaches your touch point or follow your finger?

  • I want it when it is in contact with the finger (above the player) this stops and if I move the finger that follows. That is to say that it only stops when it is in contact with the finger.

  • I want it when it is in contact with the finger (above the player) this stops and if I move the finger that follows. That is to say that it only stops when it is in contact with the finger.

    OK, there are probably other ways to do this but this works and is simple:

    Here is the CAPX

    https://www.dropbox.com/s/bsxshwn0rq60adg/Touch%20Move%20Control.capx?dl=0

    This uses two sprites and the overlap to check position. The blue sprite moves fast to the position you are touching and the red sprite moves slower and stops when it overlaps the blue sprite. You can make that red sprite follow you all over the screen and it will stop without jiggling.

    If you want the red sprite to move faster change the 5 to a higher number but 5 seems to look good.

    You can set the blue sprite invisible if you want. The blue sprite must start overlapping the red sprite when you start the events or your red sprite will take off on its own. You could create another global variable trigger to prevent that if you want.

  • It works perfectly, thank you very much. I was also looking for something similar, that a shadow came out and that the player followed.

  • It works perfectly, thank you very much. I was also looking for something similar, that a shadow came out and that the player followed.

    You are welcome!

    I use those hidden sprites as place holders and pointers alot in my games. Easy way to control movements.

  • One thing, when the game starts the player is going to the right side of the screen instead of staying in the center.

  • One thing, when the game starts the player is going to the right side of the screen instead of staying in the center.

  • The blue pointer has to overlap the red sprite when you start or the red sprite will start moving.

    You could add another trigger variable to keep it from moving like double tap on the red sprite to start the action if you want.

  • Thank you very much for your help, I have it as I needed it.

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