How do I AIM like Angry Birds style?

Get help using Construct 2

Post » Sun Mar 05, 2017 1:37 pm

Message: willmonteirofx can only post plain text URLS until they have 500 rep. 2 URLS modified. Why?
Hello! I'm trying to create an AIM similar to that of Angry Birds!

Image

My game is a Basketball game and I wanted to be able to implement an Aim similar to the Image that I created.

Image

Here is the original project
http://bit.ly/2lNSFDk

Here is my attempt to create the aim
http://bit.ly/2mTykNR
Last edited by willmonteirofx on Sun Mar 05, 2017 2:05 pm, edited 2 times in total.
B
15
S
4
G
1
Posts: 36
Reputation: 1,455

Post » Sun Mar 05, 2017 1:47 pm

Physics.

While stretching your rubber band, just do :
every X seconds | Projectile spawn Balls

Give the balls a Hang_Time instance variable
Every tick :
| Set Balls X to [Equation] x(t) = x0 + v0xt
| Set Balls Y to [Equation] y(t) = y0 + v0yt – ½gt2 (Btw, You need to modify this to negative since Y axis is reversed in C2 )
| Balls Hang_Time + dt


Here's some additional reading:
http://scipp.ucsc.edu/outreach/04Projec ... Motion.pdf
https://www.maplesoft.com/content/Engin ... Motion.pdf
Image Image Image
B
31
S
11
G
27
Posts: 748
Reputation: 17,093

Post » Sun Mar 05, 2017 2:17 pm

B
66
S
24
G
7
Posts: 1,515
Reputation: 11,041

Post » Sun Mar 05, 2017 2:34 pm

I'll try, I'll be back soon!
B
15
S
4
G
1
Posts: 36
Reputation: 1,455

Post » Sun Mar 05, 2017 2:57 pm

Okay, I came back and I did not succeed.

I looked at the files, tried to adapt, but unfortunately, it's not what I'm looking for, I believe there are simpler ways to do it. I have a simple system to pull and release the ball, I just need a aim that project my ball.

If any of you can take a look at how I've done, to see what you can do, I'll thank you immensely.
B
15
S
4
G
1
Posts: 36
Reputation: 1,455

Post » Sun Mar 05, 2017 3:02 pm

willmonteirofx wrote:Okay, I came back and I did not succeed.

I looked at the files, tried to adapt, but unfortunately, it's not what I'm looking for, I believe there are simpler ways to do it. I have a simple system to pull and release the ball, I just need a aim that project my ball.

If any of you can take a look at how I've done, to see what you can do, I'll thank you immensely.


As far as I can see, the link provided by korbaach has an example .capx that does exactly what you require regarding the aiming line.
If your vision so exceeds your ability, then look to something closer.
Moderator
B
134
S
30
G
86
Posts: 5,419
Reputation: 59,524

Post » Sun Mar 05, 2017 4:13 pm

OK here is the CAPX to download:

https://www.dropbox.com/s/wwhnaw9v9bl5w7f/Basketball%20Shoot.capx?dl=0

This uses just 5 events:

Image


The ball, net, floor and backboard all have physics behaviors. Click on their behaviors and look at the settings. I also created a net guide sprite that is hidden with physics behavior so the ball goes down through the net smoothly.

The catapult or pivot arm is that green box with the star. I made it invisible but you will see it in the layout.

The physics settings are just a formula to determine how far you pull back on the ball and that determines how fast and at what angle the ball is released.

You can increase the IMPULSE if you want the ball to go faster or decrease the ball density in the ball physics settings.

The game automatically resets after 5 seconds when the ball collides with the ground.

That should get you started on your game and looks like a lot of fun. I made 3 baskets out of 10 shots!

Image

NOTE: I did not create this CAPX and it is included with C2 as a catapult example. I just modified it and tweaked the physics to be a basketball shoot game.
Last edited by lamar on Sun Mar 05, 2017 5:01 pm, edited 2 times in total.
Banned User
B
27
S
7
G
58
Posts: 1,229
Reputation: 34,790

Post » Sun Mar 05, 2017 4:15 pm

But I believe there is a simpler way to do it, all these equations are very complex I can not quite understand :/
B
15
S
4
G
1
Posts: 36
Reputation: 1,455

Post » Sun Mar 05, 2017 4:18 pm

willmonteirofx wrote:But I believe there is a simpler way to do it, all these equations are very complex I can not quite understand :/



Physics just looks complex but once you understand the basic physics terms it is actually quite easy and for games like yours that is what you will need if you want realistic gravity and arc on your ball.

Give me a little while to get woke up and I will make an easy to follow capx example with just a few events.
Banned User
B
27
S
7
G
58
Posts: 1,229
Reputation: 34,790

Post » Sun Mar 05, 2017 4:19 pm

lamar wrote:
willmonteirofx wrote:But I believe there is a simpler way to do it, all these equations are very complex I can not quite understand :/


Physics just looks complex but once you understand the basic physics terms it is actually quite easy and for games like yours that is what you will need if you want realistic gravity and arc on your ball.

Give me a little while to get woke up and I will make an easy to follow capx example with just a few events.


I would greatly appreciate it!
B
15
S
4
G
1
Posts: 36
Reputation: 1,455

Next

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 42 guests