Zonar Games Posted July 14, 2006 Report Share Posted July 14, 2006 I'm using Game Maker 6.1, and in my beach level I'm trying to figure out an easier way to draw water across a certain y axis across the whole level. So can anyone help me draw a rectangle with the image blend of 0.5 and draw it across a certain y axis in the level? I can't figure out how to do it. Link to comment Share on other sites More sharing options...
Kain Posted July 14, 2006 Report Share Posted July 14, 2006 draw_set_alpha(0.5); draw_set_color(c_blue); if( view_yview+view_hview >= global.water_level) draw_rectangle(view_xview , max( view_yview,global.water_level ) , view_xview + view_wview , view_yview + view_hview , 0 ); You could probably do it without the max (just substiture global.water_level) and you could use a min with the view_yview+view_hview, but this way makes the most sense to me. Edit: come to think, you might see a small streak at the bottom if the water's bellow the screen and probably wastes a tiny bit of time (though I doubt much), so I added an if statement. Link to comment Share on other sites More sharing options...
Zonar Games Posted July 14, 2006 Author Report Share Posted July 14, 2006 Thanks Kain, I'm going to test it out. Link to comment Share on other sites More sharing options...
VectorSatyr Posted July 14, 2006 Report Share Posted July 14, 2006 Here's an alternative to what Kain mentioned: EDIT: x = view_xview; y = max( floor(objPlayer.y) - view_hview, global.water_height, view_yview ); draw_set_alpha( 0.5 ); draw_set_color(c_blue); draw_rectangle( floor(x), floor(y), view_xview + view_wview, view_yview + view_hview, false ); draw_set_color(c_white); Link to comment Share on other sites More sharing options...
Zonar Games Posted July 14, 2006 Author Report Share Posted July 14, 2006 Thanks guys it works! Link to comment Share on other sites More sharing options...
Recommended Posts