Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » How do i make a mirror?
- redstoneminer111
-
32 posts
How do i make a mirror?
I need to make a mirror that reflects sprites.
- AcousticGuy
-
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
-
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
-
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.
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
-
32 posts
How do i make a mirror?
Can you show the script with blocks? 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.
- deck26
-
1000+ posts
How do i make a mirror?
Looks like a good version to me - what does the OP think? 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.
- deck26
-
1000+ posts
How do i make a mirror?
No need to necropost to say that though. Its good. Works well…
- Discussion Forums
- » Help with Scripts
-
» How do i make a mirror?