SFML community forums
Help => General => Topic started by: dove96 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..
any suggestions please??
sorry if the question is too broad..
-
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.
-
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..
-
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' :D
-
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.