The motion physics of the objects sailing through the air, ranging from thrown baseballs to battleship cannonfire to falling rocks.

learn more… | top users | synonyms

12
votes
4answers
4k views

2D tower defense - A bullet to an enemy

I'm trying to find a good solution for a bullet to hit the enemy. The game is 2D tower defense, the tower is supposed to shoot a bullet and hit the enemy guaranteed. I tried this solution - ...
68
votes
15answers
11k views

How are bullets simulated in video games?

I have been playing games like MW2 recently and, as a programmer, I tend to ask myself how do they make the game so immersive. For example, how to they simulate bullet speed. When an NPC fires a ...
9
votes
3answers
2k views

Projectile Motion - Arrow

In a 2D game, I simply want to draw the trajectory of an arrow in flight. With the code below, the trajectory (the parabola) looks right, but the angle (or rotation) or the arrow isn't. float g = ...
5
votes
2answers
2k views

How can I find a projectile's launch angle?

I am making a 2d game in which units fire arrows at each other. I know the shooter's and the target's position and the initial velocity of the projectile. I want to know the angle the projectile ...
9
votes
4answers
900 views

What's the most efficient way to find the intersection point of a missile and a bitmap terrain?

Following up on my earlier question about finding the slope of a 2D bitmap terrain I now need to know the best way of finding the point on the 2D terrain that the missile hit. Obviously, I can see if ...
6
votes
4answers
1k views

Determing an object's position along a curve over time

I have some objects in my game which are "thrown". At the moment I am trying to implement this by having these objects follow a parabolic curve. I know the start point, the end point, the vertex and ...
4
votes
1answer
234 views

How to account for acceleration when aiming projectiles?

How do I aim a constant speed projectile to hit a target if there is a constant acceleration vector acting on it? (For example, the wind and gravity from Worms.)
4
votes
2answers
639 views

Tracking Object Position - Firing on a Trajectory

How can I calculate the position of an object after "firing" it from a fixed point? I am to create a small game - most likely with canvas (pure HTML, JS based) or Adobe Flash - in which the player ...
2
votes
2answers
2k views

SDL Bullet Movement

I'm currently working on my first space shooter, and I'm in the process of making my ship shoot some bullets/lasers. Unfortunately, I'm having a hard time getting the bullets to fly vertically. I'm a ...
9
votes
4answers
611 views

Calculating missile trajectory around orbits before shooting

I'm building a game with Unity3D. It's a Gravity Wars clone. Both player and AI turrets shoot missiles at each other (giving an Angle and a Power variables), trying not to crash missiles on planets. ...
7
votes
1answer
718 views

How to make an arrow land at a specific position in 3D world space

In my game when I click with the mouse on the terrain somewhere, I'd like the player to fire an arrow to that position in a parabolic fashion. The arrow has a position, acceleration and velocity all ...
1
vote
4answers
1k views

Solving for velocity in the x/y/z axes?

In a 3D environment I have an object with a displacement x that I know I need to traverse in a given time interval. I have the object's heading and elevation and I want to figure out the distance the ...
14
votes
5answers
2k views

How to calculate turn heading to a missile?

I have a missile that is shot from a ship at an angle, the missile then turns towards the target in an arc with a given turn radius. How do I determine the point on the arc when I need to start ...
9
votes
1answer
1k views

Adding air drag to a golf ball trajectory equation

I'm developing a 2D golf game in VB.NET 2005, but I am stuck on how to implement air or wind drag that should affect the ball. Already I have these equations for projectile: Vo ...
10
votes
2answers
499 views

How do I make good guy attacks only hit bad guys and vice versa?

My game has many different type of good guys and many different type of bad guys. They will all be firing projectiles at each other but I don't want any accidental collateral damage to occur for ...
2
votes
2answers
1k views

Find meeting point of 2 objects in 2D, knowing (constant) speed and slope

I have a gun which fires a projectile that has to hit an enemy. The problem is that the gun has to be automatic, i.e. - choose the angle in which it has to shoot, so that the projectile hits the enemy ...
-2
votes
1answer
258 views

how to predict enemy postion to shoot bullet same kingdom rush

i'm doing a tower defense game same kingdom rush, enemy can run curve not only linearly. i found this link : 2D tower defense - A bullet to an enemy but this link use only for enemy run linearly. ...
4
votes
1answer
872 views

Realistic Trajectory of a Projectile

When simulating an airplane and a missile, to get them moving in the air we apply a force in one direction. Now an airplane has wings that keeps it afloat while a missile can have fins to stabilize ...