Discuss Scratch

Paradiseislands
Scratcher
1 post

How do I mirror a sprite using scripts

I want to know how to mirror a sprite using a script.
drmcw
Scratcher
1000+ posts

How do I mirror a sprite using scripts

With quite a lot of work. Where is the mirror? x axis, y axis, at an angle? You'd need to reflect all costumes and calculate all positions and rotations as the sprite moves. At its simplest it would be multiplying an axes values by -1 and doing rotations in the opposite direction.
Epiccraft
Scratcher
41 posts

How do I mirror a sprite using scripts

drmcw wrote:

With quite a lot of work. Where is the mirror? x axis, y axis, at an angle? You'd need to reflect all costumes and calculate all positions and rotations as the sprite moves. At its simplest it would be multiplying an axes values by -1 and doing rotations in the opposite direction.
Didn't work.
deck26
Scratcher
1000+ posts

How do I mirror a sprite using scripts

Can you share something so we can see what you're trying to do. ‘Mirroring a sprite’ could mean different things, some easier than others.
StampyPenguin101
Scratcher
70 posts

How do I mirror a sprite using scripts

look inside this project
duckboycool
Scratcher
1000+ posts

How do I mirror a sprite using scripts

when green flag clicked
forever

if <<(x position) > [-240]> and <(x position) < [0]>> then
create clone of [Myself v]


set [x v] to (x position)
wait until <> //action
end

end

when I start as a clone
set x to ((X) + (240))
wait until <>
delete this clone
For Y
when green flag clicked
forever

if <<(y position) > [-180]> and <(y position) < [0]>> then
create clone of [Myself v]

set [Y v] to (y position)
wait until <>
end

end

when I start as a clone
set y to ((Y) + (180))
wait until <>
delete this clone
Also
when green flag clicked
forever

set [Dir v] to (direction)
end
when I start as a clone
point in direction ((Dir) + (180))
Btw maybe do different sprites or might break.

Last edited by duckboycool (May 30, 2015 02:47:48)

tagundnacht001
New Scratcher
1 post

How do I mirror a sprite using scripts

lol
Blackout32
Scratcher
500+ posts

How do I mirror a sprite using scripts

MIRROR SCRIPT HERE:


Sprite you want to mirror:
when green flag clicked
create clone of [sprite v]

when I start as a clone
go to x: (Mirror x) y: (mirror y)
point in direction (-90 v)

Mirror sprite:
when green flag clicked
forever
set (Mirror x) to (x position)
set [Mirror y v] to (y position)
end


To make Mirror x and mirror y, Go to varibles and click “Make a varble” Then name one Mirror x and press done. Than repeat wih mirror y.
Blackout32
Scratcher
500+ posts

How do I mirror a sprite using scripts

I DONT CARE ABOUT SPELLING VARBLE RIGHT OK lol
Blackout32
Scratcher
500+ posts

How do I mirror a sprite using scripts

This is useless talk. The Q was made in 2013
SavageCode2019
New Scratcher
1 post

How do I mirror a sprite using scripts

How do I make a sprite go back and forth?
deck26
Scratcher
1000+ posts

How do I mirror a sprite using scripts

SavageCode2019 wrote:

How do I make a sprite go back and forth?
Please create your own topic rather than bringing an old one back to life.

Experiment with the movement blocks in a loop. This is a good exercise for working out how to do something for yourself.
Raged_Warrior009
Scratcher
3 posts

How do I mirror a sprite using scripts

Hopefully this is the right place to ask this, but how do you change one sprite, and flip it around to make it look mirrored without coding?

In Scratch 3.0

Last edited by Raged_Warrior009 (April 3, 2019 01:03:49)

1132262
Scratcher
1000+ posts

How do I mirror a sprite using scripts

Raged_Warrior009 wrote:

Hopefully this is the right place to ask this, but how do you change one sprite, and flip it around to make it look mirrored without coding?

In Scratch 3.0
Wrong place to ask this. Make a new topic.
skymover1239
Scratcher
500+ posts

How do I mirror a sprite using scripts

Raged_Warrior009 wrote:

Hopefully this is the right place to ask this, but how do you change one sprite, and flip it around to make it look mirrored without coding?

In Scratch 3.0
You go in too the paint editor and use the mouse tool. And there should be a button up there by delete. Hope this helps!
ARandomFurret
Scratcher
2 posts

How do I mirror a sprite using scripts

please help me mirror a sprite
aaaleapyear
Scratcher
8 posts

How do I mirror a sprite using scripts

Blackout32 wrote:

MIRROR SCRIPT HERE:


Sprite you want to mirror:
when green flag clicked
create clone of [sprite v]

when I start as a clone
go to x: (Mirror x) y: (mirror y)
point in direction (-90 v)

Mirror sprite:
when green flag clicked
forever
set (Mirror x) to (x position)
set [Mirror y v] to (y position)
end


To make Mirror x and mirror y, Go to varibles and click “Make a varble” Then name one Mirror x and press done. Than repeat wih mirror y.
or, you could do go to mirror x *-1 and mirror y&-1, that is what I always do(:
LOlzui_thor5_9
New Scratcher
1 post

How do I mirror a sprite using scripts

LOl
The_Imaginarium
Scratcher
1000+ posts

How do I mirror a sprite using scripts

This topic has been necroposted 4 times xD
If people really want to know:
when green flag clicked
create clone of [myself v]
set drag mode to [draggable v]
forever
set [Mirror X v] to ((x position)*(-1))
set [Mirror Y v] to ((y position)*(-1))
end

when I start as a clone
forever
go to x: (Mirror X) y: (Mirror Y)
end

Powered by DjangoBB