Tagged Questions
2
votes
1answer
285 views
android game-logic for shooter
Im creating a 2d game for android.
I'll just get right to it. I have a sprite controlled by a joystick that needs to shoot, sofar Ive managed to get direction and movement on my bullet, but then I ...
0
votes
2answers
509 views
Calculating angle between two vectors to steer towards a target
I have been trying to implement a path following steering behaviour for AI in a 2D racing game.
I have two vectors:
futurePosition represents the predicted future position given the car's current ...
2
votes
2answers
389 views
android 2d bullet-spawn (shooting)
This will be a quick question since Im pretty sure I'm overlooking something small that I for some reason cant see.
My sprite is moved using a joystick, and I want my sprite to be able to shoot. I've ...
3
votes
1answer
277 views
How to bounce a 2d point particle off of a circular edge
In a prototype I'm building, a particle can spawn anywhere within a larger, confining circle. Important to note is that the particle will not spawn in the origin of the larger circle, but anywhere ...
1
vote
1answer
118 views
How should I update vectors, et cetera, in a time-based fashion?
I'm trying to write something I believe is straightforward but wanted to check that I'm doing it right.
All I want is to update the position of a 2D sprite based an acceleration and velocity. I'm ...
5
votes
2answers
442 views
Collision Detection/Response in Vector-based levels
I have a 2D side scroller whose levels are stored as vectors (that is, a bunch of lines) which looks like this:
How would I detect that I'm colliding with one of these lines, and react accordingly ...
2
votes
1answer
434 views
Calculate the initial velocity of a 3D trajectory
I've got a 2D projectile code sample working, but would like to extend it to 3D. How would I calculate the initial velocity of the Z-axis? At the moment, I've got:
initVel.X = (float)Math.Cos(45.0);
...
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 ...
1
vote
1answer
261 views
Determining relative velocities on impact?
I'm trying to figure out a way to determine the relative velocity of a body colliding with another in a 2D environment.
For example if one body is moving at (1,0) and another traveling behind it ...