This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2011-06-04 19:17:39

redman123
New Scratcher
Registered: 2011-05-18
Posts: 18

How to make sprites walk on terrian properly ?

HI,

I got a question again.
Please check the following script.
http://i.imgur.com/TaTBH.gif

I want to make my sprite walk on the terrians [black] .
If encountering slopes, it goes uphill and then downhill.
This scrpit sort of works but the sprite keeps slightly shaking.

How to solve the problem ?

Thanks in advance.

Offline

 

#2 2011-06-04 19:30:21

redman123
New Scratcher
Registered: 2011-05-18
Posts: 18

Re: How to make sprites walk on terrian properly ?

I think I found the problem. The shaking problem happens in preview [stage] mode.
It doesn't happen presentation mode.

By the how to make sprites stand [touch] exactly on the terrian ?
In my case, I still can see there is a tiny gap between the sprite and the terrian .

Offline

 

#3 2011-06-04 19:31:11

Liduen
Scratcher
Registered: 2011-05-09
Posts: 100+

Re: How to make sprites walk on terrian properly ?

I'm not really sure... I have always had this problem when creating a script like that. Try looking for a well made platformer (where a sprite walks on terrian) and see how they did it.
maybe try this project?


Atra esterní ono thelduin, mor'ranr lífa unin hjarta onr, un du evarínya ono varda.http://scratch.mit.edu/static/projects/Liduen/1906362_sm.pngJoin Scratch Writers!

Offline

 

#4 2011-06-04 19:34:31

Kileymeister
Scratcher
Registered: 2008-04-17
Posts: 1000+

Re: How to make sprites walk on terrian properly ?

Instead of change y by 5 (which makes it jump up too fast), try breaking it up into one pixel jumps instead, like this:
http://i53.tinypic.com/308v8fc.gif
Note it adds up to 5 in the end.

P.S. that last change y by -1 is to ensure it's right on the ground and not 1 pixel above, it must go right where it is, within the first "if touching black" sensor, not outside of it.

Last edited by Kileymeister (2011-06-04 19:34:42)


I'm back, and showcasing two new* projects!  Click left or right on the image below to see!
http://img109.imageshack.us/img109/7905/part1l.pnghttp://img859.imageshack.us/img859/6417/part2bf.png

Offline

 

#5 2011-06-28 20:52:44

ethanfirebird
Scratcher
Registered: 2011-05-21
Posts: 2

Re: How to make sprites walk on terrian properly ?

i do when flag clicked forever if touching colour black change y by -3

Offline

 

Board footer