How do I AIM like Angry Birds style?

Get help using Construct 2

Post » Sun Mar 05, 2017 4:56 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.
Banned User
B
27
S
7
G
58
Posts: 1,229
Reputation: 34,790

Post » Sun Mar 05, 2017 5:13 pm

Message: willmonteirofx can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
lamar wrote: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.


Oh god... this system I already have and implemented, my problem is to create a aim that works! It's not the game system, it's just the aim! Its only it. I understand a bit of the system, but I can not imagine how to do the aim based on what I already have, do you understand?
B
15
S
4
G
1
Posts: 36
Reputation: 1,455

Post » Sun Mar 05, 2017 5:22 pm

willmonteirofx wrote:
Oh god... this system I already have and implemented, my problem is to create a aim that works! It's not the game system, it's just the aim! Its only it. I understand a bit of the system, but I can not imagine how to do the aim based on what I already have, do you understand?


The aim system uses physics to to determine the angle and impulse applied to the ball.

If you want an angry birds like game that is what they use.

Download the capx and run it and that is the aim system you described.

Sorry if that was not what you wanted because it sure is what you asked about!
Banned User
B
27
S
7
G
58
Posts: 1,229
Reputation: 34,790

Post » Sun Mar 05, 2017 5:34 pm

It's because I do not know to say "mira" that is a Portuguese word that represents what I have meant. For me it is aim/sight/crosshair/point that represent the trajectory of the ball. My problem is only with that. I can not implement. It's just that...

Image
B
15
S
4
G
1
Posts: 36
Reputation: 1,455

Post » Sun Mar 05, 2017 6:20 pm

willmonteirofx wrote:It's because I do not know to say "mira" that is a Portuguese word that represents what I have meant. For me it is aim/sight/crosshair/point that represent the trajectory of the ball. My problem is only with that. I can not implement. It's just that...

Image


OK what you are looking for is the ball trajectory.

Sorry we had some miss-communication.

I took Korbaach's capx and just adapted it so you can implement that in your game.

You will need all those global variables and copy the events related to aiming the ball and setting up the trajectory line.

https://www.dropbox.com/s/08q5wetln1eiorl/Ball%20Trajectory.capx?dl=0
Banned User
B
27
S
7
G
58
Posts: 1,229
Reputation: 34,790

Post » Sun Mar 05, 2017 9:17 pm

@willmonteirofx

I was going to say I made an angry bird demo a couple years ago - but then I noticed the link was to that message thread, and lamar's capx was based on my example...

so, the only thing I will add is that if you want the dots to fade out like in the image you made at the beginning of this thread, then add an action at event 4 (Draw dotted line) that says:

Dot5 > Set opacity to (DotCount-loopindex) / DotCount * 100

and you may want to reduce the DotCount global variable to 40 or less. Otherwise they will always know they are going to get a basket! :)
B
95
S
33
G
20
Posts: 438
Reputation: 17,640

Post » Sun Mar 05, 2017 9:56 pm

AllanR wrote:@willmonteirofx

I was going to say I made an angry bird demo a couple years ago - but then I noticed the link was to that message thread, and lamar's capx was based on my example...

so, the only thing I will add is that if you want the dots to fade out like in the image you made at the beginning of this thread, then add an action at event 4 (Draw dotted line) that says:

Dot5 > Set opacity to (DotCount-loopindex) / DotCount * 100

and you may want to reduce the DotCount global variable to 40 or less. Otherwise they will always know they are going to get a basket! :)


Hey AllanR, I thought that CAPX looked familiar but I thought it was Korbaachs sorry. Good work!
Banned User
B
27
S
7
G
58
Posts: 1,229
Reputation: 34,790

Previous

Return to How do I....?

Who is online

Users browsing this forum: Solomon and 10 guests