Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Help with physics
- Alex5885
- Scratcher
1 post
Help with physics
I have looked at multiple physics tutorial videos but all of them involve cloning or a specific type of physics. What I currently have is something similar to Griff Patch's “getting over it” game, but I'm missing the acceleration from the force applied in the opposite direction. I have Griff's platformer gravity on the body sprite, but that isn't doing much other than bring the player back to the ground. If anybody can provide me with or link me to a physics code that matches what i am looking for that would greatly help me. Also, i am not sure if the clone physics actually work or not, i just don't have the time to remove the entire clone part of it just to test it out.
- MrKingofScratch
- Scratcher
100+ posts
Help with physics
How are you detecting force in the oposite direction? If it's decided in X and Y velocity, just mulitply those values by the force and then subtract those values from the xvel and yvel already in the sprite. If it's in the form of a direction, you can use sin dir to get the xvel and cos dir to get the yvel, and then just apply the steps above.
- Discussion Forums
- » Help with Scripts
- » Help with physics