The motion physics of the objects sailing through the air, ranging from thrown baseballs to battleship cannonfire to falling rocks.
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 ...
13
votes
5answers
1k 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 ...
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 - ...
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 ...
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 ...
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.
...
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 = ...
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 ...
6
votes
1answer
223 views
How do I change the speed of an object without changing path travelled?
I have a ball which is being thrown from one side of a 2D space to the other. The formula I am using for calculating the ball's position at any one point in time is:
x = x0 + vx0*t
y = y0 + vy0*t - ...
5
votes
4answers
926 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
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 ...
4
votes
5answers
456 views
Trying to make a game with C++, using lists to store bullets and enemies, but they are not erased
I've been trying to make a pretty simple space shooter game with C++, and I have been having a lot of trouble trying to use lists to store enemies and bullets.
Basically I followed the post here ...
3
votes
1answer
470 views
Maximum range of projectile fired at given force and elevation
I've gone over this again and again, and my result is obviously wrong when viewed in-action. Here's the initial formula I converted (first one):
http://en.wikipedia.org/wiki/Range_of_a_projectile
...
3
votes
2answers
120 views
Discover x,y coordinates given set arc distance and rotation
I have a turn-based car simulation. My vehicles have a maximum speed they can travel in a round, as well as a maximum amount they can change their heading over the course of a round. Say, 20 meters ...
3
votes
3answers
291 views
Adding 'swerve' to a direction
I'm not much of a maths expert, so this is probably quite straight forward. I was playing a soccer flash game where you take free kicks. You provide Power, Swerve and Direction. I'm reading up on ...
3
votes
4answers
316 views
Forcing one projectile to follow close behind an initial projectile
I'm shooting out a projectile and I want another projectile to closely follow it. I can't simply shoot out the second projectile at a slightly lesser time because the first projectile may change ...
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 ...
2
votes
3answers
726 views
How do I calculate the exit vectors of colliding projectiles?
I'm trying to create projectiles which bounce/ricochet off one another when they collide in mid-air.
All projectiles are spherical and have identical size, mass, and speed. Each has two vectors: one ...
2
votes
2answers
619 views
Physic of an arrow in flight
What are the formulas which represent the horizontal and vertical displacement of an arrow in flight (as well as it angle)? I would like to make sure that I take into consideration the arrow's fluid ...
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 ...
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 ...
2
votes
0answers
101 views
Initial direction of intersection between two moving vehicles? [duplicate]
Possible Duplicate:
Predicting enemy position in order to have an object lead its target
I'm working with a bit of projectile prediction for my AI and I'm looking for some ideas, any input?
...
2
votes
2answers
230 views
What is a technique for 2D ray-box intersection that is suitable for old console hardware?
I'm working on a Sega Genesis homebrew game (it has a 7mhz 68000 CPU). I'm looking for a way to find the intersection between a particle sprite and a background tile. Particles are represented as a ...
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 ...
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 ...
1
vote
1answer
288 views
How are trajectories calculated and transmitted to other players in Multi-Player?
I play alot of COD4. And can see tracers for gunfire, missles, care packages fall from helicopters etc.
There is alot of activity. I am curious to know the algorithm (at a high level) that manages ...
1
vote
2answers
263 views
Simplified trajectory equation to identify Time Taken(t) by a protectile to travel Distance(d), under gravity?
I am building a game, where I have to plot a trajectory of a ball in 3D space, launched with an inital velocity Sx, Sy, Sz. [I am using OpenGL and Android-NDK]
Lets assume Sz is always 0. And Sx ...
1
vote
1answer
427 views
How make a laser path prediction line like a “slingshot cowboy” game?
How so I make a laser path prediction line like a “slingshot cowboy” game in cocos2d or box2d and select the target like "slingshot cowboy" game.
1
vote
1answer
229 views
Bullets and projectiles in component based entity systems
Currently one of my games engines written for a shooter seems to work correctly.
Currently projectiles are sparse, travel quite slowly and are synced over network they are generated as entities.
...
1
vote
0answers
415 views
Why are my Box2D bodies disappearing when they collide?
I have a Box2D simulation going on and a system that loads the bodies and its' shapes from a text file definition.
I create a new physics world, i load bodies into it, from one of these files. ...
0
votes
1answer
623 views
How to find which side of a collider has been hit from hit.normal?
In Unity3d, i can get the normal of the surface with which the collider collides using hit.normal, but is there a way to find which side has been hit what is provided bu Unity3d?
One solution is to ...
0
votes
2answers
385 views
Undeviating bullet in AndEngine
I'm looking for a bullet that can collide with other bodies of the world but doesn't change direction according to collisions. I want the bullet to perform the collisions but without changing its own ...
-1
votes
2answers
119 views
Javascript - create a new bullet instance every time a user event is triggered
Basically I have a function that I need to create an object of every time the user presses space(event listeners not shown here).
function arrow(){
this.x = playerXPos + 40;
this.y = ...
-5
votes
5answers
2k views
How can I implement projectile motion like Angry Birds? [duplicate]
Possible Duplicate:
Tracking Object Position - Firing on a Trajectory
I need help in implementing the projectile motion in my game as was implemented in Angry Birds.
Please help.

