The motion physics of the objects sailing through the air, ranging from thrown baseballs to battleship cannonfire to falling rocks.
10
votes
4answers
2k 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 - ...
65
votes
15answers
8k 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 ...
7
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 = ...
4
votes
2answers
394 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 ...
8
votes
4answers
787 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 ...
2
votes
2answers
450 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 ...
1
vote
2answers
1k 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 ...
8
votes
4answers
502 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.
...
1
vote
4answers
752 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 ...
9
votes
1answer
954 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 ...
2
votes
2answers
841 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 ...
6
votes
1answer
464 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 ...
3
votes
1answer
762 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 ...