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

#1 2007-08-17 01:49:31

AlveKatt
Scratcher
Registered: 2007-08-12
Posts: 100+

Rotation points

Something that would be real nice is if you could have multiple, and movable, rotationpoints on a sprite. Hello ragdolls! Among other things.

Last edited by AlveKatt (2007-08-17 01:49:47)

Offline

 

#2 2007-08-17 10:39:48

archmage
Scratcher
Registered: 2007-05-18
Posts: 1000+

Re: Rotation points

So I am assuming you want to be able to make something like this?
http://pekkasandborg.com/portfolio/?id=2

Well that is just made using multiple sprites tied together. (by putting several sprites into one sprite)


Hi, I am Archmage coder extraordinaire. I do Scratch,pascal,java,php,html, AS2 and AS3. Leave me a message if you want coding advice. Also check out my personal website, lots of good stuff about web development, Flash, and Scratch (v1 and v2) !

Offline

 

#3 2007-08-17 12:17:32

AlveKatt
Scratcher
Registered: 2007-08-12
Posts: 100+

Re: Rotation points

While that is an excellent example of what I mean that's probably not what I would do with it. I'm a spaceopera fanatic, so if this becomes a feature expect games where you controll huge space ships with loads of turrets!

Offline

 

#4 2007-08-17 20:51:05

archmage
Scratcher
Registered: 2007-05-18
Posts: 1000+

Re: Rotation points

AlveKatt wrote:

While that is an excellent example of what I mean that's probably not what I would do with it. I'm a spaceopera fanatic, so if this becomes a feature expect games where you controll huge space ships with loads of turrets!

You could still make a turret follow a ship. Just don't expect it to move perfectly in sync with the ship. Also how a "turret" is normally done is not with multiple rotation points but by putting several sprites into a single sprite.


Hi, I am Archmage coder extraordinaire. I do Scratch,pascal,java,php,html, AS2 and AS3. Leave me a message if you want coding advice. Also check out my personal website, lots of good stuff about web development, Flash, and Scratch (v1 and v2) !

Offline

 

#5 2007-08-18 05:36:43

AlveKatt
Scratcher
Registered: 2007-08-12
Posts: 100+

Re: Rotation points

archmage wrote:

You could still make a turret follow a ship. Just don't expect it to move perfectly in sync with the ship. Also how a "turret" is normally done is not with multiple rotation points but by putting several sprites into a single sprite.

Can you make sprites that have many sprites in Scratch?

How can I make a turret follow a ship? I know how to do it if I settle for the turret being at the rotation point. But how if I want it off set from there?

Offline

 

#6 2007-08-18 10:28:38

archmage
Scratcher
Registered: 2007-05-18
Posts: 1000+

Re: Rotation points

Just make a variable called shipx and shipy which are the x and y co-ordinates of the ship.
Then on the turret put:

when flag clicked
forever
go to x (shipx + #how much you want x to move) y (shipy+ #how much you want y to move)

PS: and no you can't put sprites inside sprites in scratch.

Last edited by archmage (2007-08-18 10:29:38)


Hi, I am Archmage coder extraordinaire. I do Scratch,pascal,java,php,html, AS2 and AS3. Leave me a message if you want coding advice. Also check out my personal website, lots of good stuff about web development, Flash, and Scratch (v1 and v2) !

Offline

 

#7 2007-08-18 11:09:00

AlveKatt
Scratcher
Registered: 2007-08-12
Posts: 100+

Re: Rotation points

Aaah. That would work until the ship turns, right?

Offline

 

#8 2007-08-18 11:57:05

archmage
Scratcher
Registered: 2007-05-18
Posts: 1000+

Re: Rotation points

AlveKatt wrote:

Aaah. That would work until the ship turns, right?

Yes.


Hi, I am Archmage coder extraordinaire. I do Scratch,pascal,java,php,html, AS2 and AS3. Leave me a message if you want coding advice. Also check out my personal website, lots of good stuff about web development, Flash, and Scratch (v1 and v2) !

Offline

 

#9 2007-08-18 13:26:17

AlveKatt
Scratcher
Registered: 2007-08-12
Posts: 100+

Re: Rotation points

That's why extra rotation points would be nice. Then you can have sprites stick to another sprite and keep their position on the other sprite even if it changes direction while still pointing in the direction you want it to point.

Offline

 

#10 2007-08-24 03:14:16

Mayhem
Scratcher
Registered: 2007-05-26
Posts: 1000+

Re: Rotation points

What would solve this problem (and others) would be a "rotate around" command.

Rotate (x) degrees (left/right) around point (x), (y).

So when you turret turns you use normal rotate, when the ship turns, you rotate the turret an equal amount around the ships current x/y coordinate.

This would also make rotational scrolling scenary possible - ie where when you turn left, the vehicle sprite stays still but the scenary rotates around it to the right, giving the illusion of a turn.


Web-spinning Spider:  http://scratch.mit.edu/projects/Mayhem/18456
3D Dungeon Adventure:  http://scratch.mit.edu/projects/Mayhem/23570
Starfighter X: http://scratch.mit.edu/projects/Mayhem/21825
Wandering Knight: http://scratch.mit.edu/projects/Mayhem/28484

Offline

 

Board footer