8.0 (14 votes)
    GM 6
    November 21, 2006
Dev - DB/form (refering to updated - check code)
    DOWNLOAD (1050)
Dev - make AJAX
Screenshots (1)
Dev - Also, on form submission, use GD to resize the image as a new thumbnail file
Dev - In the submission form, you can now upload a banner image
Reflecting water
I've made this 'engine' (don't know if it deserves that title, but that sort of thing) over the last couple of days.
It would only really work for side-on perspective games, or one in which you can't enter the water as it reflects the area above it, but not anything in it.

It's my first time at using surfaces so it may not be done as efficiently as possible.

You can edit the properties of the reflections in obj_water's create event (except the speed of wobbles, which is in surf_ctrl's create event), or in the room in the example (push F1 for controls). It allows you to vary:

-The quality of the water (number of scanlines across it).
-The length of the reflections.
-The angle of the reflections.
-The 'wobbliness' of the reflections.
-The speed of the wobbles.

You can also edit the alpha value and colour of the reflections by editing their values in obj_water's draw event, in the draw_surface_ext() line.

This requires a registered version of gamemaker, as it uses surfaces. If you don't have a registered version, you can find a .exe here, that you can play with if you like:

If you should want to, it is very easy to add this to your own games. All you need is the surf_ctrl object in the room, and place water objects where you want them. Just merge this with your own game and add them to your rooms.
You can change the size of the water sprite, and it should still work. However, note the sprite needs to be rectangular. You can give it different shapes by drawing another sprite over the top of it, as i have done in the example.

I hope someone finds this useful, and I would very much appreciate any comments/suggestions. And if people could let me know how it performed on their pc (fps), along with their pc's specs, then that would be great too.

There is a slight problem in that if you change the reflection angle, the reflected sprite at the edge of the room may be stretched.
This is because the surface is only of the visible screen. If anyone knows how i can get the surface to contain stuff that is not in view, I would be very grateful if they could let me know.

I've also noticed that as I have added variables to allow you to change the values of the properties of the water "on the fly" in the example, that the fps has dropped a bit. So if you want to use this in your games, i would recommend taking out the variables and instead just putting the values straight in in the code.

Thanks a lot,

Target platforms:

I liked it, except the bad graphics made it less enjoyable.

Good example, bad presentation. 7/10
Posted by duckman November 21, 2006 16:41 - 11.1 years ago
| [#01]

very nice i agree with buffit but since its pretty good ill give it a 8
Posted by Darktech November 21, 2006 17:04 - 11.1 years ago
| [#02]

You REALLY ought to use polygons, not normal drawing functions
Posted by Gamer3D November 21, 2006 17:37 - 11.1 years ago
| [#03]

I think that it is really nice, but still has ton of room for improvements, such as shine, and other realistic functions. 8/10
Posted by Siert November 21, 2006 18:44 - 11.1 years ago
| [#04]

cool 8
Posted by Rob November 21, 2006 19:31 - 11.1 years ago
| [#05]

A good example, quite fast too. 9/10.
Posted by E-Magination November 22, 2006 8:02 - 11.1 years ago
| [#06]

nice! exept the graphics, but examples are not about graphics (most of the time) this is also good if you set the wobble size and speed realy high, for a kind of... well nice... bad tv effect, or if you make the wobbles small, it would be a good heat convection effect
Posted by punimer_gm November 22, 2006 11:14 - 11.1 years ago
| [#07]

would be hard to incorporate, but i doubt theres an easier way, i give it 9/10
Posted by Bozebo November 22, 2006 11:54 - 11.1 years ago
| [#08]

heat convection effect

isnt it heat smart?... convection is a type of flow... but mreh lolz
Posted by Bozebo November 22, 2006 11:55 - 11.1 years ago
| [#09]

The example was okay. Yes the graphics were not so great, but its an example. he problem I saw was that the reflection only wiggled when it was moving up or down, and that is very unrealistic. There's either no waves, or waves. ;)

Posted by Alert Games November 22, 2006 13:57 - 11.1 years ago
| [#10]

nice example, but graphics are not so good.
Posted by Trigger November 22, 2006 14:16 - 11.1 years ago
| [#11]

Thanks a lot for all the comments :)

Yeah, the graphics are bad, i can't draw. It's not really about the graphics though, but i might try and neaten it up at some point to make it a bit less hard on the old peepers.

About suggestions for other effects: I think most of these effects suggested (eg, waves/shine) would slow it down quite a lot. At the moment, it's drawn by the line. But if it were to shine on cerain sections, the lines would need to be further split along their length to draw spots of shine.

Alert Games: The sprites do move side to side as well, perhaps it isn't very noticeable at the default settings, but the x positions of each line on the water varies sinusoidally (spelling?) with time.
I might have a think about actual waves rather than an overall wobble. I think it could be done by basing each line's position on the others' or something.

If anyone has any ideas/ways i could make any of these, or other, improvements, i would be very happy to hear.
Posted by Jaythediv November 22, 2006 16:16 - 11.1 years ago
| [#12]

nice example 10/10
i had fun
Posted by Graydon November 22, 2006 16:55 - 11.1 years ago
| [#13]

An effect i've always wanted to know how to do... doesn't particularly help me with what I really want, but I may learn something from it yet...
Posted by Zaron November 23, 2006 1:39 - 11.1 years ago
| [#14]

the graphics are bad but it's going about the idea and i like it! it's nearly excactly what i need for my game but is it possible to let the water wave?
Posted by samee November 24, 2006 12:27 - 11.1 years ago
| [#15]

Needs better graphics, but it's a nice effect. 8/10 for the graphics.
Posted by Kilin December 01, 2006 12:47 - 11.1 years ago
| [#16]

pretty cool 8/10
Posted by 6661337 May 19, 2007 12:36 - 10.6 years ago
| [#17]

Recent Activity
Active Users (0)