How do I movimiento player

Get help using Construct 2

Post » Wed Mar 01, 2017 7:08 pm

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
B
6
S
2
Posts: 33
Reputation: 528

Post » Wed Mar 01, 2017 8:03 pm

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.
Banned User
B
23
S
6
G
58
Posts: 1,229
Reputation: 34,540

Post » Wed Mar 01, 2017 8:18 pm

I only have one point and it is in the center of the image and it continues to vibrate
B
6
S
2
Posts: 33
Reputation: 528

Post » Wed Mar 01, 2017 8:31 pm

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.
Banned User
B
23
S
6
G
58
Posts: 1,229
Reputation: 34,540

Post » Wed Mar 01, 2017 9:55 pm

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
B
6
S
2
Posts: 33
Reputation: 528

Post » Wed Mar 01, 2017 9:57 pm

B
6
S
2
Posts: 33
Reputation: 528

Post » Wed Mar 01, 2017 10:50 pm

manujorgo wrote:http://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?
Banned User
B
23
S
6
G
58
Posts: 1,229
Reputation: 34,540

Post » Wed Mar 01, 2017 10:59 pm

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.
B
6
S
2
Posts: 33
Reputation: 528

Post » Wed Mar 01, 2017 11:35 pm

manujorgo wrote: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

Image

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.
Banned User
B
23
S
6
G
58
Posts: 1,229
Reputation: 34,540

Post » Thu Mar 02, 2017 9:45 am

It works perfectly, thank you very much. I was also looking for something similar, that a shadow came out and that the player followed. :D
B
6
S
2
Posts: 33
Reputation: 528

Next

Return to How do I....?

Who is online

Users browsing this forum: HenryPK, NadeemAbbass, Nagval333, plinkie and 9 guests