top of page

Android Game using Parabolic Trajectory

Updated: Nov 18, 2020

Projectile motion is a form of motion where an object moves in a bilaterally symmetrical, parabolic path. The path that the object follows is called its trajectory. Projectile motion only occurs when there is one force applied at the beginning on the trajectory, after which the only interference is from gravity.


What are the Key Components of Projectile Motion?

The key components that we need to remember in order to solve projectile motion problems are:

  • Initial launch angle, θ

  • Initial velocity, u

  • Time of flight, T

  • Acceleration, a

  • Horizontal velocity, Vx

  • Vertical velocity, Vy

  • Displacement, d

  • Maximum height, H

  • Range, R


Parabolic Trajectory

We can use the displacement equations in the x and y direction to obtain an equation for the parabolic form of a projectile motion:





Let in time t, horizontal distance travelled by object is x and vertical distance travelled is y.For horizontal motion: Since the velocity of object in horizontal direction is constant hence horizontal acceleration ax​ will also be zero. The position of object in horizontal direction at any time t is given by: x=x0​+ux​t+1/2ax​t2

where, x0​=0 (distance covered at t=0)  ax​=0 ux​=ucosθ

Hence, x=0+ucosθt+1/2(0)t2=ucosθ t=x/(ucosθ) ..................eq(1) For vertical motion: Since, the velocity of object in vertical direction is decreasing due to gravity. Hence, vertical acceleration: ay​=−g The position of object in vertical direction at any time t is given by: y=y0​+uy​t+1/2ay​t2 where, y0​=0 (distance covered at t=0) ay​=−g uy​=usinθ Hence, y=0+usinθt+1/2(−g)t2 y=usinθt−1/2gt2 .........eq(2)







This is the expression to calculate the height Y as a function of the distance X.

g = 9.8 m / s

The angle in degrees.

We put the speed in km / h using the Slider, but then we divide it by 3.6 to pass it at m / s.

If y <= 0, it is on the ground. For the Clock.

The Ball moves in the X and Y coordinates.

In addition, a trajectory line is drawn.

- Notice that the Y ordinate evolves from top to bottom, that's why I have put [200 - Y] to draw its points.

Try other values ​​with the dimensions of your mobile USING THE SLIDER.


Creating the Android Application for the Parabolic equation is given below:


Screen 1.

Screen 1.


Download app:


Main page

Math block for the equation


=======================================================================

Creating the Android Application for the Parabolic SHOT GAME is given below:

Scree1:

Scree1:


Main Page:

Math block for the equation:






Demo:


Download app:


79 views0 comments

Comments


bottom of page