Hey ho, I've attached the fla. Just basics of platform game making the character able to jump and stand on platforms. I've had this problem both times I've done this code.
Problem: The character floats to a platform if you jump near it or under it. Why is this and how can I fix it? Also why does the character sort of shake up and down when standing still?
I only looked at the code breifly but I'm pretty sure that the floating problem is caused by your hitTests. In a situation like this, test the characters feet, not the clip itself.
For problem two, he shakes because when you land on the ground, gravity should be set to 0. Reset it back to it's default value when the play falls or jumps.
The 'Boose':
ASUS Sabertooth P67 TUF
Intel Core i7-2600K Quad-Core Sandy Bridge 3.4GHz Overclocked to 4.2GHz
8GB G.Skill Ripjaws 1600 DDR3
ASUS ENGTX550 TI DC/DI/1GD5 GeForce GTX 550 Ti (Fermi) 1GB 1GDDR5 (Overclocked to 1.1GHz)
New addition: OCZ Vertex 240GB SATA III SSD WEI Score: 7.6
I'll take this opportunity to post yet again: http://tidenburg.co.uk/node/3
that tutorial includes how to stop the shaking and snapping to platforms.
"I'd only told them the truth. Was that so selfish? Our integrity sells for so little, but it is all we really have. It is the very last inch of us, but within that inch, we are free."
Just completed first tutorial, really great. So much clearer than others I read and the hitbox thing on the characters feet is exactly what I needed! GReat job! Although the character becomes stretched when I press left/right
OK. I sent you the answer via PM but for others who have this problem:
Ok the reason its stretching is because at some point you've made the player movieclip a different size using the free transform tool. To fix this we have to find out what xscale your player is currently at which we do by adding player.dScale as a variable at the beginning. Then instead of make ._xscale -100 and 100 we make it -player.dScale and player.dScale. Here is the fixed code.
Theres probably another, simpler way around this but thats my method
"I'd only told them the truth. Was that so selfish? Our integrity sells for so little, but it is all we really have. It is the very last inch of us, but within that inch, we are free."