How do I make touch controls for a breakout game

Get help using Construct 2

Post » Sat Jul 05, 2014 10:28 am

Ok i don't wan't obviously the paddle to instantly move whenever i touch,how do i make it so that when i touch the paddle,and then hold finger on it and move it around,that way paddle moves..?
B
5
Posts: 24
Reputation: 280

Post » Sat Jul 05, 2014 10:57 am

I've made a quick example for you to study how I've done it.
I basicly did that when "on touch" your paddle will move in the direction of the area you are touching.
If you're touching the screen on the left side of the paddle, the paddle moves in a certain speed to the left.
If you're touching the screen on the right side of the paddle, the paddle moves in a certain speed to the right.

Hope you can figure it out with the help of this capx:
You do not have the required permissions to view the files attached to this post.
B
6
S
1
Posts: 73
Reputation: 571

Post » Sat Jul 05, 2014 11:58 am

That's not what i wan't...i wan't to move the paddle with my finger.

Touch the paddle,slide the finger over the screen -> paddle moves where your finger is...that's what i wan't.

And i can't open that capx because i have an earlier version.
B
5
Posts: 24
Reputation: 280

Post » Sat Jul 05, 2014 12:50 pm

Try drag and drop behavior
B
109
S
25
G
43
Posts: 1,883
Reputation: 33,553

Post » Sat Jul 05, 2014 2:38 pm

delgado wrote:Try drag and drop behavior


Ok that works but there is still one issue,on my PC it is normal,but when i run the preview on phone,the paddle is for some reason all the way to the left,when i drag it with my finger,it works,but,when i release,it goes back to all the way to the left...

It should on start be on the middle,and simply move where i move my finger,but i don't know why it is doing this.
B
5
Posts: 24
Reputation: 280

Post » Sat Jul 05, 2014 3:12 pm

Maybe something like:
Touch is touching sprite>set sprite.x to touch.x.

happy constructing.
If it can be done, someone on the web will show you how to do it!

CDASI Games Mentality Break Splat-a-bug FlapFleet Challenge
B
34
S
12
G
7
Posts: 356
Reputation: 7,144

Post » Sat Jul 05, 2014 8:53 pm

michael wrote:Maybe something like:
Touch is touching sprite>set sprite.x to touch.x.

happy constructing.


Nope :/ That lets me move the paddle a little bit and then the paddle moves all the way to the left (Note that as i said before another problem is whenever i preview the game on PHONE,the paddle is all the way to the left,so,basically,after what you told me,i can move the paddle a little bit and then it comes back to where it was.

I also need to fix that problem which puts the paddle all the way to the left (But that isn't going to be a too big problem as long as i fix the main problem,making it move properly.
B
5
Posts: 24
Reputation: 280


Return to How do I....?

Who is online

Users browsing this forum: SturmIV and 5 guests