I've always had a problem with y velocity collision in platformers. Usually, if dropped from a great height, a sprite will fall through the ground. I realize that I can easily correct this by making a sprite always "float" up by 1 pixel if its touching the ground, but that makes the sprite look like it's vibrating up and down, and also feels a bit cheesy. I've seen a few platformers which use y velocity, and still get past this/these problem(s).
How can I get better y collision? Is there a way to do it 1s1s?
Offline
Ah yes. That's always frustrating. To be honest, I'm not totally sure; I don't make platformers much. I suspect that it's use of a bigger sensor, and/or just a better algorithm for deciding movement when touching the ground.
Offline
Harakou wrote:
Ah yes. That's always frustrating. To be honest, I'm not totally sure; I don't make platformers much. I suspect that it's use of a bigger sensor, and/or just a better algorithm for deciding movement when touching the ground.
![]()
I feel like my mind knows the answer, but it's going so fast I can't read it- It's on the tip of my mind.
Last edited by Sunrise-Moon (2010-12-24 02:01:16)
Offline
Hang on, I have the script segment somewhere in my pictures.
Here it is:
Last edited by Kileymeister (2010-12-24 10:36:28)
Offline
Kileymeister wrote:
Hang on, I have the script segment somewhere in my pictures.
Here it is:
http://i56.tinypic.com/10crjo5.gif
Thank you! That'll work perfectly! The only problem is it doesn't really detect slopes at all. I can probably fix it with a slope sensor or something, though.
Offline
Sunrise-Moon wrote:
Kileymeister wrote:
Hang on, I have the script segment somewhere in my pictures.
Here it is:
http://i56.tinypic.com/10crjo5.gifThank you! That'll work perfectly! The only problem is it doesn't really detect slopes at all. I can probably fix it with a slope sensor or something, though.
I can add a bit that can do that. Give me a second.
Edit: Put this with that script.
Last edited by Kileymeister_test (2010-12-24 13:03:31)
Offline
This project shows the best way to do all collisions.
http://scratch.mit.edu/projects/archmage/101212
download it and look at the scripts
Offline
Pretty much what I think everyone else is saying. Set a max velocity for your sprite, create a modding system (when you can), or just have a sensor that finds a better position.
Offline