In all my time playing scratch I have figured out how to do many things with it, but there's one thing I can't figure out. I already know how to make different "hiding" sprites to help the main sprite "sense" objects, but how do I make a sprite sense an upward slope and climb up it? Knowing how to do this would help me very much and help me finish some of my games I started long ago.
Oh, and please I would like to know the best way to do it. Not some way that just works, but one that will work the best. Thanks in advance, StrykerV.
Offline
Try making the character change his y position by the absolute value of how fast he's going horizontally. Then check from there immediately afterwards if he's touching the ground.
Do you know how to use velocity? If so, put this in a script:
Put the second, detached part into the "else" section however many times you want to change the degree between when a slope is a slope or a wall.
Last edited by Kileymeister_test (2010-11-27 12:27:48)
Offline
StrykerV wrote:
Ahhh, I think I get it now, thank you, I would have never figured that out on my own.
Happy to help.
Offline
Whats with the abs thing? please answer because I still dont get it.
Offline
Groudon297 wrote:
Whats with the abs thing? please answer because I still dont get it.
![]()
Abs stands for "absolute value". It's not that complex an idea, basically it's the positive of a number, no matter what.
Ex.
Abs(5)=5
Abs(-5)=5
Offline
Groudon297 wrote:
Whats with the abs thing? please answer because I still dont get it.
![]()
Absolute value. It's helpful because if I'm moving right my xvelocity would be negative, and without the absolute value if I was going right up a slope, I would go downward instead of up.
Offline