How do I throw objects

Get help using Construct 2

Post » Mon Sep 05, 2016 5:39 am

Image


I'm trying to make a juggling game for iPhone where you have to juggle a tennis ball
clockwise around a center point without touching it, or the outside edges of the screen.

When I was playing around with the physics, I did this:
If Touch is touching TennisBall, Apply Impulse 10 toward (Touch.X, Touch.Y) at image point 0.

This got me the throwing I wanted, but there are 2 problems:
  • When the touch is held, the tennis ball goes crazy.
  • Even the tiniest swipe makes the ball go flying.

------------------------------------------------------------

How do I make it so the ball stays still when touch is held,
and make it so a bigger swipe can be used with the same acceleration?
B
6
Posts: 2
Reputation: 254

Post » Mon Sep 05, 2016 12:11 pm

You can try 'On touched object Tennis Ball' which will only trigger the touch once. That will solve both issues.

Trigger 'on touch end' could also be used. When touch released it will fire the ball if you want that kind of functionality.
B
47
S
17
G
82
Posts: 2,231
Reputation: 48,609

Post » Mon Sep 05, 2016 5:47 pm

I would go for 'On Touch End' as well.

Here's an example.

https://www.dropbox.com/s/sxoqkckfz5dvc ... .capx?dl=0

I've added Power; so that longer you hold, further the ball will travel.

By the way, there's no built-in swipe action in C2. Please visit the following pages to learn more about how to make the swipe action or multi-touch working in C2

how-do-i-add-touch-swipe-gestures_t165358.
https://www.scirra.com/tutorials/4973/m ... t-controls
B
11
S
6
G
15
Posts: 256
Reputation: 9,207


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 21 guests