-1

I'll start off by saying that I have searched if someone had already asked the same question, but it doesn't seem so. the question i want to ask y'all is the same as the one in the "title", so, how can I, (a newbie) create water/mirror reflection in gamemaker studio 1.4 (pro)? thanks in advance and sorry for my bad english. I am looking forward to learn more, both by your answers and from my personal experiences, too!

Envy
  • 3
  • 5
  • It might not be the question that has been asked, but "water reflection" in "game maker" does occur a lot on the internet. You might want to go with a tutorial on a script base like this one; https://www.youtube.com/watch?v=kimT6d0YvP0 or scout the marketplace; https://marketplace.yoyogames.com/search/results?utf8=%E2%9C%93&query=water Or you can go with shaders. – Rob Jan 22 '19 at 09:00

2 Answers2

0

There's three ways you could achieve a reflection effect, but I'm afraid none are really "beginner" level.

The easiest one would be to draw an inverted sprite of the reflected object. This might work for a few objects, but it's not very accurate and doesn't allow for more advanced effects.

The second one would be to use surfaces. Create a surface, capture the reflected area, draw in reverse. With that, you can use a bit more effects.

The third way would be shaders, but it seems even less beginner friendly imo.

If the first solution doesn't help, I would suggest finding a workaround until you have the appropriate experience or learn using surfaces.

Fox
  • 16
  • 1
0

example in empty project

1 create a sprite example:

spr_player

2 create two objects

example:

 obj_player // assign them the sprite that you created
 obj_reflection

3 on the obj_player

event step

/// @description maker event step
// character movement

friction = 0.1;

if (keyboard_check (vk_right))
{
    direction = 0;
    speed = 4;
}

if (keyboard_check (vk_left))
{
    direction = 180;
    speed = 4;
}

if (keyboard_check (vk_up))
{
    direction = 90;
    speed = 4;
}

if (keyboard_check (vk_down))
{
    direction = 270;
    speed = 4;
}

4 on the obj_reflection

event draw

/// @description maker draw event
// redraw the object (the same sprite, same position x, same position and more the size of the object, same width, we invert the scale in half, same angle, same color mix, transparency in half)

draw_sprite_ext (spr_player,0,obj_player.x,obj_player.y + 100,image_xscale,-0.5,image_angle,image_blend, 0.5);

5 we put both objects in the room and voila we have a reflection

6 experiment changing the values ​​to see the results

7 for the water effect we place the objects in different layers placing the reflection object underneath and the texture of water in the middle layer

8 by the way I speak Spanish, if so, enter your question at https://es.stackoverflow.com/

if you liked the answer give me a plus 1, thank you very much. BusyClown +51912423012

BusyClown
  • 76
  • 4
  • I cannot really give you a +1, due to my low rep. However, i really must thank you for helping me out – Envy Mar 22 '19 at 12:42