How To Compute Y Velocity For A Projectile - Emulating an online Disney game

In summary, the conversation is about trying to emulate physics in an online Disney game called Kid vs Kat Katapult Katastrophe. The person is looking for advice on how to calculate the initial Y velocity for a projectile motion in the game. They mention using an equation of motion to solve for the initial Y velocity based on the final vertical position, initial vertical position, time, and acceleration due to gravity. They also mention that they are subtracting a gravity constant from the Y velocity every update loop.
  • #1
SunShadow
1
0

Homework Statement



I am trying to emulate the physics in an online Disney game.

Kid vs Kat Katapult Katastrophe

It helps to describe it graphically, so if you wish to take a look, play as Kat (the right option) at the following link:

bit.ly/doqEkp

IMPORTANT: Play as KAT (not Coop) the selection on the right.

So when shot, the ball always takes the same amount of time (about four seconds) to travel either near or far.

Homework Equations



- NONE -

The Attempt at a Solution



So what I have is an initial X/Y/Z position (say 0,0,0) and destination position Xd/0/Zd (Y will be zero for start and end positions, as Y is the ground.)

If you see how the ball travels, I know I can compute the X and Z velocities by dividing distance (the difference between start and end positions) by time, but I am stumped when it comes to working out the launch Y velocity.

All I do know is that I am subtracting a gravity constant from my Y velocity every update loop of the game.

I want to shoot out the ball, so that it lands at the destination point (which I know.)

What I don't know is the Y velocity to launch the ball with.

Does anybody have any advice?
 
Physics news on Phys.org
  • #2


Hi there,

It seems like you are trying to simulate projectile motion in your game. In order to determine the initial velocity in the Y direction, you can use the equation of motion:

Yf = Yi + Viy*t + 0.5*g*t^2

Where Yf is the final vertical position, Yi is the initial vertical position, Viy is the initial vertical velocity, t is the time, and g is the acceleration due to gravity (which you mentioned you are subtracting from the Y velocity every update loop).

Since you know the final vertical position (Yd), the initial vertical position (0), and the time (4 seconds), you can solve for Viy. This will give you the initial Y velocity that you need to launch the ball with in order to hit the destination point.

I hope this helps! Let me know if you have any further questions. Best of luck with your game!
 

1. How do I calculate the Y velocity for a projectile?

The formula for calculating the Y velocity of a projectile is: Vy = V0y + gt, where Vy is the final Y velocity, V0y is the initial Y velocity, g is the acceleration due to gravity (9.8 m/s^2), and t is the time in seconds.

2. What is the initial Y velocity for a projectile?

The initial Y velocity (V0y) of a projectile is the vertical component of the initial velocity. This can be calculated by multiplying the initial velocity (V0) by the sine of the launch angle (θ). V0y = V0sin(θ)

3. How do I find the launch angle (θ) for a projectile?

The launch angle (θ) can be determined by using trigonometry. The formula is: θ = tan^-1(Vy/Vx), where Vy is the vertical velocity and Vx is the horizontal velocity.

4. Are there any factors that can affect the Y velocity of a projectile?

Yes, there are several factors that can affect the Y velocity of a projectile. These include air resistance, the angle of launch, and the initial velocity. The mass and shape of the projectile can also have an impact on the Y velocity.

5. How can I use these calculations to emulate an online Disney game?

By using the formulas and equations for calculating Y velocity, you can accurately simulate the motion of a projectile in a game. This can be useful for recreating the physics and gameplay of online Disney games, such as throwing a ball or launching a character into the air.

Similar threads

  • Introductory Physics Homework Help
Replies
10
Views
3K
Replies
4
Views
838
  • Introductory Physics Homework Help
Replies
2
Views
869
  • Introductory Physics Homework Help
Replies
6
Views
9K
  • Introductory Physics Homework Help
Replies
25
Views
2K
  • Introductory Physics Homework Help
Replies
21
Views
2K
  • Introductory Physics Homework Help
Replies
5
Views
1K
  • Introductory Physics Homework Help
Replies
2
Views
745
  • Introductory Physics Homework Help
Replies
14
Views
2K
  • Introductory Physics Homework Help
Replies
2
Views
17K
Back
Top