- #1
Subliminalman
- 1
- 0
Currently I am making a small video game where a cat is constantly falling through the sky! I want to add in some trampolines that when hit you will bounce according to the trampolines angle.
What equation would I use to perform this function?
I have provided a picture to help illustrate what I am trying to achieve
For all of you programmers out there here is the code that I used so far
if (trampTime <= 0)
{
//trampRotation is in radians
character.velocity.Y = 10 * (float)Math.Sin(trampRotation);
character.velocity.X = 10 * (float)Math.Cos(trampRotation);
}
trampTime++;
if (trampTime > 30)
{
character.trampoline = false;
trampTime = 0;
}
Any help would be greatly appreciated
What equation would I use to perform this function?
I have provided a picture to help illustrate what I am trying to achieve
For all of you programmers out there here is the code that I used so far
if (trampTime <= 0)
{
//trampRotation is in radians
character.velocity.Y = 10 * (float)Math.Sin(trampRotation);
character.velocity.X = 10 * (float)Math.Cos(trampRotation);
}
trampTime++;
if (trampTime > 30)
{
character.trampoline = false;
trampTime = 0;
}
Any help would be greatly appreciated