# How do I make a game where you have to throw a ball

0 favourites
• 8 posts
From the Asset Store
Throw daggers and hit the most fruit! Watch out for the wind, if you run out of daggers you'll lose the game!
• Hey all. How would I go about making a game where there are stacks sprites/cups stacked on top of each other and then a player has to throw something like ball/sprite at the cups in order to knock all the cups down within a certain amount of time. How would I go about making this be realistic and could someone provide a capx example illustrating this?

• Use catapult / physics example that comes with Construct 2 ( File, new project then open that instead of a blank project )

• ## Try Construct 3

Develop games in your browser. Powerful, performant & highly capable.

Construct 3 users don't see these ads
• How would I incorporate the swiping up effect tho for if I wanted the player to have to swipe up with their finger on the object/sprite in order to shoot him upwards? And how could I make it look like the cups are behind the player sprite but also further in the distance compared to the player sprite? I am trying to achieve the paper toss boss ios game effect to make it like that game.

• How would I incorporate the swiping up effect tho for if I wanted the player to have to swipe up with their finger on the object/sprite in order to shoot him upwards? And how could I make it look like the cups are behind the player sprite but also further in the distance compared to the player sprite? I am trying to achieve the paper toss boss ios game effect to make it like that game.

Detect the touch of the player... for the swipe

1-create 4 variables on the player a,b,c,d

2-on start of touch set 2 of the variables (a, b) to the x and y of the touch

3-on end of the touch set the 2 other variables (c, d) to the x and y of the touch

4-use these 4 coordinates to create a force vector and 4.1-apply the length of your vector as impulse force to the ball , 4.2 apply the angle of your vector to the angle of your impuls

Steps 2 to 4 should happen in a single tick/event

... about making the cups look like they are in the distance, im not really clear about that ( maybe you need to use parallax or something else), not sure though

• Sounds like you are talking about fake 3D ( throwing into the screen as opposed to left right ). In that case physics probably won't work. I tried and decided it was easier to code my own simplified physics. Once you start scaling Physics objects their behavior becomes too unpredictable, and you need scaling ( z axis ). So either code your own physics or figure out a way to compensate for scaling issues ( if possible at all ).

As for swiping you have the answer above.

• donald Cela

I'm also trying to make something similar. I originally used the code from the piggy shoot template, but wanted a swipe up instead.

But I'm stuck at step 4 of your explanation. What do you mean y force vector? Perhaps you could enlighten us with a more code-shown explanation?

Thanks!

• Basically he's trying to say use distance ( length of swipe ) from point where you started to swipe to the end point of your swipe. Longer the distance, apply more force, more up movement ( start.Y to end swipe.Y can be used to apply force upwards

• Would someone mind posting a capx file with an example illustrating the effect I want to achieve?

• 8 posts