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

#1 2011-04-18 11:03:51

Severus14
Scratcher
Registered: 2011-02-03
Posts: 62

Rotation?

I am trying to make a sprite that rotates, and I also need a sprite that can stand on it and rotate with it. I need scripts for both! Very mentally challenging...  hmm

Offline

 

#2 2011-04-18 21:04:10

Harakou
Community Moderator
Registered: 2009-10-11
Posts: 1000+

Re: Rotation?

I don't completely understand what you're saying. Do you need both sprite to rotate about the same point, or will they both be rotating about their respective centers?


http://www.blocks.scratchr.org/API.php?action=random&return=image&link1=http://i.imgur.com/OZn2RD3.png&link2=http://i.imgur.com/duzaGTB.png&link3=http://i.imgur.com/CrDGvvZ.png&link4=http://i.imgur.com/POEpQyZ.png&link5=http://i.imgur.com/ZKJF8ac.png

Offline

 

#3 2011-04-18 21:51:54

Severus14
Scratcher
Registered: 2011-02-03
Posts: 62

Re: Rotation?

Harakou wrote:

I don't completely understand what you're saying. Do you need both sprite to rotate about the same point, or will they both be rotating about their respective centers?

No, I am making a space game, and I have a planet that rotates. When the player stands on that planet, I want it 2 be able to rotate, too.

Offline

 

#4 2011-04-18 21:59:22

Paddle2See
Scratch Team
Registered: 2007-10-27
Posts: 1000+

Re: Rotation?

Severus14 wrote:

Harakou wrote:

I don't completely understand what you're saying. Do you need both sprite to rotate about the same point, or will they both be rotating about their respective centers?

No, I am making a space game, and I have a planet that rotates. When the player stands on that planet, I want it 2 be able to rotate, too.

Where is the player when they are not on the planet? 

You might be able to get away with just making the sprite center of the player a point exactly one planet radius below the player's feet.  Then, you could just turn the player and it would look like they were on the surface of the planet.   If the player were on different planets at different times, you could even have different costumes with sprite centers to match the planets.


http://i39.tinypic.com/2nav6o7.gif

Offline

 

#5 2011-04-19 11:11:20

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

Re: Rotation?

This is possible, but can be a bit complex.  I suggest you use a script engine for a movable rotation center (like this one: http://scratch.mit.edu/projects/Kileyme … est/872439). 

In that engine I'll explain the variables and what you need to change in it:
Make RoX the planet's X position
Make RoY the planet's Y position
RoA determines where the player is around the planet. (change it to rotate the player)
RoD determines how far you are from the planet (cannot be altered though, to change the distance from the planet, just use a move block to move the player away from the planet, it will change accordingly)

To make the player rotate around the planet, simply make a script that changes RoA by a positive number to rotate counterclockwise and negative to rotate clockwise.

It's rather complex, but hopefully you can figure it out.

Last edited by Kileymeister (2011-04-19 11:13:08)


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

 

Board footer