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

0
votes
0answers
112 views

Calculating Projectile Movement

I'm having some trouble putting together a method that will constantly move a "bullet" in the same direction accurately. Here is what I have so far public Vector3f moveFromPosition(Vector3f location, ...
0
votes
0answers
123 views

Creating a arc path connecting two GameObjects in Unity

I am working on a game on a spherical surface which first of all is a big challenge in itself. I want to create a path on an arc which connects two points ( seen in the image ) and show an arc path ...
0
votes
0answers
16 views

Projectile Motion in lwjgl with java [duplicate]

I was trying to make a game with a bow and arrow using lwjgl but I couldent get the arch right. I have a function called projectile that is updated once a frame for each arrow. my frame cap is at 60 ...
-1
votes
1answer
192 views

Projectile motion based off angle

I was using this code to hit an object that is moving horizontally(from right to left) and player on the left is throwing bullets to hit the object.But, what I am finding difficult is projectile ...
3
votes
1answer
104 views

What formula does this projectile velocity code derive from?

//Calculate the velocity needed to throw the object to the target at specified angle. float projectile_Velocity = target_Distance / (Mathf.Sin(2 * firingAngle * Mathf.Deg2Rad) / gravity); ...
0
votes
1answer
86 views

Physics / drag of object falling through atomsphere [closed]

Trying to simulate an object plunging into atmosphere. It seems to work, until the velocity falls past terminal velocity... down to zero... and then back up! Something must be wrong with how I am ...
-1
votes
1answer
252 views

Trajectory Projectile with Collision Detection

Right now I am trying to create projectile for cannon in which I want to detect collision also. At present I have simple working projectile after using two references Unity – How to display ...
0
votes
1answer
271 views

Aim at moving target (or predicting target's position at time it takes for projectile to hit it) [duplicate]

I have a game where I know the location and velocity of my target. I know my own location and the speed of my projectile. I want to determine either the location of the intersection between my ...
2
votes
1answer
465 views

What units does Sprite Kit use for physics?

I'm developing a simple ball game in Sprite Kit. I need to predict the ball's trajectory, so I went back to my physics book for the equations for acceleration, time, speed and space. The problem is ...
0
votes
1answer
340 views

How do I determine a good path for 2D artillery projectiles?

I'm building a little "tank wars" game (like this one). I understand the math, and I am able to define a parabola from the launcher to the objective I want to reach. The parabola depends on the ...
2
votes
1answer
184 views

Calculating/Predicting a way

I'm just starting with physics, so I'm not always sure about what I'm doing. It's a 2D project but I'm using 3D physical objects like SphereCollider etc.. What I have: Objects floating in space and ...
-2
votes
2answers
141 views

What kind of calculations do I have to make for projectiles? [closed]

I could never find out, how to create projectiles in a 2D game. Does it need linear algebra? If not, what to do to calculate its path? I just simply want to create a projectile that follows a ...
2
votes
3answers
235 views

How can I determine trajectory from distance and time, without initial velocity?

I'm attempting to develop a Mortar that needs to lead it's shot to the target enemy. The shot will have a pre-determined constant flight time of (2.5 seconds) and it will have where the enemy should ...
5
votes
1answer
170 views

Tracing a 2d path through multiple gravity fields

For a projectile starting at origin O, an initial velocity V, and several stationary planets P[n], how would I pre-calculate and store the path it would take without actually stepping through each ...
-1
votes
1answer
461 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. ...
2
votes
1answer
1k views

Rotate image around a specified origin

I'm trying to rotate my Turret.png (small Gunhead with a laser in front) towards the mouses location on the screen. I tried just using my method for rotating projectiles towards the next step on their ...
1
vote
1answer
295 views

Calculating projectile velocity from moving object

I'm working on a top down space shooter and am having trouble with calculating/understanding the physics for projectiles launched from the space ship. The ships have a velocity vector and a turret ...
10
votes
2answers
533 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 ...
0
votes
2answers
244 views

How to know when a bullet has hit its destination in a game with a fixed timestep? [duplicate]

@James is wording my question better than I am, so I figured I'd put this here: I believe what you are asking is that you have a bullet moving in a game with a fixed timestep and that when the ...
4
votes
1answer
276 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.)
5
votes
2answers
4k 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 ...
3
votes
2answers
592 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 ...
-1
votes
2answers
602 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 = ...
1
vote
1answer
376 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. ...
2
votes
0answers
104 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? ...
7
votes
1answer
915 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
1answer
568 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
2answers
375 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 ...
4
votes
5answers
811 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 ...
0
votes
2answers
544 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 ...
2
votes
2answers
264 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 ...
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
685 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
0answers
652 views

Why are my Box2D bodies disappearing when they collide? [closed]

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
863 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 ...
1
vote
4answers
2k 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 ...
3
votes
3answers
2k 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 ...
-5
votes
5answers
4k 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.
12
votes
4answers
5k 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 - ...
4
votes
2answers
716 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
866 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 ...
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 = ...
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 ...
1
vote
1answer
316 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 ...
71
votes
15answers
13k 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
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 ...
3
votes
1answer
497 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 ...
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 ...
3
votes
3answers
327 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 ...
6
votes
1answer
244 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 - ...