How do I mirror a sprite with touch controls?

Get help using Construct 2

Post » Mon Mar 02, 2015 3:07 am

Hi, I'm making a game with touch controls, but only in the X axis. I'm using the DragDrop for the character behavior. Now, my problem is this: I want the sprite to get mirrored to the left if it is dragged and moved to that side, and not mirrored if it's not. Basically...what it is always done with left and right arrows if the game is a platformer. I tried almost everything, but didn't manage to do it. Any help is appreciated in advance ^^
B
4
Posts: 8
Reputation: 216

Post » Mon Mar 02, 2015 5:13 am

on start of drag set original X position to a variable. then check current x position to that variable. if < then mirror, if > not mirror
Image
B
57
S
13
G
6
Posts: 271
Reputation: 12,073

Post » Tue Mar 03, 2015 2:55 am

It's ALMOST there, but I believe I like how it turned out!!! I mean...the character gets mirrored only when it comes across the original position, and I wanted it to get mirrored anytime I move to a direction (left or right). Aaaaaaaanyways, as I staded before, I kinda like the outcome nonetheless. Thanks man!!!
B
4
Posts: 8
Reputation: 216

Post » Tue Mar 03, 2015 2:57 am

Ah, sos de Perú!! Hablás español entonces ^^ Sentite libre de comentarme en este idioma. Yo soy de Uruguay ^^ ^^ ^^
B
4
Posts: 8
Reputation: 216

Post » Tue Mar 03, 2015 4:43 pm

hay otra opción pero tendrías que calcular la posición del sprite en todo momento. elimina lo anterior y crea una variable "xprevia" luego cada 0.001 segundo cambias la variable al valor actual de X. después, si x actual es menor a xprevia, mirrored. si x actual es mayor a xprevia, not mirrored
Image
B
57
S
13
G
6
Posts: 271
Reputation: 12,073

Post » Wed Mar 04, 2015 10:55 pm

No me anduvo así. Igual, como te dije, la manera anterior está bien :D Gracias!
B
4
Posts: 8
Reputation: 216


Return to How do I....?

Who is online

Users browsing this forum: SneakyHands, Zaksoid and 4 guests