Discuss Scratch

redstoneminer111
Scratcher
32 posts

How do i make a mirror?

I need to make a mirror that reflects sprites.
AcousticGuy
Scratcher
87 posts

How do i make a mirror?

There isn't an easy way to do this. But first you need to of the same sprite (one of them actually needs to be the opposite of the other one). Can you share the project and then give me the link? It is really hard just to tell you.
gtoal
Scratcher
1000+ posts

How do i make a mirror?

make a clone of your sprite. set rotation style to x-y. rotate 180. place clone at (-x, y) coordinates of main sprite, which you can get by sensing block.
Ayarkay
Scratcher
73 posts

How do i make a mirror?

Was not as simple as I originally thought. Here's a pretty questionable implementation that I made:

https://scratch.mit.edu/projects/171568133/

The only really annoying problem is that even though the centre of the sprite may be in front of the mirror, the edges of the sprite might not be in front of the mirror, and so you wouldn't want the edge of the sprite to be displayed. Otherwise it would look like your reflection extends further than the mirror. To address this I just made “blocker” objects that are essentially walls that are in front of my reflection, so if the edges of the sprite extend further than the edge of the mirror, they're hidden behind the “blocker” objects.

Last edited by Ayarkay (Aug. 18, 2017 16:53:44)

redstoneminer111
Scratcher
32 posts

How do i make a mirror?

gtoal wrote:

make a clone of your sprite. set rotation style to x-y. rotate 180. place clone at (-x, y) coordinates of main sprite, which you can get by sensing block.
Can you show the script with blocks?
deck26
Scratcher
1000+ posts

How do i make a mirror?

Ayarkay wrote:

Was not as simple as I originally thought. Here's a pretty questionable implementation that I made:

https://scratch.mit.edu/projects/171568133/

The only really annoying problem is that even though the centre of the sprite may be in front of the mirror, the edges of the sprite might not be in front of the mirror, and so you wouldn't want the edge of the sprite to be displayed. Otherwise it would look like your reflection extends further than the mirror. To address this I just made “blocker” objects that are essentially walls that are in front of my reflection, so if the edges of the sprite extend further than the edge of the mirror, they're hidden behind the “blocker” objects.
Looks like a good version to me - what does the OP think?
HelloRuler
Scratcher
47 posts

How do i make a mirror?

Its good. Works well…
deck26
Scratcher
1000+ posts

How do i make a mirror?

HelloRuler wrote:

Its good. Works well…
No need to necropost to say that though.

Powered by DjangoBB