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

#1 2011-03-18 15:18:13

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Circle Offset for Leg Movement (Solved)

Solved by myself. Just put the trig blocks together randomly and got it.
*groans* wasted 3 valuable minutes posting  tongue

Original:
____________

Hi all, me again.

I'm trying out an animation technique for the movement of legs in an NPC character for my next game (if this works).

Basically, I have the main body of the character, "Char".

I then have two legs (which move in the same way, so I'll only portray one) which follow "Char" around, but moving in constant circles.

Here is my script so far:
http://dl.dropbox.com/u/11532575/legcharacterhelp.gif

I need Xoff and Yoff to change accordingly, as if they were actual position variables, to end up with a circle path. Diagram:  big_smile
http://dl.dropbox.com/u/11532575/legdiagram.png

Get it?
I imagine we need some trig, but I'm getting there next month. For now, I have to rely on the kindness of strangers. Let's hope there's some left  wink

Thanks!

Last edited by LS97 (2011-03-18 15:21:44)

Offline

 

#2 2011-03-18 15:22:56

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

Re: Circle Offset for Leg Movement (Solved)

I can help you with this.  If it's direction does not have to be a specific thing, click the square button to the left of the sprite at the top above the scripts, and use this:
http://i54.tinypic.com/bjec7q.gif
Put that in the forever block.  Change the 5 at the ends to adjust how far the leg should be from the center, adjust how fast it turns to change, er, how fast it turns.


However, if the direction of it is important, add this in:
http://i56.tinypic.com/2afd6cp.gif
And get rid of the turn block.  Replace the http://i52.tinypic.com/2zi1vmb.gif pieces with http://i55.tinypic.com/2mwrig.gif pieces.

Last edited by Kileymeister (2011-03-18 15:26:52)


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

 

#3 2011-03-19 05:29:30

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: Circle Offset for Leg Movement (Solved)

Kileymeister wrote:

I can help you with this.  If it's direction does not have to be a specific thing, click the square button to the left of the sprite at the top above the scripts, and use this:
http://i54.tinypic.com/bjec7q.gif
Put that in the forever block.  Change the 5 at the ends to adjust how far the leg should be from the center, adjust how fast it turns to change, er, how fast it turns.


However, if the direction of it is important, add this in:
http://i56.tinypic.com/2afd6cp.gif
And get rid of the turn block.  Replace the http://i52.tinypic.com/2zi1vmb.gif pieces with http://i55.tinypic.com/2mwrig.gif pieces.

Thanks heaps! It worked really well and I just locked its direction. I don't think I'll need more tweaking, it shouldn't become an all-animation project.

Offline

 

Board footer