Solving 2D Movement with Acceleration: A Puzzling Problem

Click For Summary
SUMMARY

The discussion focuses on solving 2D movement problems in game development, specifically determining acceleration vectors for objects to reach target coordinates. The user seeks to find a single acceleration vector that ensures the object passes through a target point or stops at it with zero velocity. The approach involves using kinematic equations to relate acceleration, velocity, and position over time, but the user encounters difficulties with quadratic equations. The conversation emphasizes the need for clarity on forces acting on the object, such as gravity, in a 2D surface game.

PREREQUISITES
  • Understanding of kinematic equations in physics
  • Familiarity with vector mathematics
  • Basic knowledge of game physics and mechanics
  • Experience with programming in a game development context
NEXT STEPS
  • Research kinematic equations for 2D motion in game physics
  • Explore vector manipulation techniques for acceleration and velocity
  • Learn about implementing physics engines in game development, such as Unity's Rigidbody
  • Investigate methods for simulating forces like gravity in 2D games
USEFUL FOR

Game developers, physics programmers, and anyone interested in implementing realistic movement mechanics in 2D games.

rippy
Messages
1
Reaction score
0
I'm kind of embarrassed I can't figure this out on my own... It's to be used to determine the movement of objects in a game (2d space). This is quite obviously something that has been solved many times over, but I haven't had any luck searching for an answer, so I thought I'd try here!

Homework Statement



You're given an initial xy-coordinate, an initial velocity vector, a target xy-coordinate, and the magnitude of the acceleration vector. The goal is one of the following:

(a) Find a single acceleration vector which ensures the object reaches the point (i.e. passes through the point).
(b) Determine how to apply acceleration such that velocity is zero when the target is reached (i.e. stop on the point)

I've been primarily trying to figure out the easier (a), but I'd like to figure both out eventually.

Homework Equations



Formulae for acceleration, velocity an position relative to time (these seem obvious so I'll omit them, hope that's okay).

The Attempt at a Solution



For (a): The object is at the point if its x-coordinate and y-coordinate match the target's coordinates at the same time. We can look at the separate x and y equations for calculating the object's position based on acceleration, time, initial velocity and initial position; then, by solving for time, we can equate them. Since we know the magnitude of the acceleration, and (a_x)^2 + (a_y)^2 = a, we have two equations and two unknowns and can solve. However, you end up with two equated quadratic formulae which is a huge pain to attempt to solve.

My next thought was to just try to calculate the ratio of (a_x)/(a_y), but I've had no luck with that either.

This isn't homework, so there's no need to be cryptic! It seems like somewhat of a homeworkey problem though so I thought it would be most appropriate to post here anyway. Currently my game objects are moving around at constant velocity and it is not satisfying at all.

Any help is appreciated, thanks!
 
Physics news on Phys.org


Is gravity involved? Is it a 2-D surface game? Once an object is launched, what forces are there that can slow it down? Lots of definition needed here.
 

Similar threads

Replies
7
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 14 ·
Replies
14
Views
2K
  • · Replies 12 ·
Replies
12
Views
3K
  • · Replies 3 ·
Replies
3
Views
1K
  • · Replies 12 ·
Replies
12
Views
1K
  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 17 ·
Replies
17
Views
3K
  • · Replies 1 ·
Replies
1
Views
4K