How to make the character follow your finger?

Get help using Construct 2

Post » Mon Mar 30, 2015 2:57 pm

How do you make it so your character follows your finger like in this video?
youtube.com/watch?v=xv8SCANivzk
B
6
Posts: 20
Reputation: 326

Post » Mon Mar 30, 2015 5:08 pm

Just some off the cuff thoughts on this...

1. your sprite object would ideally have bullet behavior
2. when the player touches somewhere on screen, set the bullet behavior angle to angle(sprite.x,sprite.y,touch.x,touch.y) (I don't know if those are the correct selectors, but you get the point)
2b. set the sprites bullet behavior acceleration to, say, 100
3. if no touch input is detected, set the acceleration to 0

have you tried that?
B
66
S
16
G
9
Posts: 372
Reputation: 8,748

Post » Mon Mar 30, 2015 5:28 pm

Okay, I made him have the bullet behavior. In the event sheet, do I add event and have it touch(on any touch end)and then set the character bullet angle I don't get. I only get bounce off object, set angle of motion, set gravity, set acceleration, set enabled, and set speed. I think I am suppose to do is set angle of motion but then I get just angle. I not sure what you are saying. Could you tell me what to put in the event sheet? Thank you
B
6
Posts: 20
Reputation: 326

Post » Mon Mar 30, 2015 5:47 pm

I want to make something like this but how do I implement the character? emanueleferonato.com/2014/06/13/control-your-html5-game-character-like-in-vvvvvvvv-mobile-game-with-construct2/
B
6
Posts: 20
Reputation: 326

Post » Tue Mar 31, 2015 2:37 am

Hey man - there are some good tutorials out there for touch events and bullet behaviors. I know it can be a drag, but I would recommend checking those out first and experimenting. Maybe even do a forum search for touch events.
B
66
S
16
G
9
Posts: 372
Reputation: 8,748

Post » Tue Mar 31, 2015 2:24 pm

on touch - object set object bullet angle of motion to: angle(object.x,object.y,touch.x,touch.y) it should work as wanted..
If the object isn't moving yet you will have to set the bullet-speed too ( it has to be set before setting the angle if I recall right)

This site has a good manual and many tutorials, I'd recommend reading them to get better grips on working with events and expressions.
Even if they are not for the exact purposes you want, there is still a lot to learn from them regarding working with construct2 in general.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775


Post » Wed Apr 01, 2015 2:42 pm

Thank you Lordshiva1948 for that. I sadly can't find what I was looking for. I tried to find a tutorial on this website but I haven't ran into any yet. I want something that is exactly like this. youtube.com/watch?v=xv8SCANivzk
B
6
Posts: 20
Reputation: 326

Post » Fri Apr 03, 2015 8:31 pm

King Limberg
https://www.dropbox.com/home/Demos
look for Demo Touch this is what you are looking for King Limberg
B
231
S
33
G
14
Posts: 1,908
Reputation: 38,742

Post » Fri Apr 03, 2015 9:55 pm

Thank you for the reply, its good but how do I make the square go to my finger, like it takes 5 seconds for it to get to my finger. In the video, it takes time for the character to get to your finger. And how do you make the camera follow like it does in the video. Like the scroll to behavior in way. Exactly like the video. youtube.com/watch?v=xv8SCANivzk
B
6
Posts: 20
Reputation: 326


Return to How do I....?

Who is online

Users browsing this forum: tarek2 and 5 guests