### Author Topic: How to make a bullet curve  (Read 2527 times)

0 Members and 1 Guest are viewing this topic.

#### dove96

• Newbie
• Posts: 20
##### How to make a bullet curve
« on: April 03, 2016, 10:06:38 pm »
Hello c++&sfml gurus, i was just wondering if how would i make the bullet(artillery) of my tank curve?? i've been looking for clear explanations and tutorials for this but i haven't found any..

sorry if the question is too broad..
-dove96-

• Sr. Member
• Posts: 302
##### Re: How to make a bullet curve
« Reply #1 on: April 03, 2016, 10:14:14 pm »
Do you mean if you are viewing it side on and the curve is caused by gravity? if that is the case, horizontal velocity should stay constant or gradually decrease due to air resistance, while you need to apply a constant vertical deceleration. So store position, velocity and acceleration as 2d vectors and apply each dependent on how much time has passed.

#### dove96

• Newbie
• Posts: 20
##### Re: How to make a bullet curve
« Reply #2 on: April 05, 2016, 01:03:42 pm »
yes that is what i exactly mean..shadowmouse, i am really new to this, can you help me out to do this especially the coding? on what should be the attributes of the objects like for example the bullets and tanks. ,..

thank you for the valuable tip..
-dove96-

#### picnic

• Newbie
• Posts: 5
##### Re: How to make a bullet curve
« Reply #3 on: April 05, 2016, 02:17:34 pm »
You might find this simple explanation of help:

http://freespace.virgin.net/hugo.elias/models/m_fall.htm

Just substitute the word 'bullet' for 'particle'

#### nicox11

• Jr. Member
• Posts: 51
##### Re: How to make a bullet curve
« Reply #4 on: April 05, 2016, 02:21:20 pm »
Since your question is vague, you can simply search for vague answer. You should look for gravity implementation in 2D games.

If you have existing code, it may be useful to show it to us to help you implementing your bullet physic.

anything