• ### What is your GameDev Story?

#### Archived

This topic is now archived and is closed to further replies.

# Simple 2d Physics

This topic is 7111 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

ok I'm trying to make a bullet move throught the air.

SX = Starting X
SY = Starting Y
DX = Destination X sorta
DY = Destination Y sorta
V = Vilocity Along Line

and what I need is

XV = X vilocity
YV = Y vilocity

any Ideas?

------------------
Great Milenko

Words Of Wisdom:
"Never Stick A Pretzel In Your Butt It Might Break Off In There."

http://www.crosswinds.net/~milenko
http://www.crosswinds.net/~pirotech

##### Share on other sites
Vx = Xd - Xs / t
Vy = Yd - Ys / t

t is total time. If t is not known, normalize the vector V, i.e.,

Vx = Xd - Xs
Vy = Yd - Ys
|V| = sqrt((Vx ** 2) + (Vy ** 2))
Vx /= |V|
Vy /= |V

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 9
• 13
• 9
• 9
• 15
• ### Forum Statistics

• Total Topics
634071
• Total Posts
3015340
×