Looking for equation/formula for calculating boomerang trajectory based on few variables for game

  • #1
ZeroX4
1
0
So basically i am vary green when it comes to equations/formula
Well to the point i don't even know if proper name for what i'm looking for is called equation or formula but let's stick to equation

So going as simple as i can
I want to throw boomerang creating boomerang like ellipse trajectory based on few variables
Kinda egg shape trajectory but being able to adjust it
Right now i am only able to make water drop like shape and either make it smaller or bigger but it scales proportionally
But that is because i am calculating trajectory based on distance of boomerang from player
And i know no other way to do it

Where i need to work in a way by me providing only few variables
Force - which applied to boomerang will push it in that direction in pixels/s
Angle - i am able to rotate trajectory of flight
So for example i can push boomerang 10 pixels per second in 90° angle yet i can offset it to -15° (i can put here any value)
Where i have two options
A - give boomerang values throw it and it will run on these values constantly without me being able to change them
B - constantly applying these 2 values where i am perfectly able to manipulate them at any given moment

Thing is i made power bar which charges on its own and when i throw boomerang at what % power was at the moment will be how strong throw will be
And based on that i calculate both Force and Angle values

My other problem is i can make perfect circles and water drop shapes of trajectory
But that is because i loop applied force by 360 so it goes from 0 to 360 then restarts from 0
Then i made equation to fly boomerang with that 180- that force
So it starts from 180 goes to 0 then starts going negative and goes down to -180 and after that it goes back to 180 and whole cycle loops again

I know no other way of doing it so i am stuck and that's why i came here to ask for help

And more or less i would be able to at least achieve two trajectory models
1714626040823.png


Either blue and red where they are evenly round on each side but squeezed either horizontally or vertically
Or green and purple
Where they are more rounded on one side but stretched on other
Kinda like balloon shape
Well if all 4 would be possible i would more than happy
I was on wiki i went into adventure with papu google
Yet all i find is how to calculate boomerang trajectory
And not how to make equation for a throw based on some values
And like i said i have 2 options
1 - i can throw it with static values which i cannot change when its flying
2 - i can throw it with dynamic values which i can constantly change
Where these values are force applied to boomerang in which it will move in pixels/s and angle of trajectory

I would wish to add option for my player ingame to gain power ups so he can throw boomerang faster but not in longer distance

So for example boomerang from moment of throw returns to player in 2 seconds instead of 3
But in both cases peak of distance between boomerang and player being some amount for example 100 (so i won't end up juicing it to the point it will fly most of the time off screen)

And that's why i would need equation to divide some value by other value so it scale proportionally

I am open for all ideas
 

Similar threads

Replies
4
Views
1K
  • Introductory Physics Homework Help
Replies
5
Views
2K
  • Introductory Physics Homework Help
Replies
5
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
7
Views
2K
Replies
1
Views
843
Replies
2
Views
2K
Replies
4
Views
1K
  • Aerospace Engineering
Replies
2
Views
2K
Replies
6
Views
2K
Replies
3
Views
1K
Back
Top