# How the aiming feature works on angry birds

Hi,

Can you please guide me to understand the aiming feature on a game like Angry Bird?

regard,

You need some sort of projectile trajectory prediction.

Exact algorithm heavily depends on how your projectile (in this case, a bird) works.

For an example on how to achieve this you can read this article by KidsCanCode: Draw trajectory :: Godot 3 Recipes

Or watch this video which is based on that article: https://www.youtube.com/watch?v=Mry6FdWnN7I

My question is just this curved line part that you can see in the image:

If you are not using Godot, then you are in a wrong place to ask questions.

If you need help in implementing this in some other engine youâ€™d better ask at https://gamedev.stackexchange.com/ or at your engine-related community.

We just discussed this internally and decided to allow game engine agnostic questions. So as long as this isnâ€™t â€śhow to do it in engine XYZâ€ť this is perfectly fine

Game engine agnostic questions are helpful for everyone, including Godot users.

What we donâ€™t want is providing support for other engines, that would be out of scope for this forum.

6 Likes

If you want to calculate the displacement of a projectile as in Angry Birds, you need to calculate a ballistic trajectory.
In 2D with Y axis downward (like in Godot) you have:

``````Î¸ = intial_velocity_angle
x = intial_veloity * cos(Î¸) * time
y = 0.5 * gravity * time^2 - intial_veloity * sin(Î¸) * time - initial_heigth
``````

3 Likes

In this 'x(t) = x0 + v0 * t + 0.5g * t^2 â€™ what do you mean by the time word? Will the bird collide with the obstacles at this time? Where should we place the pixels?

what do you mean by the time word? Do we expect the bullet or bird to collide with the obstacles at this time?
Where should we place the pixels?

We can not help you with collisions as you do not use Godot. You need to ask in the community for the Engine/Framework you use.

Itâ€™s fine to ask for general math advice like you did, but we canâ€™t give you specific answers outside of Godot.

Assume I use Godot. I will understand.
Even if you give a very general explanation, I will understand
â€‹Just the alguryrhim is important for me.